mdpo.command module
mdpo HTML commands related utilities.
- mdpo.command.get_valid_mdpo_command_names()
Return valid mdpo commands names, with and without “mdpo-” prefix.
- Returns:
Valid mdpo command names.
- Return type:
- mdpo.command.normalize_mdpo_command(value)
Normalize a valid command and returns None if the command is invalid.
This function works for lazy command validation (the user doesn’t need to specify the
mdpo-
prefix used for command names).
- mdpo.command.normalize_mdpo_command_aliases(command_aliases)
Validate and normalizes a mapping of mdpo command aliases.
- Parameters:
command_aliases (dict) – Aliases for mdpo commands, in the form
{"<new-command-name>": "<mdpo-command>"}
.- Raises:
ValueError – if an mdpo command resolution doesn’t exists.
- Returns:
Mapping validated and normalized.
- Return type:
- mdpo.command.parse_mdpo_html_command(value)
Parse a mdpo HTML command inside a string value.
This function is used by md2po implementation to discover the HTML commands used by mdpo to customize the extraction.