A better markdown library
Project description
BetterMD
Insallation
pip install better-md
# Extras
pip install better-md[tables] # For pandas support
Usage
HTML
import BetterMD as md
html = md.H1("Hello, world!").to_html()
md = md.H1("Hello, world!")..to_md()
rst = md.H1("Hello, world!").to_rst()
Tables
import BetterMD as md
t = md.Table(
inner=[
md.THead(
inner=[
md.Tr(
inner=[
md.Th(inner=[md.Text("Header 1")], styles={"text-align":"left"}),
md.Th(inner=[md.Text("Header 2")], styles={"text-align":"center"}),
md.Th(inner=[md.Text("Header 3")], styles={"text-align":"right"}),
md.Th(inner=[md.Text("Header 4")])
],
),
]
),
md.TBody(
inner=[
md.Tr(
inner=[
md.Td(inner=[md.Text("Row 1 Cell 1")]),
md.Td(inner=[md.Text("Row 1 Cell 2")]),
md.Td(inner=[md.Text("Row 1 Cell 3")]),
md.Td(inner=[md.Text("Row 1 Cell 4")]),
],
),
md.Tr(
inner=[
md.Td(inner=[md.Text("Row 2 Cell 1")]),
md.Td(inner=[md.Text("Row 2 Cell 2")]),
md.Td(inner=[md.Text("Row 2 Cell 3")]),
md.Td(inner=[md.Text("Row 2 Cell 4")]),
]
)
]
)
]
)
t.to_md()
t.to_rst()
t.to_html()
t.to_pandas() # Requires `tables` extra
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 Distribution
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 better_md-0.3.4.tar.gz.
File metadata
- Download URL: better_md-0.3.4.tar.gz
- Upload date:
- Size: 33.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
77bc8aa1ac6db5e57c3d27b62e520eb7743cc7d7236f24313645fd0a3cd63848
|
|
| MD5 |
00750e0c3f50955e8f5ebaa64fd50cb8
|
|
| BLAKE2b-256 |
2a48586b92003debb3c5ab35157c90f7c75035fabeeba185d1d50052d080e9c8
|
Provenance
The following attestation bundles were made for better_md-0.3.4.tar.gz:
Publisher:
publish.yml on Better-Python/better-md
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
better_md-0.3.4.tar.gz -
Subject digest:
77bc8aa1ac6db5e57c3d27b62e520eb7743cc7d7236f24313645fd0a3cd63848 - Sigstore transparency entry: 202992600
- Sigstore integration time:
-
Permalink:
Better-Python/better-md@05f369be0094eefdfb9fd628270b79de2a0e38e5 -
Branch / Tag:
refs/tags/v0.3.4 - Owner: https://github.com/Better-Python
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@05f369be0094eefdfb9fd628270b79de2a0e38e5 -
Trigger Event:
release
-
Statement type:
File details
Details for the file better_md-0.3.4-py3-none-any.whl.
File metadata
- Download URL: better_md-0.3.4-py3-none-any.whl
- Upload date:
- Size: 61.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e598eb439daab9f72894d4098074f01aede2da1e0cb2ff81d33fcba171b0a4f
|
|
| MD5 |
105de28db70d2898eaa816619036c1ae
|
|
| BLAKE2b-256 |
71e14a287fadfcc77becf1d187c9087f43c2e76580422e22f03898e766161182
|
Provenance
The following attestation bundles were made for better_md-0.3.4-py3-none-any.whl:
Publisher:
publish.yml on Better-Python/better-md
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
better_md-0.3.4-py3-none-any.whl -
Subject digest:
1e598eb439daab9f72894d4098074f01aede2da1e0cb2ff81d33fcba171b0a4f - Sigstore transparency entry: 202992602
- Sigstore integration time:
-
Permalink:
Better-Python/better-md@05f369be0094eefdfb9fd628270b79de2a0e38e5 -
Branch / Tag:
refs/tags/v0.3.4 - Owner: https://github.com/Better-Python
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@05f369be0094eefdfb9fd628270b79de2a0e38e5 -
Trigger Event:
release
-
Statement type: