Repository navigation
Markdown Front Matter - #10
Merged
Merged
Conversation
Introduced a new YAML parser in Yaml.cs supporting string keys, scalars, sequences, nested mappings, and block scalars, with robust error handling for malformed input. Added YamlTests.cs with extensive NUnit tests covering empty cases, key-value pairs, null/boolean/numeric values, quoted strings, comments, nested structures, sequences, block scalars, structural errors, and edge cases.
Implemented a simple YAML parser in Yaml.cs supporting string keys, scalars, sequences, nested mappings, and block scalars for basic metadata scenarios. Added YamlTests.cs with extensive NUnit tests covering parsing, edge cases, and error handling. Both files include MIT license headers. Advanced YAML features are not supported.
Added methods to enumerate ATX headings, extract the first heading, and parse YAML front matter blocks in the Markdown class. Replaced MarkdownHelperTests with a new MarkdownTests suite covering encoding/decoding, heading detection, and front matter extraction, including edge cases and error handling.
Add parsing and exposure of YAML front matter metadata in MarkdownFileTopic. Title extraction now prioritizes the "title" field in front matter before falling back to Markdown headings or default logic. Content readers now exclude front matter. Includes new tests for front matter title handling.
Correct project title in .csproj from "Kampute.DocDotLib" to "Kampute.DocToolkit" to reflect the actual project name. Increment version from 2.2.1 to 2.3.0 for the new release.
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.
This pull request introduces support for parsing and handling YAML front matter in Markdown files, enhances Markdown heading extraction utilities, and updates the
MarkdownFileTopicclass to leverage these features for improved topic metadata handling.Markdown front matter and heading extraction:
Markdown(src/Support/Markdown.cs) for enumerating ATX-style headings, extracting the first heading, and parsing YAML front matter blocks from Markdown content.MarkdownFileTopic(src/Topics/MarkdownFileTopic.cs) to lazily parse Markdown files, extracting front matter and content separately, and expose front matter metadata via a new property. Topic title generation now prefers the "title" from front matter, falling back to the first Markdown heading, then the base logic. [1] [2] [3] [4]Project and test updates:
Kampute.DocToolkitand bumped the version to 2.3.0 inKampute.DocToolkit.csproj.MarkdownHelperTeststest class, which is now outdated due to the refactorings and new Markdown logic.