Mkdoc Pandoc Plugin
This plugin is based on https://github.com/HaoLiuHust/mkdocs-mk2pdf-plugin and aims to use pandoc as a generic engine to convert to many document format that pandoc suports.
An MkDocs plugin to convert content pages to many format
The plugin will use pandoc to export all markdown pages in your MkDocs repository.
Requirements
- This package requires MkDocs version 1.0 or higher (0.17 works as well)
- Python 3.4 or higher
- pandoc, xelatex(to support Chinese)
sudo apt install pandoc sudo apt install texlive texlive-latex-extra texlive-latex-recommended texlive-xetex
Installation
Install the package with pip:
pip install mkdocs-pandoc-plugin
Enable the plugin in your mkdocs.yml:
plugins:
- search
- pandoc
Note: If you have no
pluginsentry in your config file yet, you'll likely also want to add thesearchplugin. MkDocs enables it by default if there is nopluginsentry set, but now you have to enable it explicitly.
More information about plugins in the [MkDocs documentation][mkdocs-plugins].
Testing
When building your repository with mkdocs build, you should now see the following message at the end of your build output:
Converting 17 files to PDF took 15.6s
In your site_dir you should now have a PDF file for every markdown page.
Options
You may customize the plugin by passing options in mkdocs.yml:
plugins:
- pandoc:
enabled_if_env: ENABLE_PANDOC_EXPORT
enabled_if_env
Setting this option will enable the build only if there is an environment variable set to 1. This is useful to disable building the files during development, since it can take a long time to export all files. Default is not set.
combined
Setting this to true will combine all pages into a single file. All download links will point to this file. Default is false.
combined_output_path
This option allows you to use a different destination for the combined file. Has no effect when combined is set to false. Default is pandoc/combined.pdf.
pandoc_template
This option allows you to use a custom pandoc template to convert markdown file to translated document files.
mkdocs.yml:
plugins:
- pandoc:
project-root
├── docs
├── mkdocs.yml
├── site
.
.
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].
Special thanks
Special thanks go to HaoLiuHust for developing the mkdocs-mk2pdf-plugin.
Metadata
Release files for mkdocs-pandoc-plugin 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| mkdocs-pandoc-plugin-1.0.1.tar.gz | 6.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mkdocs_pandoc_plugin-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.7 kB
Release files / mkdocs-pandoc-plugin-1.0.1.tar.gz
| Download URL | mkdocs-pandoc-plugin-1.0.1.tar.gz |
|---|---|
| Size | 6.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cb5a13cd269c8e7f2fda8ac9ad3adb3b4ad39fdb3b81bde288de7c82a5b5aed0
|
|
BLAKE2b-256 checksum How to use checksums |
95196fbc782d2f973d16fc07e75d7e8375b55b8babf08835bcb3f7aa168f9b1a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6
|
Release files / mkdocs_pandoc_plugin-1.0.1-py3-none-any.whl
| Download URL | mkdocs_pandoc_plugin-1.0.1-py3-none-any.whl |
|---|---|
| Size | 7.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dedfbf35c1fa5d590d021b1befa020e2ae569b7b891ecf5a70775109603af824
|
|
BLAKE2b-256 checksum How to use checksums |
10f6b44d2ddb6740392267a96726b853e77b87325e76c19b3766ed22b4e00086
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6
|
Security for mkdocs-pandoc-plugin 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.