Skip to content

Optional Markdown Header IDs#21

Merged
ryanmphill merged 2 commits intomainfrom
markdown-header-ids
Dec 13, 2025
Merged

Optional Markdown Header IDs#21
ryanmphill merged 2 commits intomainfrom
markdown-header-ids

Conversation

@ryanmphill
Copy link
Copy Markdown
Owner

This pull request introduces support for an optional setting to enable or disable automatic generation of header IDs in markdown files. This allows users to control whether header elements in generated HTML will have unique IDs, which can be useful for linking and styling. The changes include updates to the settings schema, data loading logic, and project templates.

Markdown header ID support:

  • Added an optional markdown_header_ids boolean field to the SettingsDict type and incorporated its value into the markdown-to-HTML conversion process in DataLoader. If enabled, the "header-ids" extra is passed to the markdown renderer.
  • Updated the project template and test settings files (build_settings.json) to include the new markdown_header_ids field and documentation.

Other changes:

  • Changed the project version from 0.0.dev4 to 0.0.1a1 in pyproject.toml to reflect the new feature addition.
  • Improved type hinting by importing Optional from typing in shodo_ssg/data_loader.py.

Add optional 'markdown_header_ids' setting to build_settings.json that
enables automatic generation of IDs for markdown headers. When enabled,
the markdown2 'header-ids' extra is applied during HTML conversion.

- Add markdown_header_ids field to SettingsDict TypedDict
- Update MarkdownLoader to read and apply header-ids setting
- Set default to true in project templates
- Update both main and test build_settings.json files
Prepare for alpha release by updating version from 0.0.dev4 to 0.0.1a1
@ryanmphill ryanmphill merged commit 4e1641a into main Dec 13, 2025
6 checks passed
@ryanmphill ryanmphill deleted the markdown-header-ids branch December 13, 2025 17:59
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.

1 participant