An easy-to-use Python to Markdown generator.
Project description
markdownmaker
markdownmaker is an easy-to-use minimal library to generate a Markdown document with a Python API. Actually, this document you are reading right now was generated with markdownmaker for demonstration purposes (source). Currently it uses Github Flavored Markdown but more flavors might follow.
This library was developed to aid with generating a reference for Armory3D's logic nodes, thus it's feature scope is rather small and the output might have some bugs when creating complex documents. If you encounter problems, please open an issue.
Installation
markdownmaker is installed via pip:
pip install markdownmaker
Usage (API)
Import the following:
from markdownmaker.document import Document
from markdownmaker.markdownmaker import *
After you finished your document, use Document.write()
.
Emphasis
Document.add(Paragraph(Italic("This text will be italic!")))
Document.add(Paragraph(Bold("This text will be bold!")))
Document.add(Paragraph(f"You can also combine {Bold(Italic('bold and italic text!'))}"))
This text will be italic!
This text will be bold!
You can also combine bold and italic text!
Headers
Document.add(Header("This is a header"))
with HeaderSubLevel():
Document.add(Header("This is a sub-header"))
with HeaderSubLevel():
Document.add(Header("This is a sub-sub-header"))
This is a header
This is a sub-header
This is a sub-sub-header
Lists
Document.add(OrderedList(
("Item 1",
"Item 2",
UnorderedList(
(Bold("Test A"),
Italic("Test B"))),
"Item 4")))
- Item 1
- Item 2
- Test A
- Test B
- Item 4
Horizontal Rule
Document.add(HorizontalRule())
Links and Images
Document.add(Link(label='Go to top', url='#markdownmaker'))
Document.add(Image(url='https://gitlab.com/uploads/-/system/project/avatar/21351489/markdownmaker.png?width=40', alt_text='logo'))
Code
Document.add(CodeBlock("""import this
import __hello__""", language="python"))
Document.add(Paragraph(f"{InlineCode('Inline code')} is also supported!"))
import this
import __hello__
Inline code
is also supported!
Quotes
Document.add(Quote("Lorem ipsum dolor sit amet."))
Lorem ipsum dolor sit amet.
License
markdownmaker is licensed under the zlib license..
Project details
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
Hashes for markdownmaker-0.3.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dea43854d0ba623e55d1030cb5107f00f35993b8a18bd95a1867b9643d8710cc |
|
MD5 | 01894bb91ca155c234c05130892b74cf |
|
BLAKE2b-256 | 40705b4847897da1a8879b6711db1accb5ba8314c8264da295cadec546287fca |