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
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for stefan_on_software_renderer-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19a8f1975e835caa5c15231678c6a7e0680d54cf21b1723d022e56afd773fb33 |
|
MD5 | 951250331cf87d646daad67ba876d53c |
|
BLAKE2b-256 | 0d73049f85ffbd01cdfa797a7f74de3b21ecbfa096bbb935f4d7f9e651893cea |