1*6989c484Scor3ntin# -*- coding: utf-8 -*- 2*6989c484Scor3ntin# 3*6989c484Scor3ntin# LLVM documentation anchor slug formatting 4*6989c484Scor3ntin 5*6989c484Scor3ntin# Some of our markdown documentation numbers section titles 6*6989c484Scor3ntin# This helpers is used by myst to remove that numbering from the anchor links. 7*6989c484Scor3ntin 8*6989c484Scor3ntinfrom docutils.nodes import make_id 9*6989c484Scor3ntin 10*6989c484Scor3ntin 11*6989c484Scor3ntindef make_slug(str): 12*6989c484Scor3ntin import re 13*6989c484Scor3ntin 14*6989c484Scor3ntin str = re.sub(r"^\s*(\w\.)+\w\s", "", str) 15*6989c484Scor3ntin str = re.sub(r"^\s*\w\.\s", "", str) 16*6989c484Scor3ntin return make_id(str) 17