mkdocs-glossary


Namemkdocs-glossary JSON
Version 0.1.2 PyPI version JSON
download
home_pagehttps://gitlab.com/cfpt-mkdocs-plugins/mkdocs-glossary
SummaryA MkDocs plugin that automatically creates references to glossary terms within italicized text from a specified glossary list file.
upload_time2024-04-18 07:53:21
maintainerNone
docs_urlNone
authorThibaud Briard
requires_python>=3.8
licenseMIT
keywords mkdocs
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # mkdocs-glossary

A MkDocs plugin that automatically creates references to glossary terms within italicized text from a specified glossary list file.

## Setup

### Installing using pip:

`pip install mkdocs-glossary`

## Config

You need to activate the plugin in `mkdocs.yml`:

``` yaml
plugins:
  - glossary:
      file: "file_name" # Optional --> Default : glossary.md
      exclude: # Optional --> Default : None
        - 'excluded term A'
        - 'excluded term B'
        - '...'
      unknown_warning: true # Optional --> Default : false
```

- `file` - The filename, from docs root folder, of the `Markdown` file containing the glossary list.
- `exclude` - This is a list of all the terms, case insensitive, that you want the plugin to ignore.
- `unknown_warning` - This option allow the plugin to create warning on founded term that are not in glossary list or exclude list.

## Usage

### How it work

The plugin will look for `Markdown` *italic* text. It will ignore italic placed in headers, links text, images alt text, code and code blocks. It will then check if the text is part of the glossary list from the glossary file and create a reference next to the text.

To create that reference to the definition it will use a superscript number inside a `Markdown` link element. To correctly render superscript this plugin require a way to render them. I recommend using `pymdownx.caret` markdown extension via `mkdocs-material`.

You can set the `pymdownx.caret` markdown extension like this in your `mkdocs.yml`.

``` yaml
markdown_extensions:
  - pymdownx.caret
```

Using the command `mkdocs build` or `mkdocs serve` will trigger the plugin.

### Glossary list

For the glossary list inside the glossary file you have to respect this format

First, create a `Markdown` ordered list like in the usual way.

``` markdown
1. Something
2. Something else
```

Secondly place each terms between `Markdown` bold characters. you can separate variantes that have the same description by using comma.

``` markdown
1. **Term A**
2. **Term B, Variant B1**
```

Finnaly you can add your description the same way you would write any text just after a space, a colon and another space

``` markdown
1. **Term A** : Term A Description
2. **Term B, Variant B1** : *Term B* **Important Descripiton** See : [link](.)
```

### About `Extended Markdown Definition List`

I'm aware of the `Extended Markdown Definition List` element but it's supposed to generate a definition at the end of a page/document and since i don't want to interfere with any plugins that would use it the proper way i had to come up with another way to write and read the glossary list.

### Notes

Note that most `Markdown` interpreter will automaticaly manage numbers or ordered list so it have no importance if you use accurate number on the glossary list. The plugin just do a simple increment at each new entry.

Be aware that multiple ordered list that follow the glossary list rules would work but would create confusion with user since the numbers shown on the glossary lists would not correspond to the ones used by the plugin to reference terms in the documentation.

By the way any italic words contained in the glossary file will be ignored by the plugin.

## License

This project is under MIT license. See the `license` file for more details.

## See Also

