Skip to content

v1.0.0

Choose a tag to compare

@github-actions github-actions released this 08 Oct 10:36
· 19 commits to main since this release

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
  • 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)
  • 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 or remote.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) → prefer message.footer or message.both

Fixed

  • enable is now honoured, book will be returned with no mdbook-gitinfo injection
  • 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