Add hook to automatically create index tables#272
Open
eshaben wants to merge 9 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR replaces the legacy index-page generation script with a MkDocs hook that generates index tables during builds, and wires that hook into the site configuration.
Changes:
- Added
hooks/auto_index_table.pyto replace<!-- INDEX TABLE START --> ... <!-- INDEX TABLE END -->blocks with generated tables derived from.nav.ymland page frontmatter. - Enabled the new hook in
mkdocs.yml. - Removed legacy tooling (
scripts/generate_index_pages.py) and updated build tooling (Makefile target/help).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
hooks/auto_index_table.py |
Introduces the new hook that parses marker blocks and generates index tables from nav/frontmatter data. |
mkdocs.yml |
Enables the new hook in the MkDocs build pipeline. |
scripts/generate_index_pages.py |
Removes the superseded legacy index generation script. |
Makefile |
Removes the gen-cookbook target/help entry as part of tooling cleanup. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
0xlukem
reviewed
Jun 1, 2026
Contributor
0xlukem
left a comment
There was a problem hiding this comment.
The hook works great, just need to resolve some minor merge conflicts
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 a new MkDocs hook that automatically generates index tables for documentation sections and removes the old
scripts/generate_index_pages.pyscript. The new hook is enabled in the MkDocs configuration, providing a more robust, configurable, and maintainable solution for generating index tables based on the navigation structure and page frontmatter.Replacement of index page generation with a new MkDocs hook:
New feature: Automatic index table generation
hooks/auto_index_table.py, a MkDocs hook that replaces special marker blocks in Markdown files with generated tables of page links, descriptions, tools, and difficulty, based on.nav.ymlfiles and page frontmatter. It supports configuration via YAML in the marker, custom columns, extra rows, and per-row overrides.hookslist inmkdocs.yml.Codebase cleanup:
scripts/generate_index_pages.pyscript, which previously handled index page generation but is now superseded by the new hook.Goes with: polkadot-developers/polkadot-docs#1689
P.S. @0xlukem - now we could even use these shorter descriptions for social cards? Something we discussed doing a while back. Not sure if we have the ability to use a fallback description if
short_descriptiondoesn't exist? Anyways.... food for thought...