Skip to main content

A MkDocs plugin that injects the mkdocs.yml extra variables into the markdown template

Project description

# mkdocs-markdownextradata-plugin

*A MkDocs plugin that injects the mkdocs.yml extra variables into the markdown template*

**usecase**

```
As a user with variables that need to be inserted at the markdown level, not the template level.
I need a mkdocs plugin that will inject my `extras` variables into the markdown template before it gets rendered to html.
So that I can build my markdown pages with different values for images, urls, client_names, etc.
```

<br/>

## Installation

> **Note:** This package requires MkDocs version 0.17 or higher.

Install the package with pip:

```bash
pip install mkdocs-markdownextradata-plugin
```

Enable the plugin in your `mkdocs.yml`:

```yaml
plugins:
- search
- markdownextradata
```

> **Note:** If you have no `plugins` entry in your config file yet, you'll likely also want to add the `search` plugin. MkDocs enables it by default if there is no `plugins` entry set, but now you have to enable it explicitly.

More information about plugins in the [MkDocs documentation][mkdocs-plugins]

<br/>

## Features

### Use Extra Variables in your markdown files

The variables you define in the mkdown.yml `extra:` slot will become available in your templates

```yaml
extra:
customer:
name: Your name here
web: www.example.com
salt: salt.example.com
```

and then in your `*.md` files

```jinja
{{ customer.name }}
<a href="{{ customer.web }}">{{ customer.web }}</a>
```

<br/>

## Contributing

From reporting a bug to submitting a pull request: every contribution is appreciated and welcome.
Report bugs, ask questions and request features using [Github issues][github-issues].
If you want to contribute to the code of this project, please read the [Contribution Guidelines][contributing].

[travis-status]: https://travis-ci.org/rosscdh/mkdocs-markdownextradata-plugin.svg?branch=master
[travis-link]: https://travis-ci.org/rosscdh/mkdocs-markdownextradata-plugin
[mkdocs-plugins]: http://www.mkdocs.org/user-guide/plugins/
[github-issues]: https://github.com/rosscdh/mkdocs-markdownextradata-plugin/issues
[contributing]: CONTRIBUTING.md


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-markdownextradata-plugin-0.0.4.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file mkdocs-markdownextradata-plugin-0.0.4.tar.gz.

File metadata

File hashes

Hashes for mkdocs-markdownextradata-plugin-0.0.4.tar.gz
Algorithm Hash digest
SHA256 cfacec9b0618ea7dfe25bb5b49ddf3b7a9de021df10ed19ec66619b242d6cb01
MD5 6b987fef320ffdb1eadf8eb696652153
BLAKE2b-256 e90f69c13ab10304bf88b894db4969ed24ef28629dd8871ad484f88278144336

See more details on using hashes here.

Provenance

File details

Details for the file mkdocs_markdownextradata_plugin-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for mkdocs_markdownextradata_plugin-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 ecc2bf39c3d654b40d6cba7b22d01cdeb5dc3d577359708d41fa754bfb964226
MD5 17062dbe5ab00773d4848b8c94792b6f
BLAKE2b-256 df45a92413b9516ceeade505bed6641ed94b29e843627e6e5005d7badc88b4d5

See more details on using hashes here.

Provenance

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