2.1.1. string_to_markdown_id package¶
2.1.1.1. Module contents¶
Convert string to GitLab Flavored Markdown Header ID
- string_to_markdown_id.convertToMarkdownId(queries: Union[List[str], str], ignore_multi_hyphens=False) Union[List[str], str] [source]¶
Convert list of query strings or a single string to [GLFM Header ID](https://docs.gitlab.com/ee/user/markdown.html#header-ids-and-links)
- Args:
param1: List of strings or a single string. param2: True to ignore [Rule 4](https://docs.gitlab.com/ee/user/markdown.html#header-ids-and-links).
- Returns:
List of corresponding IDs or a single string ID.
- string_to_markdown_id.dropNonWord(s: str) str [source]¶
Rule 2. All non-word text (such as punctuation or HTML except ‘-’ and space ) is removed.
Replace actual TAB. is converted to t in raw conversion. A sole might be there in string because of the TAB unicode in the string.
- string_to_markdown_id.hyphensManyToOne(s: str) str [source]¶
Rule 4. Two or more hyphens in a row are converted to one.
Note: Ignored in Github Markdown
- string_to_markdown_id.manageDuplicates(generated: List[str]) List[str] [source]¶
Rule 5. If a header with the same ID has already been generated, a unique incrementing number is appended, starting at 1.