-
Notifications
You must be signed in to change notification settings - Fork 0
Add indented Links Notation format support (#17) #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: #17
Implements indented Links Notation format support as requested in #17. The new format displays objects in a human-readable style: <identifier> <key> "<value>" ... Functions added: - formatIndented({ id, obj, indent }) - Format object to indented style - parseIndented({ text }) - Parse indented style back to object 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implements indented Links Notation format support as requested in #17. The new format displays objects in a human-readable style: <identifier> <key> "<value>" ... Functions added: - format_indented(id, obj, indent) - Format object to indented style - parse_indented(text) - Parse indented style back to (id, obj) tuple - escape_reference(value) - Escape a reference for Links Notation - unescape_reference(str) - Unescape a reference from Links Notation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implements indented Links Notation format support as requested in #17. The new format displays objects in a human-readable style: <identifier> <key> "<value>" ... Functions added in lino_objects_codec::format module: - format_indented(id, obj, indent) - Format HashMap to indented style - format_indented_ordered(id, pairs, indent) - Format with key order preserved - parse_indented(text) - Parse indented style back to (id, HashMap) - escape_reference(value) - Escape a reference for Links Notation - unescape_reference(str) - Unescape a reference from Links Notation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implements indented Links Notation format support as requested in #17. The new format displays objects in a human-readable style: <identifier> <key> "<value>" ... Methods added in Lino.Objects.Codec.Format class: - FormatIndented(id, obj, indent) - Format dictionary to indented style - FormatIndentedOrdered(id, pairs, indent) - Format with key order preserved - ParseIndented(text) - Parse indented style back to (id, Dictionary) - EscapeReference(value) - Escape a reference for Links Notation - UnescapeReference(str) - Unescape a reference from Links Notation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add examples and documentation for the new formatIndented and parseIndented functions in JavaScript, Python, Rust, and C#. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
New feature release including: - formatIndented / parseIndented functions for human-readable object display - escape_reference / unescape_reference utilities - Comprehensive tests for all implementations 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Python: - Fix mypy Optional[str] type error in parse_indented - Fix ruff E712 comparison to True in experiment - Fix ruff E402 import order in experiment Rust: - Remove redundant else block in escape_reference - Add BuildHasher generic to format_indented for clippy - Convert match to let-else pattern in parse_indented 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
|
I want us to prefer using http://github.com/link-foundation/links-notation for any parsing, and if it has formatting that is not extensible or configurable enough for us to accomplish all required tasks in the code, we need to file issues about missing features or bugs in http://github.com/link-foundation/links-notation repository. As this library is more specific to objects, the links-notation library should be kept universal for any links, that are covered by the links theory https://habr.com/en/articles/895896 |
|
🤖 AI Work Session Started Starting automated work session at 2026-01-04T00:30:01.311Z The PR has been converted to draft mode while work is in progress. This comment marks the beginning of an AI work session. Please wait working session to finish, and provide your feedback. |
This commit addresses the review feedback requesting that parsing should use the links-notation library instead of custom parsing logic. Changes: - JavaScript: parseIndented now uses links-notation Parser for parsing - Python: parse_indented now uses links_notation.Parser for parsing - Rust: parse_indented now uses links_notation::parse_lino_to_links - C#: ParseIndented now uses Link.Foundation.Links.Notation.Parser All implementations: - Add colon to identifier if not present (standard lino format) - Filter empty lines to preserve indentation structure - Extract key-value pairs from parsed Link structure Also updated value quoting strategy to use links-notation compatible format: - Values containing double quotes are wrapped in single quotes - Values containing single quotes are wrapped in double quotes - This ensures round-trip compatibility with the links-notation parser Added experiment scripts in experiments/ folder for testing and validation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
I've addressed the feedback to use the Changes made:
The implementation:
All tests pass across all languages. |
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
🔄 Auto-restart 1/3Detected uncommitted changes from previous run. Starting new session to review and commit them. Uncommitted files: Auto-restart will stop after changes are committed or after 2 more iterations. Please wait until working session will end and give your feedback. |
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
Summary
This PR implements indented Links Notation format support as requested in #17. The new format provides a human-readable representation for displaying objects with key-value pairs.
New Format
The indented Links Notation format displays objects as:
Example:
Changes
formatIndented()andparseIndented()functions informat.jsformat_indented()andparse_indented()functions in newformat.pymoduleformatmodule withformat_indented(),format_indented_ordered(), andparse_indented()Formatclass withFormatIndented(),FormatIndentedOrdered(), andParseIndented()Key Implementation Details
All
parseIndentedfunctions now use thelinks-notationlibrary for parsing:Parserfromlinks-notationParserfromlinks_notationparse_lino_to_linksfromlinks_notationParserfromLink.Foundation.Links.NotationThe parsing implementation:
Value quoting uses links-notation compatible format:
'He said "hello"'"it's"API Reference
formatIndented({ id, obj, indent })parseIndented({ text })format_indented(id, obj, indent)parse_indented(text)format::format_indented(id, &obj, indent)format::parse_indented(text)Format.FormatIndented(id, obj, indent)Format.ParseIndented(text)Test Results
Version Bump
All packages bumped to version 0.2.0.
Test plan
cd js && npm testcd python && pytest tests/cd rust && cargo testcd csharp && dotnet testCloses #17
🤖 Generated with Claude Code