Skip to main content

mkdocs-snippet-plugin

An mkdocs plugin that injects snippets from a file in a git repository.

Installation

Note: This package requires MkDocs version 0.17 or higher.

Install the package with pip:

pip install mkdocs-snippet-plugin

Enable the plugin in your mkdocs.yml:

plugins:
    - snippet:
          base_path: docs

The base_path entry should point to the root of your documentation site, usually defaulted to docs.

How to use it

If you have a markdown file in a remote Git repostory, and you want to extract a sections from it, add the following to your documentation markdown in mkdocs:

{{ snippet('git@github.com:mprivat/mkdocs-snippet-plugin.git', 'README.md', '## Installation') }}

It will download the file you specify from the Git URL, extract the section you ask for (including its subsections) and inject that into your mkdocs file at render time.

If the remote file has references to images, those will also be downloaded and placed in a _gen folder in the mkdocs hierarchy. You will probably want to include **/gen_ in your .gitignore file so you don't put those into your git repository unless you want them there.

Release files for mkdocs-snippet-plugin 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mkdocs-snippet-plugin 1.0.2
File Size Uploaded
mkdocs-snippet-plugin-1.0.2.tar.gz 3.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mkdocs-snippet-plugin 1.0.2
File Interpreter ABI Platform
mkdocs_snippet_plugin-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 7.8 kB

Release files / mkdocs-snippet-plugin-1.0.2.tar.gz

Download URL mkdocs-snippet-plugin-1.0.2.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
df14858d648e8bd90736d02e2c202194d4ccb25e783fdf5e6d10afebd4eceae9
BLAKE2b-256 checksum
How to use checksums
8d1a3d2b0861f47792efb18b5c77848398db75acdd6a677acb6d30b7a2f6cc78
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.1

Release files / mkdocs_snippet_plugin-1.0.2-py3-none-any.whl

Download URL mkdocs_snippet_plugin-1.0.2-py3-none-any.whl
Size 4.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c8436a989464b7b5636697cfa2c469ce8e5efaa14e138ab77f526ec293d2a111
BLAKE2b-256 checksum
How to use checksums
55142b7e88ab9ae3a2f2a78bebe4e60e9133a5adf855a73f7eb29dd3851a4783
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.1

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page