0
Fork 0
mirror of https://projects.blender.org/infrastructure/gitea-custom.git synced 2024-12-22 07:13:09 -05:00

Fix some unecessary Sphinx warnings in RST preview

This commit is contained in:
Brecht Van Lommel 2023-05-25 19:07:41 +02:00
parent 624cd22f38
commit af8f0edfc8

View file

@ -70,10 +70,10 @@ with tempfile.TemporaryDirectory() as tmp_dir:
return f"image:: {image_url}/{matchobj.group(1).strip('/')}" return f"image:: {image_url}/{matchobj.group(1).strip('/')}"
page_contents = re.sub(":doc:`/(.+?)`", doc_link, page_contents) page_contents = re.sub(":doc:`/(.+?)`", doc_link, page_contents)
page_contents = re.sub(":doc:`(.+?)<(.+?)>`", doc_label_link, page_contents) page_contents = re.sub(":doc:`([\w\s\n-]+?)\n?<(.+?)>`", doc_label_link, page_contents)
page_contents = re.sub(":ref:`(.+?)<(.+?)>`", ref_label_link, page_contents) page_contents = re.sub(":ref:`([\w\s\n-]+?)\n?<(.+?)>`", ref_label_link, page_contents)
page_contents = re.sub(":ref:`([\w\s-]+?)`", ref_link, page_contents) page_contents = re.sub(":ref:`([\w\s-]+?)`", ref_link, page_contents)
page_contents = re.sub(":term:`(.+?)<(.+?)>`", term_link, page_contents) page_contents = re.sub(":term:`([\w\s\n-]+?)\n?<(.+?)>`", term_link, page_contents)
page_contents = re.sub(":term:`([\w\s-]+?)`", term_link, page_contents) page_contents = re.sub(":term:`([\w\s-]+?)`", term_link, page_contents)
page_contents = re.sub("figure:: (.+?)", figure_link, page_contents) page_contents = re.sub("figure:: (.+?)", figure_link, page_contents)
page_contents = re.sub("image:: (.+?)", image_link, page_contents) page_contents = re.sub("image:: (.+?)", image_link, page_contents)
@ -87,6 +87,9 @@ with tempfile.TemporaryDirectory() as tmp_dir:
page_contents = re.sub("literalinclude::(.*)", include_directive, page_contents) page_contents = re.sub("literalinclude::(.*)", include_directive, page_contents)
page_contents = re.sub("include::(.*)", include_directive, page_contents) page_contents = re.sub("include::(.*)", include_directive, page_contents)
page_contents = re.sub("raw::(.*)", raw_directive, page_contents) page_contents = re.sub("raw::(.*)", raw_directive, page_contents)
page_contents = re.sub(".. toctree::(.*)", ".. code-block:: none", page_contents)
page_contents = re.sub(":maxdepth:(.*)", "", page_contents)
page_contents = page_contents.replace("|BLENDER_VERSION|", "BLENDER_VERSION")
page_filepath.write_text(page_contents) page_filepath.write_text(page_contents)