Skip to main content

This plugin allows to configure your own autolink references for URLs.

Project description

mkdocs-argref-plugin

PyPI - Version

This mkdocs plugin allows users to convert text such as GHI-123 in their documentation to a corresponding URL, e.g. https://github.com/myproject/issues/123. Unlike similar plugins, argref takes an argument for each reference that can be utilized in the URL.

Getting started

To install it, using pip:

pip install mkdocs-argref-plugin

Edit your mkdocs.yml file and add these few lines of code:

plugins:
   - argref:
        filter_links: False  #default
        autolinks:
            - reference_prefix: GH-<num>
              target_url: https://github.com/myname/myproject/issues/<num>
            - reference_prefix: JIRA-<num>-<ver>
              target_url: https://jiracloud.com/myproject-<num>?ver=<ver>
  • filter_links: When True, will not make replacements within existing markdown links. Caution: This may impact performance in large environments. Defaults to False.
  • reference_prefix: This prefix appended by a number will generate a link any time it is found in a page. When no variable is present, will append <num> as the variable.
  • target_url: The URL must contain all variables from reference_prefix.

An example

For example, you could edit the docs/index.md file and insert the ticket references like this:

Changelog:

- GHI-100: Add new feature.
- JIRA-231-XYZ: Fix bug.

This will be converted to:

Changelog:

- [GHI-100](https://github.com/myname/myproject/issues/100): Add new feature.
- [JIRA-231-XYZ](https://jiracloud.com/myproject-231?ver=XYZ): Fix bug.

Changelog

0.4.0 (2024-08-13)

  • Added ability to use multiple references for each link.

0.3.0 (2024-06-07)

  • Fixed bug where only one replacement would be made per page.

0.2.2 (2023-12-28)

  • Allow extended set for and ignore ref style links, already linked items, and attr_list cases with '#' before the ref

0.2.0

  • Ignore already linked references.
  • Converts text [AF-100] to a linked version and removes the brackets AF-100

License

MIT

Originally built with ❤️ by Saurabh Kumar

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_argref_plugin-0.4.0.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

mkdocs_argref_plugin-0.4.0-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file mkdocs_argref_plugin-0.4.0.tar.gz.

File metadata

  • Download URL: mkdocs_argref_plugin-0.4.0.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for mkdocs_argref_plugin-0.4.0.tar.gz
Algorithm Hash digest
SHA256 f7a491e38fb019584b058411892b2aa39f69c8425bd82f10caddf6e29c58a178
MD5 1768de22636e43bce85a2b83b30f7cde
BLAKE2b-256 4e0982da2d928e941000bb1d3271e11d68e8cb6699dd8fe5c86f374b8e212fad

See more details on using hashes here.

File details

Details for the file mkdocs_argref_plugin-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mkdocs_argref_plugin-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3a4f8c4f9fffb51c91baf0ac9230cf15db7752f64e16f2f5fe554e147599b5e0
MD5 9c48e290c4d550c3ea9c127a281ed55d
BLAKE2b-256 16fd0a2354db1d96d523692b3169993fb7691f74bb97027789b157c015b3c5ad

See more details on using hashes here.

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