Skip to main content

MkDocs plugin to get the latest git tag from the local repository

Project description

MkDocs Plugin : latest-git-tag

PyPI version

This is a simple MkDocs plugin that just gets the most recent Tag from the local Git repository and makes it available as a markdown tag in the template.

The idea behind this is that GitHub uses the Tag to name the release and, therefore we can use it to display the version of the documentation that corresponds to the release.

The Tag is just returned as a string with no formatting applied. If none is found, it returns "No Tags found"

There is a Demo Site

Installation

Install the package with pip:

pip install mkdocs-latest-git-tag-plugin

or, if you are using Poetry:

poetry add mkdocs-latest-git-tag-plugin --group dev

Usage

Activate the plugin in your mkdocs.yml:

plugins:
  - latest-git-tag

If you have no plugins entry in your config file yet, you'll likely also want to add the search plugin. MkDocs enables it by default if here is no plugins entry set.

Then, in your template, you can use the {{ latest_git_tag }} variable:

# My Project

Version: {{ latest_git_tag }}

The spaces around the tag are optional and it is case insensitive.

Configuration

At this time there are no configuration options.

License

This is released under the MIT License. See the bundled LICENSE file for more details.

TODO

  • Add tests

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mkdocs_latest_git_tag_plugin-0.1.2.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mkdocs_latest_git_tag_plugin-0.1.2-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file mkdocs_latest_git_tag_plugin-0.1.2.tar.gz.

File metadata

  • Download URL: mkdocs_latest_git_tag_plugin-0.1.2.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.0 CPython/3.10.7 Linux/5.19.0-45-generic

File hashes

Hashes for mkdocs_latest_git_tag_plugin-0.1.2.tar.gz
Algorithm Hash digest
SHA256 ab51de9aaaf412110ce1935d4c22686c23383d2078feb28708646c3801d89327
MD5 c82a2478024f85677b086e776d3269da
BLAKE2b-256 fed014db15da4f526392603729768e8f961e9e16d52db5e48892437c6e912262

See more details on using hashes here.

File details

Details for the file mkdocs_latest_git_tag_plugin-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for mkdocs_latest_git_tag_plugin-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4d27c6d95e19f8fc9133840492ed059ac1b026e0d0dce4c368b803b9367f5a07
MD5 4af444d80beb815994285063070a471b
BLAKE2b-256 a277960575f50d2ad6f996066000081038771bb7caf5a810fd8eb3f87c6a472a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page