- [GitLab Repo](http://www.gitlab.org/cfpt-mkdocs-plugins/mkdocs-glossary/)
- [MkDocs Website](http://www.mkdocs.org/)
- [MkDocs-Material Documentation](https://squidfunk.github.io/mkdocs-material/)


            

Raw data

            {
    "_id": null,
    "home_page": "https://gitlab.com/cfpt-mkdocs-plugins/mkdocs-glossary",
    "name": "mkdocs-glossary",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "mkdocs",
    "author": "Thibaud Briard",
    "author_email": "thibaud.brrd@eduge.ch",
    "download_url": "https://files.pythonhosted.org/packages/78/06/ceec06a2d7e661a00d90018513667047766020d883ce28fcc28019ce183b/mkdocs-glossary-0.1.2.tar.gz",
    "platform": null,
    "description": "# mkdocs-glossary\n\nA MkDocs plugin that automatically creates references to glossary terms within italicized text from a specified glossary list file.\n\n## Setup\n\n### Installing using pip:\n\n`pip install mkdocs-glossary`\n\n## Config\n\nYou need to activate the plugin in `mkdocs.yml`:\n\n``` yaml\nplugins:\n  - glossary:\n      file: \"file_name\" # Optional --> Default : glossary.md\n      exclude: # Optional --> Default : None\n        - 'excluded term A'\n        - 'excluded term B'\n        - '...'\n      unknown_warning: true # Optional --> Default : false\n```\n\n- `file` - The filename, from docs root folder, of the `Markdown` file containing the glossary list.\n- `exclude` - This is a list of all the terms, case insensitive, that you want the plugin to ignore.\n- `unknown_warning` - This option allow the plugin to create warning on founded term that are not in glossary list or exclude list.\n\n## Usage\n\n### How it work\n\nThe plugin will look for `Markdown` *italic* text. It will ignore italic placed in headers, links text, images alt text, code and code blocks. It will then check if the text is part of the glossary list from the glossary file and create a reference next to the text.\n\nTo create that reference to the definition it will use a superscript number inside a `Markdown` link element. To correctly render superscript this plugin require a way to render them. I recommend using `pymdownx.caret` markdown extension via `mkdocs-material`.\n\nYou can set the `pymdownx.caret` markdown extension like this in your `mkdocs.yml`.\n\n``` yaml\nmarkdown_extensions:\n  - pymdownx.caret\n```\n\nUsing the command `mkdocs build` or `mkdocs serve` will trigger the plugin.\n\n### Glossary list\n\nFor the glossary list inside the glossary file you have to respect this format\n\nFirst, create a `Markdown` ordered list like in the usual way.\n\n``` markdown\n1. Something\n2. Something else\n```\n\nSecondly place each terms between `Markdown` bold characters. you can separate variantes that have the same description by using comma.\n\n``` markdown\n1. **Term A**\n2. **Term B, Variant B1**\n```\n\nFinnaly you can add your description the same way you would write any text just after a space, a colon and another space\n\n``` markdown\n1. **Term A** : Term A Description\n2. **Term B, Variant B1** : *Term B* **Important Descripiton** See : [link](.)\n```\n\n### About `Extended Markdown Definition List`\n\nI'm aware of the `Extended Markdown Definition List` element but it's supposed to generate a definition at the end of a page/document and since i don't want to interfere with any plugins that would use it the proper way i had to come up with another way to write and read the glossary list.\n\n### Notes\n\nNote that most `Markdown` interpreter will automaticaly manage numbers or ordered list so it have no importance if you use accurate number on the glossary list. The plugin just do a simple increment at each new entry.\n\nBe aware that multiple ordered list that follow the glossary list rules would work but would create confusion with user since the numbers shown on the glossary lists would not correspond to the ones used by the plugin to reference terms in the documentation.\n\nBy the way any italic words contained in the glossary file will be ignored by the plugin.\n\n## License\n\nThis project is under MIT license. See the `license` file for more details.\n\n## See Also\n\n- [GitLab Repo](http://www.gitlab.org/cfpt-mkdocs-plugins/mkdocs-glossary/)\n- [MkDocs Website](http://www.mkdocs.org/)\n- [MkDocs-Material Documentation](https://squidfunk.github.io/mkdocs-material/)\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A MkDocs plugin that automatically creates references to glossary terms within italicized text from a specified glossary list file.",
    "version": "0.1.2",
    "project_urls": {
        "Homepage": "https://gitlab.com/cfpt-mkdocs-plugins/mkdocs-glossary"
    },
    "split_keywords": [
        "mkdocs"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b336777bae872f10e9676bc04f81ce44ba721a4c41be2b77a966931bd3c7c844",
                "md5": "60854abf9110f1e4751d15ac91942505",
                "sha256": "9844feb23daf10f6b9185012f0ad664ad4164a1d669827889a30ffcabdce6102"
            },
            "downloads": -1,
            "filename": "mkdocs_glossary-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "60854abf9110f1e4751d15ac91942505",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 5773,
            "upload_time": "2024-04-18T07:53:20",
            "upload_time_iso_8601": "2024-04-18T07:53:20.117716Z",
            "url": "https://files.pythonhosted.org/packages/b3/36/777bae872f10e9676bc04f81ce44ba721a4c41be2b77a966931bd3c7c844/mkdocs_glossary-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7806ceec06a2d7e661a00d90018513667047766020d883ce28fcc28019ce183b",
                "md5": "947659712a834a5436f1395f4872e1ae",
                "sha256": "98850ba6b3428403c7ef21f4522f78846eac6f51a67fb587ca55518a9f4fb849"
            },
            "downloads": -1,
            "filename": "mkdocs-glossary-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "947659712a834a5436f1395f4872e1ae",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 6612,
            "upload_time": "2024-04-18T07:53:21",
            "upload_time_iso_8601": "2024-04-18T07:53:21.171463Z",
            "url": "https://files.pythonhosted.org/packages/78/06/ceec06a2d7e661a00d90018513667047766020d883ce28fcc28019ce183b/mkdocs-glossary-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-18 07:53:21",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "codeberg": false,
    "gitlab_user": "cfpt-mkdocs-plugins",
    "gitlab_project": "mkdocs-glossary",
    "lcname": "mkdocs-glossary"
}
        
Elapsed time: 0.33919s