Support for WaveDrom in Python Markdown
Project description
Support for WaveDrom in Python Markdown
This extension adds support for WaveDrom to Python Markdown.
Installation
pip install markdown-wavedrom
This extension parses Markdown and replaces matching sections with HTML script elements. To enable WaveDrom rendering, you must ensure that the proper JavaScript code is loaded into your HTML page. See the WaveDrom documentation for details.
Example
# My Markdown Documentation
wavedrom (
{ signal: [{ name: "Alfa", wave: "01.zx=ud.23.456789" }] }
)
MkDocs Integration
The following minimal config is required to get markdown-wavedrom to work in MkDocs.
markdown_extensions:
- markdown_wavedrom
extra_javascript:
- https://cdnjs.cloudflare.com/ajax/libs/wavedrom/2.6.8/wavedrom.min.js
- https://cdnjs.cloudflare.com/ajax/libs/wavedrom/2.6.8/skins/default.js
- js/wavedrom_loader.js
Where docs/js/wavedrom_loader.js
has the following content:
window.addEventListener("load", function () {
WaveDrom.ProcessAll();
});
You can of cause also host the WaveDrom JavaScript files locally with your documentation.
For a complete example with MkDocs, see the markdown-wavedrom-mkdocs-example GitHub page.
Development
Feel free to open an issue or a PR if there is something that can be improved.
Releases on PyPI are created automatically through python-semantic-release
.
Therefore, this project uses Angular commit message style
for commits.
Testing
$ pip install -r dev-requirements.txt
$ tox
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file markdown-wavedrom-1.0.0.tar.gz
.
File metadata
- Download URL: markdown-wavedrom-1.0.0.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68712795fe0590d6eb120924fb51c7498cd308ef74dc5b79e1091528446a613c |
|
MD5 | 1df167eb52624083bc8453f6f5286ee0 |
|
BLAKE2b-256 | 05be4a673ceee35cb91aef7bd6f964a1eeaf395db047fe84256a910ded0edc04 |
File details
Details for the file markdown_wavedrom-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: markdown_wavedrom-1.0.0-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8287f031766891e09da713ee914db223be34aff639194314653f7a9d6aa7c333 |
|
MD5 | e657fc40ba45e537cf61664da091d38f |
|
BLAKE2b-256 | 04e96def3efd0a05fc1dd804db3b259bc2c8a1fb0a799563c061a714400031de |