MarkdownOptions
Base classes¶
| Name | Children | Inherits |
|---|---|---|
| Options mkconvert._core Base class for the common option models. |
⋔ Inheritance diagram¶
graph TD
125874654["base.MarkdownOptions"]
849523002["_core.Options"]
3879467795["main.BaseModel"]
2751680898["builtins.object"]
849523002 --> 125874654
3879467795 --> 849523002
2751680898 --> 3879467795
🛈 DocStrings¶
Bases: Options
Common Markdown -> HTML options, mapped onto every parser.
The defaults are plain CommonMark (every extension off, raw HTML passed through),
except that a leading front matter block is dropped.
Check MarkdownParser.supported_options for what a parser can enable.
Source code in src/mkconvert/parsers/base.py
alerts
class-attribute
instance-attribute
¶
GitHub alerts: > [!NOTE], > [!WARNING], ...
autolinks
class-attribute
instance-attribute
¶
Link bare URLs (https://..., www.) like GFM's autolink extension.
definition_lists
class-attribute
instance-attribute
¶
Term followed by : definition lines -> <dl>.
footnotes
class-attribute
instance-attribute
¶
text[^1] references and [^1]: ... definitions.
front_matter
class-attribute
instance-attribute
¶
Drop a leading ----delimited front matter block instead of rendering it.
On by default: almost every Markdown file with a leading --- block means front
matter, not a horizontal rule followed by a heading.
hard_breaks
class-attribute
instance-attribute
¶
Render every newline inside a paragraph as <br>.
heading_ids
class-attribute
instance-attribute
¶
Add slug id attributes to headings.
math
class-attribute
instance-attribute
¶
$inline$ and $$display$$ math, rendered as markup for MathJax / KaTeX.
raw_html
class-attribute
instance-attribute
¶
Pass raw HTML through. False escapes or omits it (parser-dependent).
This is not a sanitizer: use mkconvert.sanitize for untrusted input.
smart_punctuation
class-attribute
instance-attribute
¶
Typographic quotes, dashes and ellipses.
strikethrough
class-attribute
instance-attribute
¶
~~text~~ -> <del> (or <s>).
task_lists
class-attribute
instance-attribute
¶
- [x] item -> list items with checkboxes.
gfm
classmethod
¶
GitHub Flavored Markdown: tables, strikethrough, autolinks and task lists.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
changes
|
Any
|
Further options to set, e.g. |
{}
|