Skip to content

Explain front matter extraction and HTML rendering - #154

Merged
chrisjsewell merged 3 commits into
executablebooks:masterfrom
Gonghan-Princess:codex/docs-front-matter-usage
Nov 9, 2026
Merged

chrisjsewell merged 3 commits into
executablebooks:masterfrom
Gonghan-Princess:codex/docs-front-matter-usage

Conversation

@Gonghan-Princess

Copy link
Copy Markdown
Contributor

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.

@chrisjsewell
chrisjsewell merged commit 4fc4d4b into executablebooks:master Nov 9, 2026
11 checks passed
chrisjsewell added a commit that referenced this pull request Nov 10, 2026
Brings in #148, #138, #153, #157, #149, #152, #154, #158, #159, #161, #162.

Conflicts:
- attrs/index.py: #153 merges inline classes from the opening token
  (attr_token), #150 passes state.md to _add_attrs; both kept.
- tests/test_attrs.py, tests/test_texmath.py: both sides' tests kept.

Adds test_class_accumulation_is_filtered: classes merged across inline
groups (onto the opening token) and across stacked block attributes still
pass through the on*, URL and allowed filters.
@chrisjsewell

Copy link
Copy Markdown
Member

Merged in 4fc4d4b, thanks @Gonghan-Princess! Before merging I pushed one commit that removed the CHANGELOG entry: for this release all the entries are written in the release PR, so contributor PRs don't conflict with one another. Nothing else changed.

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

2 participants