Fenced divs extension for Marko
Project description
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)
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 roamkit_marko_fenced_divs-0.1.0.tar.gz.
File metadata
- Download URL: roamkit_marko_fenced_divs-0.1.0.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
39c37b1ab04912b5d83a4edcf88c3955a65da7853c8db06d947bb8e561534532
|
|
| MD5 |
e80b9836a0b6fa04ecad7081cf699afc
|
|
| BLAKE2b-256 |
2d768655f7d4d9d5e9a1dcfff9778c6413d6f818a8ceb4e553f75479b116c451
|
File details
Details for the file roamkit_marko_fenced_divs-0.1.0-py3-none-any.whl.
File metadata
- Download URL: roamkit_marko_fenced_divs-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d5bce73a1f421ccfbaf89464ae8290c51ac4e99cde5f47dd97ec079fe56c9d46
|
|
| MD5 |
dba9167ad4fc91a07f5e978e879a9e1d
|
|
| BLAKE2b-256 |
fadec469781e2c27e02689209f16967705750c3fb38f9f2a54313d5e91958c47
|