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
Release files for markdown-wavedrom 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| markdown-wavedrom-1.0.0.tar.gz | 5.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| markdown_wavedrom-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.3 kB
Release files / markdown-wavedrom-1.0.0.tar.gz
| Download URL | markdown-wavedrom-1.0.0.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
68712795fe0590d6eb120924fb51c7498cd308ef74dc5b79e1091528446a613c
|
|
BLAKE2b-256 checksum How to use checksums |
05be4a673ceee35cb91aef7bd6f964a1eeaf395db047fe84256a910ded0edc04
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / markdown_wavedrom-1.0.0-py3-none-any.whl
| Download URL | markdown_wavedrom-1.0.0-py3-none-any.whl |
|---|---|
| Size | 4.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8287f031766891e09da713ee914db223be34aff639194314653f7a9d6aa7c333
|
|
BLAKE2b-256 checksum How to use checksums |
04e96def3efd0a05fc1dd804db3b259bc2c8a1fb0a799563c061a714400031de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|