Name | mkdocs-frontmatter-url JSON |
Version |
0.1.2
JSON |
| download |
home_page | None |
Summary | A MKDocs plugin that generates a button for a URL defined in the frontmatter |
upload_time | 2024-10-23 15:02:35 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | None |
keywords |
frontmatter
mkdocs
plugin
url
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# MkDocs Frontmatter URL Plugin
This MkDocs plugin generates a button or tag from a URL specified in the frontmatter of a markdown document.
## Installation
Install the package with pip:
```bash
pip install mkdocs-frontmatter-url
```
## Usage
1. Activate the plugin in your `mkdocs.yml`:
```yaml
plugins:
- frontmatter-url
```
2. In your markdown files, add a `url` field to the frontmatter:
```yaml
---
title: My Page
gitlab: https://example.com
---
# Welcome to My Page
Content goes here...
```
3. The plugin will automatically generate a button with the specified URL after the frontmatter.
![alt text](./static/image.png)
4. To verify if the `on_page_markdown` function is triggering, run MkDocs with the verbose flag:
```bash
mkdocs build -v
```
or for serving:
```bash
mkdocs serve -v
```
This will display detailed logs, including messages from the plugin showing when the `on_page_markdown` function is triggered for each page.
## Configuration
You can customize the button text in your `mkdocs.yml`:
```yaml
plugins:
- frontmatter-url:
button-text: 'My external button'
frontmatter-url-name: 'github'
```
`button-text` is the text that is shown on the button.
The default is `Visit link`.
`frontmatter-url-name` is the name of the url-field in your frontmatter.
The default is `url`.
## Limitations
- The css is not configurable
- There are multiple fontawesome-icons usable as an icon, but the icon itself is not configurable
- There is only room for one URL
- The button will always try to place itself under the first heading. If there is no first heading it will place itself on the top
The interaction with other plugins has not been tested
## License
This project is licensed under the MIT License.
Raw data
{
"_id": null,
"home_page": null,
"name": "mkdocs-frontmatter-url",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "frontmatter, mkdocs, plugin, url",
"author": null,
"author_email": "Jens Penny <jens.penny+pypi@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/85/85/085376c14ade140429955cf0f1712d5199813d16ae26fa2107da75cdd85e/mkdocs_frontmatter_url-0.1.2.tar.gz",
"platform": null,
"description": "# MkDocs Frontmatter URL Plugin\n\nThis MkDocs plugin generates a button or tag from a URL specified in the frontmatter of a markdown document.\n\n## Installation\n\nInstall the package with pip:\n\n```bash\npip install mkdocs-frontmatter-url\n```\n\n## Usage\n\n1. Activate the plugin in your `mkdocs.yml`:\n\n```yaml\nplugins:\n - frontmatter-url\n```\n\n2. In your markdown files, add a `url` field to the frontmatter:\n\n```yaml\n---\ntitle: My Page\ngitlab: https://example.com\n---\n\n# Welcome to My Page\n\nContent goes here...\n```\n\n3. The plugin will automatically generate a button with the specified URL after the frontmatter.\n![alt text](./static/image.png)\n\n4. To verify if the `on_page_markdown` function is triggering, run MkDocs with the verbose flag:\n\n```bash\nmkdocs build -v\n```\n\nor for serving:\n\n```bash\nmkdocs serve -v\n```\n\nThis will display detailed logs, including messages from the plugin showing when the `on_page_markdown` function is triggered for each page.\n\n## Configuration\n\nYou can customize the button text in your `mkdocs.yml`:\n\n```yaml\nplugins:\n - frontmatter-url:\n button-text: 'My external button'\n frontmatter-url-name: 'github'\n```\n\n`button-text` is the text that is shown on the button.\nThe default is `Visit link`.\n\n`frontmatter-url-name` is the name of the url-field in your frontmatter.\nThe default is `url`.\n\n## Limitations\n\n- The css is not configurable\n- There are multiple fontawesome-icons usable as an icon, but the icon itself is not configurable\n- There is only room for one URL\n- The button will always try to place itself under the first heading. If there is no first heading it will place itself on the top\n\nThe interaction with other plugins has not been tested\n\n## License\n\nThis project is licensed under the MIT License.\n",
"bugtrack_url": null,
"license": null,
"summary": "A MKDocs plugin that generates a button for a URL defined in the frontmatter",
"version": "0.1.2",
"project_urls": {
"Repository": "https://github.com/JensPenny/mkdocs-frontmatter-url.git"
},
"split_keywords": [
"frontmatter",
" mkdocs",
" plugin",
" url"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "cfbcd1c99635c689e6a36026ab1b78396042986483976242bc5db6706709c4f7",
"md5": "14a1b1aa6fd53741f90fc9ea2deb08d7",
"sha256": "29b90e05cfd3541322caa2eca23a255f0c7e1770f7c158b2c2c649ad507f7d48"
},
"downloads": -1,
"filename": "mkdocs_frontmatter_url-0.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "14a1b1aa6fd53741f90fc9ea2deb08d7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 4570,
"upload_time": "2024-10-23T15:02:33",
"upload_time_iso_8601": "2024-10-23T15:02:33.521240Z",
"url": "https://files.pythonhosted.org/packages/cf/bc/d1c99635c689e6a36026ab1b78396042986483976242bc5db6706709c4f7/mkdocs_frontmatter_url-0.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8585085376c14ade140429955cf0f1712d5199813d16ae26fa2107da75cdd85e",
"md5": "ad7fa129fbcded4354c59ef012123db7",
"sha256": "06fa5fbaf9beab5b27089d211d52086ff8b07a0ed6b556ce61b8e33bc4e422f8"
},
"downloads": -1,
"filename": "mkdocs_frontmatter_url-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "ad7fa129fbcded4354c59ef012123db7",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 14103,
"upload_time": "2024-10-23T15:02:35",
"upload_time_iso_8601": "2024-10-23T15:02:35.067783Z",
"url": "https://files.pythonhosted.org/packages/85/85/085376c14ade140429955cf0f1712d5199813d16ae26fa2107da75cdd85e/mkdocs_frontmatter_url-0.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-23 15:02:35",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "JensPenny",
"github_project": "mkdocs-frontmatter-url",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "mkdocs-frontmatter-url"
}