brintos

brintos / llvm-project-archived public Read only

0
0
Text · 394 B · 9dd8b1c Raw
17 lines · python
1# -*- coding: utf-8 -*-2#3# LLVM documentation anchor slug formatting4 5# Some of our markdown documentation numbers section titles6# This helpers is used by myst to remove that numbering from the anchor links.7 8from docutils.nodes import make_id9 10 11def make_slug(str):12    import re13 14    str = re.sub(r"^\s*(\w\.)+\w\s", "", str)15    str = re.sub(r"^\s*\w\.\s", "", str)16    return make_id(str)17