A .NET library for working with Simple Structured Markdown, enabling structured document management with metadata and visibility control.
XArch.StructuredMarkdown
provides tools to parse and serialize documents that follow the Structured Markdown Format. This format enables:
- Block-level section tags for grouping content with arbitrary metadata.
- Inline metadata comments for fine-grained control over visibility and properties.
- Tag comments for data tagging within session logs or summaries.
- Parse documents using a stack-based approach, tracking current metadata context (visibility, tags, etc.).
- Supports both section tags and inline metadata comments.
- Generate structured markdown with proper formatting for sections, inline comments, and tag comments.
- Preserve unknown metadata keys during round-trip editing.
Install the package via NuGet:
dotnet add package XArch.StructuredMarkdown
using XArch.StructuredMarkdown;
var document = StructuredMarkdownParser.Parse("path/to/document.md");
using XArch.StructuredMarkdown;
string markdown = StructuredMarkdownSerializer.ToMarkdown(document);
File.WriteAllText("output.md", markdown);
For full details on the format, see the Markdown Content Partitioning and Tagging Spec.
Contributions are welcome! Please open an issue or submit a pull request.
Apache 2.0 License. See LICENSE
for more information.