Skip to content

Explain front matter extraction and HTML rendering - #154

Open
Gonghan-Princess wants to merge 1 commit into
executablebooks:masterfrom
Gonghan-Princess:codex/docs-front-matter-usage
Open

Explain front matter extraction and HTML rendering#154
Gonghan-Princess wants to merge 1 commit into
executablebooks:masterfrom
Gonghan-Princess:codex/docs-front-matter-usage

Conversation

@Gonghan-Princess

Copy link
Copy Markdown

Fixes #133.

Add a runnable front-matter recipe that registers the plugin, parses Markdown once, extracts the hidden front_matter token's text, and renders the same tokens into HTML using the same environment. Show optional YAML post-processing with PyYAML, distinguish missing and empty metadata, and explain placement of the opening delimiter.

The example includes assertions for the extracted metadata and actual rendered HTML. No runtime code or dependency declarations change. The changelog entry follows AGENTS.md.

Validation on Windows / Python 3.12.10:

  • Project tox py312 environment: all 511 existing tests passed, plus one external verification test that executes both Python blocks directly from docs/index.md and checks missing/empty/leading-whitespace cases (512 passed total).
  • Project tox pre-commit environment: all hooks passed.
  • Project tox mypy environment: strict type checking passed.
  • Project tox docs-update environment: Sphinx HTML build passed with -nW --keep-going (warnings treated as errors).

AI disclosure: OpenAI Codex prepared the documentation and verification. No human review is claimed. No third-party source code was copied.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add documentation on how to use the Front Matter Plugin

1 participant