notes¶
Module for notes.
Notes can be either written in markdown or HTML.
Markdown -> HTML conversion is performed using markdown-it-py for the conversion.
No styles for the display are inserted here.
NotesFormat
¶
Bases: StrEnum
Supported formats for Notes.
detect_format
¶
Detect whether notes are markdown or XHTML.
The rule is deliberately structural rather than a heuristic on the
content: notes whose first non-whitespace character is < and which
parse as XML are html, everything else is markdown. A markdown
paragraph which merely contains an inline tag therefore stays markdown.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
notes
|
str
|
the notes string |
required |
Returns:
| Type | Description |
|---|---|
NotesFormat
|
|
NotesFormat
|
|