This repository automates the process of building the official CZ-NIC Bird documentation, converting the SGML sources to Markdown, and splitting the output into smaller, heading-based fragments under docs/.
- Clone the upstream Bird repository (either locally or inside GitHub Actions).
- Regenerate the documentation SGML with the standard autotools build (
autoreconf,./configure,make obj/doc/bird.sgml obj/doc/prog.sgml). - Convert the SGML to Markdown with
pandocand the upstreamlinuxdoc.luaparser. - Split the Markdown into section files and record checksums in
docs/manifest.json.
The entry point for the conversion is scripts/convert_bird_docs.py.
python3 scripts/convert_bird_docs.py [--branch <bird-branch>] [--source /path/to/bird]- When
--sourceis omitted, the script clones the Bird repository into a temporary directory using the optional--branchargument (defaults tomaster). - When
--sourceis provided, the script reuses that checkout. In this mode you must runmake obj/doc/bird.sgml obj/doc/prog.sgmlyourself before invoking the converter.
The generated Markdown fragments are written to docs/ and can be committed or published wherever you need them.
The workflow defined in .github/workflows/bird-docs.yml rebuilds the documentation on a schedule and on manual dispatch. It performs the following steps:
- Restore cached APT packages to speed up dependency installation.
- Install all build dependencies (
pandoc, autotools, and supporting packages). - Clone the Bird repository and determine the branch to mirror (matches the triggering branch by default, but can be overridden when manually dispatching the workflow).
- Run the SGML build, convert the output to Markdown, and split the resulting files.
- Auto-commit the updated
docs/snapshot back to the repository.
For local execution you need:
- Python 3.8 or later
pandoc- Autotools toolchain (
autoconf,automake,libtool,make,pkg-config) flexandbison
On macOS you can install these via Homebrew; on Debian/Ubuntu the provided workflow shows the required packages.
Issues and pull requests are welcome. Please keep the generated docs/ directory clean (only content produced by the converter) and run python3 scripts/convert_bird_docs.py before submitting changes that affect documentation output.