constants¶
This module contains constants used throughout the chango package.
- class chango.constants.MarkupLanguage(*values)¶
Commonly known markup languages
- HTML = 'html'¶
- POD = 'pod'¶
The Plain Old Documentation markup language
- RESTRUCTUREDTEXT = 'rst'¶
The reStructuredText markup language
- TEXT = 'txt'¶
Plain text
- classmethod from_string(string, mapping=None)¶
Get the markup language enum member from a string by comparing against the members of this enum as well as commonly used file extensions. Case-insensitive. Leading dots are ignored.
- Parameters:
string (
str) – The string to look up.mapping (
Mapping[str,MarkupLanguage] |None) – A mapping of file extensions to markup languages. If not provided, the default mapping will be used.
- Returns:
The markup language enum member.
- Return type:
- Raises:
ValueError – If the file extension can not be resolved to a markup language.