Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Last updated: Wednesday 14 January 2026 @ 15:43:48

Welcome to mdbook-gitinfo

Crates.io version Downloads Docs.rs CI status

An mdBook preprocessor that injects Git metadata (commit hash, full hash, tag, date/time, branch) into each chapter; as a header, a footer, or both, with flexible templates, alignment, and CSS-style margins.

Compatibility

mdbook-gitinfo versionmdbook versionsNotes
v2.*.*v0.5.*Requires API changes introduced in mdbook 0.5.*
v1.*.*v0.4.*Not compatible with 0.5.*+

For all options see Documentation chapter.

Live Configuration Example

As seen from this page the current preprocessor configuration is:

[preprocessor.gitinfo]
enable = true
header = true
footer = true
message.header = "Last updated: <em>{{date}}</em>"
message.footer = "branch: {{branch}} {{sep}} commit: {{hash}} {{sep}} tag: {{tag}}"
align.header = "center"
align.footer = "center"
margin.header.top = "2em"
margin.header.bottom = "2em"
margin.footer = ["2em", "0", "0", "0"]
font-size = "0.8em"
separator = "||"
date-format = "%A %d %B %Y"
time-format = "@ %H:%M:%S"
branch = "main"
hyperlink = true
contributors = true

Contributors