Skip to content

Sphinx Gitstamp Generator Extension #60

Open
@coding-to-music

Description

@coding-to-music

Sphinx Gitstamp Generator Extension
A Sphinx extension that inserts a git datestamp into the context as gitstamp, to make it available for template use in HTML versions of your Sphinx documentation.

Installing
Directly install via pip by using:

pip install sphinx-gitstamp
Add sphinx_gitstamp to the extensions array in your Sphinx conf.py. For example:

extensions = ['sphinx_gitstamp']
Set the value of gitstamp_fmt in conf.py to the desired time format. For example:

Date format for git timestamps

gitstamp_fmt = "%b %d, %Y"
Add gitstamp to the template, for example:

{%- if gitstamp %} This page was last updated on {{ gitstamp }}. {%- endif %}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions