jdillard / sphinx-gitstamp

Sphinx extension that makes the git timestamp available to templates in the HTML context.

Home Page:https://pypi.org/project/sphinx-gitstamp/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

PyPI version Downloads Code style: Black Parallel Safe

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']

To change the default time format of %b %d, %Y, set the value of gitstamp_fmt in conf.py to the desired time format. For example:

# Date format for git timestamps
gitstamp_fmt = "%Y-%m-%d %H:%M:%S %z"

Add gitstamp to the jinja template, for example:

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

Contributing

Pull Requests welcome! See CONTRIBUTING for instructions on how best to contribute.

License

sphinx-gitstamp is made available under a BSD license; see LICENSE for details.

Originally based on the gitstamp generator in the cyrus-imapd project. This product includes software developed by Computing Services at Carnegie Mellon University (http://www.cmu.edu/computing/).

About

Sphinx extension that makes the git timestamp available to templates in the HTML context.

https://pypi.org/project/sphinx-gitstamp/

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Python 100.0%