Skip to content

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.

Notes

Notes(notes, format=MARKDOWN)

SBML notes.

Initialize notes object.

detect_format

detect_format(notes)

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.HTML for notes which are already markup, else

NotesFormat

NotesFormat.MARKDOWN