A simple program that can render Markdown that includes custom XML tags.
Project description
stefan-on-software-renderer
A simple wrapper around the markdown2 library that can render Markdown files that also include custom XML tags. I use this to render pages in my website. Simply call
stefan_on_software_renderer.render_string(post_text: str)
to render the provided text. You can add a figure to your markdown using the custom x-image tag:
<x-image>
<path>colorwheel.png</path>
<caption>The RGB color wheel ([source](https://cdn.sparkfun.com/r/600-600/assets/learn_tutorials/7/1/0/TertiaryColorWheel_Chart.png))</caption>
<alt>Image of the RGB color wheel</alt>
</x-image>
You can add a code block with pygments syntax highlighting using the custom <x-code> tag:
# See the pygments languages documentation for a list of possible "language" arguments (https://pygments.org/languages/). Leave blank for no styling
<x-code language="python">
if __name__ == '__main__':
print('Hello world')
</x-code>
The utility function find_images() can be used to get all the paths from the x-image tags in the string. is_markdown_valid() can be used to test whether a given text can be correctly rendered.
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 Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file stefan_on_software_renderer-0.1.0-py3-none-any.whl.
File metadata
- Download URL: stefan_on_software_renderer-0.1.0-py3-none-any.whl
- Upload date:
- Size: 26.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
19a8f1975e835caa5c15231678c6a7e0680d54cf21b1723d022e56afd773fb33
|
|
| MD5 |
951250331cf87d646daad67ba876d53c
|
|
| BLAKE2b-256 |
0d73049f85ffbd01cdfa797a7f74de3b21ecbfa096bbb935f4d7f9e651893cea
|