llvm-project
16 строк · 394.0 Байт
1# -*- coding: utf-8 -*-
2#
3# LLVM documentation anchor slug formatting
4
5# Some of our markdown documentation numbers section titles
6# 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):12import re13
14str = re.sub(r"^\s*(\w\.)+\w\s", "", str)15str = re.sub(r"^\s*\w\.\s", "", str)16return make_id(str)17