Releases: CompEng0001/mdbook-gitinfo
Releases · CompEng0001/mdbook-gitinfo
v1.1.1
-
fix: tag is now honoured
- if no git tag then hyperlink not shown, placeholder is '-'
- if
{{tag}}supplied default will be latest / top of tree - if tag defined by user then takes the user defined tag and builds url
- No URL validation, just builds from REPO base URL.
-
mdbook example live https://compeng0001.github.io/mdbook-gitinfo/
v1.1.0
Changelog — (v1.0.0 → v1.1.0)
Released: 2025-10-15
New
Added timezone configuration key to control how commit timestamps are rendered.
Supported values:
-
"
local" (default) -
"
utc" -
"
source" (use commit’s recorded offset) -
"
fixed:+HH:MM" / "fixed:-HH:MM" (force offset)
Offset is always applied internally, but only shown if you include %z, %:z, or %Z in time-format.
Unknown values (e.g. "BST") produce a warning and fall back to "local".
Uses git log -1 --format=%cI for strict RFC-3339 parsing.
Compatibility
Fully backwards compatible with 1.0.0.
Existing configurations and outputs are unchanged unless timezone is explicitly set.
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
v0.1.4
bump v 0.1.3 to 0.1.4
v0.1.3
mod: update dependencies, doc-rs and workflow - chrono to 0.4.42 - clap to 4.5.48 - mdbook to 0.4.42 - serde to 1.0.228 - serde_json to 1.0.145 - enable doc-rs - workflow with write permission1 - bump to version 0.1.3
v0.1.2
feat: preprocessor now has branch - default main branch is selected - can specifiy branch in the preprocessor - branch can appear in the footer template too - added workflow example in README.md
v0.1.1
mod: bump to v0.1.1 - Subchapters now display gitinfo - each page/chapter/subchapter shows when it was updated rather than latest commit that didn't belong to that page.