Repository navigation
feat(cli): uteke doc export --front-matter (#1470 a) - #1647
Merged
Merged
Conversation
Prefixes each Markdown document with YAML front-matter (slug, title, tags, parent slug) so a vault import keeps the hierarchy. Values are JSON-quoted strings, valid YAML double-quoted scalars. Off by default: the plain export is byte-identical; ignored with --json. No doc import reads it back, documented in the CLI reference.
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
4 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
uteke doc export --front-matter(#1470 item a, plandocs/plans/2026-10-29-dx-bundle-1470.mdsection 2). Each Markdown document gets a YAML block first:parentis the parent slug (""for a root). A parent outside the exported set is looked up once so it is still named.:,#, quotes and newlines need no extra escaping.--json(the JSON already carries these fields).doc import, so nothing reads the front-matter back.docs/cli-reference.mdsays so and points touteke export --full/import --fullfor a lossless round trip.doc exportrow was stale: it said JSON), CHANGELOG.yaml-rust2(test only) to parse the front-matter as real YAML.Why
So a vault or static-site import keeps the document hierarchy (#1470).
Testing
Tests written first (failed to compile against the old signature), then:
front_matter_keeps_the_bodies_byte_identical: with the front-matter removed, the output equals the plain export.front_matter_parses_as_yaml_with_awkward_titles: title with:, double and single quotes,#, newline, tab, backslash; tagsa:b,#hash,- dash; parsed with yaml-rust2 and compared exactly.front_matter_names_the_parent_slug_for_nested_documents: three levels, parents"",book,chapter-1.json_export_ignores_the_front_matter_flag.doc import), documented instead.book/ch1with an awkward title and a body containing---; plain bodies identical to the front-matter bodies.cargo fmt --check,cargo clippy -p uteke-cli --all-targets -D warnings,cargo test -p uteke-cliall pass.Refs #1470