Lines Matching +full:sub +full:- +full:spaces

4 # SPDX-License-Identifier: GPL-2.0
59 self.re_what = re.compile(r"(\/?(?:[\w\-]+\/?){1,2})")
60 self.re_escape = re.compile(r"([\.\x01-\x08\x0e-\x1f\x21-\x2f\x3a-\x40\x7b-\xff])")
61 self.re_unprintable = re.compile(r"([\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xff]+)")
62 self.re_title_mark = re.compile(r"\n[\-\*\=\^\~]+\n")
64 self.re_abi = re.compile(r"(Documentation/ABI/)([\w\/\-]+)")
145 fdata.key = self.re_unprintable.sub("_", key).strip("_")
155 char += ord("a") - ord("Z") - 1
210 # Preserve initial spaces for the first line
226 if self.re_whitespace.sub("", content) == "":
233 # Preserve initial spaces for the first line
288 ref = self.re_unprintable.sub("_", ref).strip("_")
290 # Store per-file state into a namespace variable. This will be used
291 # by the per-line parser state machine and by the warning function.
375 path = self.re_abi_dir.sub("", os.path.dirname(name))
396 Converts a Documentation/ABI + basename into a ReST cross-reference
406 """Enrich ReST output by creating cross-references"""
412 desc = self.re_title_mark.sub("\n\n", "\n" + desc)
415 # Python's regex performance for non-compiled expressions is a lot
426 # Use cross-references for doc files where needed
427 d = self.re_doc.sub(r":doc:`/\1`", d)
429 # Use cross-references for ABI generated docs where needed
442 new = self.re_escape.sub(r"\\\1", m[1])
443 d = re.sub(fr"\b{abi}\b", f":ref:`{new} <{xref}>`", d)
453 new = self.re_escape.sub(r"\\\1", m)
454 d = re.sub(fr"\b{m}\b", f":ref:`{new} <{xref}>`", d)
496 msg += part + "\n"+ "-" * len(part) +"\n\n"
502 names[i] = "**" + self.re_escape.sub(r"\\\1", names[i]) + "**"
506 msg += "+-" + "-" * max_len + "-+\n"
508 msg += f"| {name}" + " " * (max_len - len(name)) + " |\n"
509 msg += "+-" + "-" * max_len + "-+\n"
520 msg += names[0] +"\n" + "-" * len(names[0]) +"\n\n"
538 content = self.re_escape.sub(r"\\\1", w)
540 msg += f"- :ref:`{content} <{label}>`\n\n"
605 title_tag = "-" * len(what)