v1.0.0
Changelog — (v0.1.4 → v1.0.0)
Important
This is a break in change.
1.0.0 — stable
Highlights since 0.1.4
Added
- Header/Footer placement: render Git info at the top and/or bottom of each chapter.
header = true|false(default:false)footer = true|false(default:true)
- Message templates table: placement-specific templates with a shared fallback.
[preprocessor.gitinfo.message]→header,footer,both- Placeholders:
{{hash}},{{long}},{{tag}},{{date}},{{sep}},{{branch}}
- Split alignment:
- Table/dotted:
[preprocessor.gitinfo.align] header|footer|both
- Table/dotted:
- CSS-style margins (TRBL) per placement with shorthand and named-side forms:
[preprocessor.gitinfo.margin]→header,footer,both- Accepts
"1em",["2em","1em","0","1em"], or{ top="2em", right="0", bottom="1em", left="0" } - Defaults when unset:
- Header:
["0","0","2em","0"](space below the header) - Footer:
["2em","0","0","0"](space above the footer)
- Header:
- Markdown-safe injection: blank lines are inserted so headings/paragraphs render correctly.
- Hyperlinking : when
hyperlink = true,{{hash}}and{{branch}}link to your provider (GitHub/GitLab/Bitbucket orremote.origin.url). - Branch verification: validates configured
branch; falls back to"main"with a warning.
Changed
- More expressive config schema (message/align/margin dotted/tables)
- Footer/header HTML blocks gain consistent classes + inline styles:
<header class="gitinfo-header" …>and<footer class="gitinfo-footer" …>
Deprecated (unsupported in 1.0.0)
template(single message) → prefermessage.footerormessage.both
Fixed
enableis now honoured,bookwill be returned with nomdbook-gitinfoinjection- More robust path handling when querying per-chapter commits.
Migration guide
Before (legacy)
[preprocessor.gitinfo]
template = "Date: {{date}} • Commit: {{hash}}"After (preferred)
[preprocessor.gitinfo]
header = true
footer = true
hyperlink = true
font-size = "0.9em"
separator = " • "
date-format = "%Y-%m-%d"
time-format = "%H:%M"
branch = "main"
[preprocessor.gitinfo.message]
both = "<em>{{date}}</em>{{sep}}branch: {{branch}}"
header = "<strong>{{tag}}</strong>{{sep}}<em>{{date}}</em>"
footer = "Built {{date}}{{sep}}commit: {{hash}}"
[preprocessor.gitinfo.align]
header = "left"
footer = "right"
[preprocessor.gitinfo.margin]
header = ["0","0","1.25em","0"] # T R B L
footer = ["2em","0","0","0"]0.1.4
- Last 0.1.x baseline before the configuration model expansion.
- Per-chapter commit extraction, basic templating, date/time formatting, and footer injection.
Notes
- Renderer support: html only.
- To consume the latest release in other repos (CI), you can use:
curl -fsSL https://github.com/CompEng0001/mdbook-gitinfo/releases/latest/download/mdbook-gitinfo-linux.tar.gz | tar -xz mv mdbook-gitinfo-linux ~/.cargo/bin/mdbook-gitinfo mdbook-gitinfo --version