Documentation¶
The execution-specs documentation is generated via mkdocs and hosted at steel.ethereum.foundation/docs/execution-specs/.
Prerequisites¶
uv sync
Build and Verify the Documentation¶
One time build in strict mode:
just docs
Run all docs related checks:
just spellcheck
just lint-md
just docs
Local Deployment and Test¶
Serve the site locally with live reload on changes to docs/**/*.md or tests/**/*.py:
just docs-serve # full build
just docs-serve-fast # skips the Test Case Reference, faster iteration
For more help (including ensuring a clean build), see the gen_test_doc pytest plugin's documentation:
A pytest plugin that generates test case documentation for use in mkdocs.
It generates the top-level "Test Case Reference" section in EEST's mkdocs site.
Note:¶
- No output directory is specified for the generated output; file IO
occurs via the
mkdocs-gen-filesplugin.mkdocs servewrites intermediate files to our localdocs/directory and then copies it to the site directory. We modifydocs/navigation.mdand write all other output underneathdocs/tests. If mkdocs is interrupted, these intermediate artifacts are left indocs/.
Usage:¶
Ensuring a clean build
In case mkdocs has polluted the docs/ directory with intermediate files, run:
git restore docs/navigation.md # Careful if you have local modifications!
rm -rf docs/tests docs/docs site
To test doc generation, run the plugin without mkdocs:
uv run fill -p pytest_plugins.filler.gen_test_doc.gen_test_doc --gen-docs --fork=<fork> tests
Or to build and view the site:
uv run mkdocs serve
Implementation¶
Plugins¶
The documentation flow uses mkdocs and the following additional plugins:
- mkdocs: The main doc generation tool.
- mkdocs-material: Provides many additional features and styling for mkdocs.
- mkdocstrings and mkdocstrings-python: To generate documentation from Python docstrings.
- mkdocs-gen-files: To generate markdown files automatically for each test case Python module. See this page for example usage. This plugin is used to programmatically generate the nav section for the generated test case reference documentation.
- mkdocs-literate-nav: Is used to define the navigation layout for non-generated content and was created to work well with
mkdocs-gen-filesto add nav content for generated content. - blueswen/mkdocs-glightbox - for improved image and inline content display.
The "Test Case Reference" Section¶
This section is auto-generated via a combination of:
It auto-generates a sequence of nested pages (with nav entries) of all python modules detected under ./tests. Each page contains a stub to the doc generated by mkdocstrings from the module's docstrings and source code. The mkdocs-gen-files and mkdocs-literate-nav plugins were created exactly for this purpose.
No action is necessary if a new test directory or module is added to ./tests, it will be picked up automatically.
Working with generated content
The files in the ./tests directory are watched by mkdocs serve. Run mkdocs serve and edit the source docstrings: The browser will reload with the new content automatically.
Navigation¶
All pages that are to be included in the documentation and the navigation bar must be included in navigation.md, except "Test Case Reference" entries. This is enabled by mkdocs-literate-nav. The nav entries for the automatically generated "Test Case Reference" section are generated in mkdocs-gen-files and appended to navigation.md.
Current nav ordering limitations
The "Test Case Reference" section must currently be the last section in the nav. This is because our mkdocs flow:
- Reads
navigation.md. - Generates the Test Case Reference documentation and appends the Test Case Reference entries to
navigation.md - Generates the nav.
If necessary, we could probably split navigation.md into two files
navigation-pre-test-case-reference.md,navigation-post-test-case-reference.md,
and create an arbitrary ordering in the Test Case Reference doc gen script. But this is untested.