Skip to main content

mkdocs-diff-file-import MkDocs Plugin

Overview

The mkdocs-diff-file-import plugin for MkDocs allows you to dynamically replace custom code blocks in your Markdown files with the content of specified files. This plugin is particularly useful for managing and displaying differences between imported code files within your documentation.

Features

  • Configurable code block name to identify sections to be replaced.
  • Automatically replaces matching code blocks with the content of specified files during the build process.
  • Easy integration with existing MkDocs projects.

Installation

To install the plugin, you can use pip:

pip install mkdocs-diff-file-import

Configuration

To use the mkdocs-diff-file-import plugin, add it to your mkdocs.yml configuration file:

plugins:
  - search
  - diff-file-import:
      codeblock_name: import-diff-file  # Optional, default is 'import-diff-file'

Usage

In your Markdown files, define code blocks with the specified code block name to be replaced by the plugin. For example:

```
import-diff-file file=example.txt
```

During the MkDocs build process, these code blocks will be replaced by the content of the specified file.

Example

Given the following content in a Markdown file:

```import-diff-file file=example.diff```

The mkdocs-diff-file-import plugin will replace this block with the content of example.diff inside a diff code block:

```diff
[edit routing-instances l3vpn-test]
-    vrf-table-label;
[edit protocols bgp]
+    bgp-error-tolerance {
+        malformed-route-limit 0;
+    }
```

Contributing

Contributions are welcome! Please fork the repository and submit a pull request with your changes. Ensure that your code adheres to the project's coding standards and includes appropriate tests.

  1. Fork the repository
  2. Create a new feature branch (git checkout -b feature/YourFeature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin feature/YourFeature)
  5. Create a new Pull Request

License

This project is licensed under the Apache 2.0 License. See the LICENSE file for more details.

Contact

If you have any questions, issues, or suggestions, please open an issue in the GitHub repository.

Metadata

Release files for mkdocs-diff-file-import 0.1.6

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-diff-file-import 0.1.6
File Size Uploaded
mkdocs_diff_file_import-0.1.6.tar.gz 6.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mkdocs-diff-file-import 0.1.6
File Interpreter ABI Platform
mkdocs_diff_file_import-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 14.4 kB

Release files / mkdocs_diff_file_import-0.1.6.tar.gz

Download URL mkdocs_diff_file_import-0.1.6.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ed912990899958e245a5ef8d7a940050dbe2cf0da419337660737339b5ddba4a
BLAKE2b-256 checksum
How to use checksums
b1fac2429c145f9a7bf3b7f5fa47b394d3790ad8880ff3825526a051820f9e20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.5

Release files / mkdocs_diff_file_import-0.1.6-py3-none-any.whl

Download URL mkdocs_diff_file_import-0.1.6-py3-none-any.whl
Size 7.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e3ca1540e52ab53d6650b91af7a79573945865a99c59556995a87d0e43b3449e
BLAKE2b-256 checksum
How to use checksums
e1808b400f3e93a7982a3732a5ca6c5ccb7ab708666ad70eac658c33c6340c79
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.5

Release history Release notifications | RSS feed

This release

0.1.6 This release

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.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