Skip to main content

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

  1. Install roamkit-marko-fenced-divs from Pypi.
  2. Add roamkit.marko.fenced_divs as 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)

Source distribution for roamkit-marko-fenced-divs 1.0.0
File Size Uploaded
roamkit_marko_fenced_divs-1.0.0.tar.gz 4.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for roamkit-marko-fenced-divs 1.0.0
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page