How vectorinstitute/mdbook-github-authors works
Project type and purpose
• This is an open-source mdBook preprocessor plugin written in Rust.
• Its goal is to scan chapter Markdown, detect {{#author…}} or {{#authors…}} helpers, fetch GitHub profile data for each username, render a “Contributors” section via a Handlebars template, and inject it into the chapter at build time.
File structure
• Top-level:
• .github/ workflows for lint, test, release, docs-test (CI/CD)
• Cargo.toml / Cargo.lock, Makefile, .gitignore, README.md, CHANGELOG.md, LICENSE
• Source:
• src/bin/main.rs – CLI entrypoint registering the preprocessor with mdBook
• src/lib.rs – core library exposing the preprocessor trait impl
• src/github_authors.rs – logic to parse authors, call GitHub API, construct data models
• src/template/authors.hbs – Handlebars template for rendering the contributors section
• Test artifacts:
• test_book/ – sample mdBook used by test_docs.yml workflow to validate real-world rendering
• tests/test_preprocessor.rs – unit/integration tests against lib
README for additional insights
• Confirms it’s a cargo-installed binary that plugs into book.toml under [preprocessor.github-authors].
• Describes the user-facing templating helpers and notes the plugin always appends a styled “Contributors” block to each chapter.