Marko: fenced_divs
This is an extension for Marko providing support for fenced divs as detailed by pandoc.
It allows you to wrap parts of the Markdown text in a div or other html element without having to resort to html directly.
Like this:
Just plain Markdown here, followed by a `fenced div`.
:::wrapper
This _will_ be wrapped.
:::
And continue doing your thing down here.
You can use a many colons as you want. And yes, you can nest.
Examples
Simple
The text after the opening colons is used as the class attribute
for the div.
# A title
Some text in a paragraph.
:::className
All of this will be wrapped in a `<div class="className">`.
Yes, even this list:
1. First
2. Second
:::
And this will just be another paragraph.
With attributes
If you need more control, you can specify attributes explicitly by wrapping them in curly braces.
# A title
Some text in a paragraph.
::: { #my-id .something active="true" <section> }
All of this will be wrapped in a
`<section id="my-id" class="className" active="true">`.
Yes, even this list:
1. First
2. Second
:::
And this will just be another paragraph.
Usage
- Install
roamkit-marko-fenced-divsfrom Pypi. - Add
roamkit.marko.fenced_divsas an extension.
from marko import Markdown
def convert_to_html(md_text: str) -> str:
# codehilite is just an example of another extension.
engine = Markdown(
extensions=["roamkit.marko.fenced_divs", "codehilite"],
)
return engine.convert(md_text)
Metadata
Release files for roamkit-marko-fenced-divs 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| roamkit_marko_fenced_divs-1.0.0.tar.gz | 4.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| roamkit_marko_fenced_divs-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.3 kB
Release files / roamkit_marko_fenced_divs-1.0.0.tar.gz
| Download URL | roamkit_marko_fenced_divs-1.0.0.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b148ef34e6828e60d4d1931980886d42367548d22fbc8e7841a4edca0724e00c
|
|
BLAKE2b-256 checksum How to use checksums |
98b4d8d9e3e8c46a09bb7ce9ade467bf98c710c4ecfad2afb9f04cd5e56afff4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.17
|
Release files / roamkit_marko_fenced_divs-1.0.0-py3-none-any.whl
| Download URL | roamkit_marko_fenced_divs-1.0.0-py3-none-any.whl |
|---|---|
| Size | 5.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b78d67750abea646741fa86321124dd7f72992d3be7a55646db458f566a72979
|
|
BLAKE2b-256 checksum How to use checksums |
d744c948cfbeadb73184e9c42e8878d8bf75ac0114d3329c9ef299ecc3c34fe4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.17
|