blob: 0e5f6ffe7eb6149188e0d2dc0045f509886a63cf (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
# coding=utf-8
from docutils.core import publish_parts
from docutils.parsers.rst.roles import register_canonical_role
from pysite.rst.roles import icon_role
def render(rst: str):
return publish_parts(
source=rst, writer_name="html5", settings_overrides={"halt_level": 2}
)["html_body"]
register_canonical_role("icon", icon_role)
|