python-markdown-helper
A bunch of helper classes that make generating markdown files easier.
Originally written to make my own life easier. I got tired of writing repetitive code to generate markdown files for my projects.
Table of Contents
Installation
pip install markdown-helper
Usage
Sample code that generated the EXAMPLE.md file
import markdown_helper as mdh
# Create a new markdown Document that includes a table of contents
doc = mdh.Document("Title", "EXAMPLE.md", overwrite=True, table_of_contents=True)
# Add a new section to the document
first_section = doc.add_section("Section 1")
# Add some text to the section
first_section.add("Regular text in the first section")
# Add a list to the section
list_of_fruits = mdh.List(["Apple", "Banana", "Orange"], ordered=True, title="Fruit List")
first_section.add(list_of_fruits)
# Make a new Table with custom value mapping
table = mdh.Table(["Fruit", "Color"], sort_key="Fruit", title="Fruit Table", custom_map={"Fruit": {"Apple": "🍎", "Banana": "🍌"}})
# Add some rows to the table
table.add_row({"Fruit": "Apple", "Color": "Red"})
table.add_row({"Fruit": "Banana", "Color": "Yellow"})
# Add the table to the document
first_section.add(table)
# Add a new section to the document with Smaller title
second_section = mdh.Section(mdh.Header("Section 2", 2))
doc.add_section(second_section)
second_section.add("Regular text in the second section")
# Add a link and an image to the section
link = mdh.Link("https://google.com", "Google")
second_section.add(link)
image = mdh.Image("https://picsum.photos/200", alt="A random image")
second_section.add(image)
# Output the document to as a string
print(doc)
# Save the document to a file
doc.save()
Upcoming Features
- Add support for code blocks
- ???
Contributing
Feel free to open a pull request or an issue if you have any suggestions or find any bugs
License
This project is licensed under the MIT License - see the LICENSE file for details
Release files for markdown-helper 1.0.2
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_helper-1.0.2.tar.gz | 11.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| markdown_helper-1.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.8 kB
Release files / markdown_helper-1.0.2.tar.gz
| Download URL | markdown_helper-1.0.2.tar.gz |
|---|---|
| Size | 11.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3065cba9efcf9d889c7f540fe3bab6f5928d1d17791b492a586d47b656e7dc70
|
|
BLAKE2b-256 checksum How to use checksums |
e50b670b822994479b2026cd0ad13f12d1a7d8a7baa5f292b7d396f2af139aab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.17
|
Release files / markdown_helper-1.0.2-py3-none-any.whl
| Download URL | markdown_helper-1.0.2-py3-none-any.whl |
|---|---|
| Size | 6.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
29115584e1dfea22adde54034a4203ba59932ec6975d2eb5156a79f58d74998f
|
|
BLAKE2b-256 checksum How to use checksums |
cad5ca73b30a28445bff748f41523a5b05f887caab458f33e5631d47c039834d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.17
|