Skip to content

Releases: CompEng0001/mdbook-gitinfo

v2.0.0

14 Jan 15:51

Choose a tag to compare

See Full Changelog: v0.1.4...v2.0.0

Highlights

  • mdBook 0.5.x support: updated to the mdbook-preprocessor 0.5 API (mdBook 0.5 split the preprocessor interface out of the mdbook crate).

  • Plug-and-play contributors styling: contributors no longer inject raw <style> into chapter HTML. Styling is provided via an automatically managed theme CSS asset.

  • Safer contributors token rendering: {% contributors %} is now treated as a block token to avoid accidental expansion inside documentation examples.

Breaking changes

  • Requires mdBook-0.5.x (mdBook-0.4 users should remain on mdbook-gitinfo-v1.2.x).

  • Contributors token behaviour is stricter:

    • {% contributors %} is only expanded when it appears on its own line.

    • Tokens inside fenced code blocks, indented code blocks, inline code, tables, or general prose are not expanded.

Contributors styling and theme injection

  • When contributors = true:

    • The preprocessor creates theme/gitinfo.css at the book root (if missing).

    • The preprocessor adds theme/gitinfo.css to book.toml under:

      • output.html.additional-css

v1.2.0

12 Jan 11:06

Choose a tag to compare

[1.2.0] – Contributors support

Added

  • Contributors rendering via {% contributors %} token
  • Multiple contributor sources:
    • git (default, derived from git history)
    • file (from CONTRIBUTORS.md at repo root)
    • inline (explicit usernames in token)
  • Lazy-loaded GitHub avatars
  • Collapsible contributor lists for large cohorts
  • Customisable contributor title and message
  • Exclusion of bot or unwanted accounts
  • Safe token handling (ignored inside code fences)

Notes

  • Contributors are opt-in (contributors = true)
  • Default behaviour is backwards compatible

v1.1.1

29 Oct 07:34

Choose a tag to compare

  • 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

15 Oct 08:43

Choose a tag to compare

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

08 Oct 10:36

Choose a tag to compare

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

v0.1.4

29 Sep 19:24

Choose a tag to compare

bump v 0.1.3 to 0.1.4

v0.1.3

29 Sep 11:18

Choose a tag to compare

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

05 Aug 10:07

Choose a tag to compare

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

26 Jun 13:45

Choose a tag to compare

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.