A lightweight mkdocs plugin to add title casing to all mkdocs sections, pages, and links in the navigation and in HTML content. Uses python-titlecase for formatting.
Install the plugin using pip:
pip install git+https://github.com/uabrc/mkdocs-title-casing-plugin.git@stableInclude the plugin in mkdocs.yml. For example:
plugins:
- search
- title-casing:
- capitalization_type: title (default) | first_letter
- mode: warn (default) | fix
- ignore_definition_file: str path (default .title-casing-ignore)If this is the first
pluginsentry that you are adding, you should probably also addsearchas this is enabled by default.
When the plugin is enabled, all section and page titles will be converted to use Title Case, except for words in the optional ".title-casing-ignore" file. For example, War and peace becomes War and Peace.
capitalization_type(string)title- default - givesWar and Peace.first_letter- givesWar And Peace.
mode(string)warn- default - produces warningsfix- changes titles in HTML ouptut
ignore_definition_file:- String path to a file containing a list of words, one word per line.
- default:
.title-casing-ignore - Optional, if not supplied, no words will be ignored.
plugins:
- search
- title-casing:
capitalization_type: title
mode: warn
ignore_definition_file: .title-casing-ignore- Set up the environment in Miniforge with
conda env create --file environment.ymlto enable testing. - Activate the environment.
- Run
pip install -e ..
- Run tests with
unittest. - Also run
mkdocs buildto check against mock documentation included in the repo.