semantic_html.parser ==================== .. py:module:: semantic_html.parser Functions --------- .. autoapisummary:: semantic_html.parser.parse_note Module Contents --------------- .. py:function:: parse_note(html: str, mapping: dict, note_uri: str = None, metadata: dict = None, rdfa: bool = False, wadm: bool = False, remove_empty_tags: bool = True) -> dict Parses a HTML note HTML string into a JSON-LD dictionary (optionally also annotated HTML). :param html: The HTML content of the HTML note. :type html: str :param mapping: A dictionary mapping classes, tags, styles, and types. :type mapping: dict :param note_uri: If provided, used as the Note's @id. Can also be a key in mapping dict. :type note_uri: str, optional :param metadata: A dictionary with additional keys to append for each item (e.g. provenance information) Can also be set as dict 'metadata' in mapping. :type metadata: dict, optional :param rdfa: If True, also return RDFa-annotated HTML. :type rdfa: bool, optional :param wadm: If True, also return Web Annotation Data Model conformant JSON-LD. :type wadm: bool, optional :param remove_empty_tags: If True, empty tags will be removed from HTML before parsing. :type remove_empty_tags: bool, optional :returns: dict with keys for JSON-LD, WADM, and RDFa. :rtype: dict