Skip to main content

This plugin automatically turns specific words into links to specific pages.

Project description

mkdocs-glossary-plugin

This plugin provides a simple glossary feature for mkdocs.

demo

What's useful?

When you are writing documents for your project, you maybe use some project-specific words.
Of course, reader cannot understand these words without any explanation, but we want to avoid linking to all the places where these words are used.

In these cases, this plugin can ...

  • replace these words with a link to a specified page automatically
  • control the details, such as not converting words contained in h1 or emph, but converting words contained in plain text.
  • alias support. you can set alias for each word.

Requirements

How to install

python3 setup.py install

Getting started

Plugin configuration

Edit your mkdocs.yml file as follows.

plugins:
  - mkdocs-glossary-plugin:
      glossary_dirs: ["foo", "bar"] # This plugin considers the md files in "docs/foo" and "docs/bar" as glossary files.

You can set some options, see Options section.

Register glossary

For example, let's say you want to create a glossary of the word x_word .
At first, You have to create x_word.md file like below as a glossary page for x_word .

~/mkdocs_project/docs$ tree
.
├── foo
│   └── x_word.md
└── index.md

All that remains is for you to write freely in x_word.md!
If you want to add an alias to x_word, set the glossary metadata at the beginning of the x_word.md file as follows.

---
glossary: alias_word_a
glossary: alias_word_b
---

This is the glossary page for x_word!

That's all! Now, all the x_word, alias_word_a and alias_word_b in your project will be replaced with a link to x_word.md when building.

Options

Name Necessary Type Default Detail
glossary_dirs required List[str] None Specify the dirs containing the glossary md files. This plugin will only search for glossaries here.
Please fill out with relative path from docs dir.
input_format optional str markdown_phpextra The input format of the markdown file. See pandoc
output_format optional str markdown_phpextra The output format of the markdown file. See pandoc
enable_toc optional bool True If True, you can use table of contents([TOC]) feature.
replace_emphasized_text optional bool True If True, emphaseized text includes specified word.
replace_header optional bool False If True, h1,h2,.. includes specified word.
replace_table_header optional bool True If True, table header includes specified word.
replace_table_body optional bool True If True, table body includes specified word.

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-glossary_plugin-0.1.1.tar.gz (16.4 kB view hashes)

Uploaded Source

Built Distribution

mkdocs_glossary_plugin-0.1.1-py3-none-any.whl (51.1 kB view hashes)

Uploaded Python 3

Supported by

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