# stefan-on-software-renderer
A simple wrapper around the [markdown2](https://github.com/trentm/python-markdown2) library that can render Markdown files that also include custom XML tags. I use this to render pages in [my website](https://github.com/Stefan4472/Stefans-Blog). 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](https://pygments.org/) 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.
Raw data
{
"_id": null,
"home_page": "https://github.com/Stefan4472/Stefans-Blog",
"name": "stefan-on-software-renderer",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "markdown",
"author": "Stefan Kussmaul",
"author_email": "stefan@stefanonsoftware.com",
"download_url": "",
"platform": null,
"description": "# stefan-on-software-renderer\r\n\r\nA simple wrapper around the [markdown2](https://github.com/trentm/python-markdown2) library that can render Markdown files that also include custom XML tags. I use this to render pages in [my website](https://github.com/Stefan4472/Stefans-Blog). Simply call\r\n```\r\nstefan_on_software_renderer.render_string(post_text: str)\r\n```\r\n\r\nto render the provided text. You can add a figure to your markdown using the custom `x-image` tag:\r\n```\r\n<x-image>\r\n <path>colorwheel.png</path>\r\n <caption>The RGB color wheel ([source](https://cdn.sparkfun.com/r/600-600/assets/learn_tutorials/7/1/0/TertiaryColorWheel_Chart.png))</caption>\r\n <alt>Image of the RGB color wheel</alt>\r\n</x-image>\r\n```\r\n\r\nYou can add a code block with [pygments](https://pygments.org/) syntax highlighting using the custom `<x-code>` tag:\r\n```\r\n# See the pygments languages documentation for a list of possible \"language\" arguments (https://pygments.org/languages/). Leave blank for no styling\r\n<x-code language=\"python\">\r\nif __name__ == '__main__':\r\n print('Hello world')\r\n</x-code>\r\n```\r\n\r\nThe 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.\r\n\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A simple program that can render Markdown that includes custom XML tags.",
"version": "0.1.0",
"split_keywords": [
"markdown"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "0d73049f85ffbd01cdfa797a7f74de3b21ecbfa096bbb935f4d7f9e651893cea",
"md5": "951250331cf87d646daad67ba876d53c",
"sha256": "19a8f1975e835caa5c15231678c6a7e0680d54cf21b1723d022e56afd773fb33"
},
"downloads": -1,
"filename": "stefan_on_software_renderer-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "951250331cf87d646daad67ba876d53c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 26194,
"upload_time": "2023-01-18T21:22:17",
"upload_time_iso_8601": "2023-01-18T21:22:17.787923Z",
"url": "https://files.pythonhosted.org/packages/0d/73/049f85ffbd01cdfa797a7f74de3b21ecbfa096bbb935f4d7f9e651893cea/stefan_on_software_renderer-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-01-18 21:22:17",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "Stefan4472",
"github_project": "Stefans-Blog",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "stefan-on-software-renderer"
}