From e87f3dd4d0601c569c4379c324a9b2d016a6fda9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Tue, 5 Oct 2021 14:45:03 +0200 Subject: makerst: Add substitution for static qualifier --- doc/tools/makerst.py | 1 + 1 file changed, 1 insertion(+) (limited to 'doc/tools/makerst.py') diff --git a/doc/tools/makerst.py b/doc/tools/makerst.py index a23324fd24..acf04344c6 100755 --- a/doc/tools/makerst.py +++ b/doc/tools/makerst.py @@ -1102,6 +1102,7 @@ def make_footer(): # type: () -> str ".. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`\n" ".. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`\n" ".. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`\n" + ".. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`\n" ".. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`\n" ) # fmt: on -- cgit v1.2.3 From 1e36f5f524d3cdee65c635600b1afc3ce4a8dbb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Tue, 5 Oct 2021 15:31:25 +0200 Subject: makerst: Make external links anonymous Otherwise we get errors if we use the same title for different links in a given class. --- doc/tools/makerst.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'doc/tools/makerst.py') diff --git a/doc/tools/makerst.py b/doc/tools/makerst.py index acf04344c6..105388dd0b 100755 --- a/doc/tools/makerst.py +++ b/doc/tools/makerst.py @@ -871,7 +871,7 @@ def rstize_text(text, state): # type: (str, State) -> str inside_url = True url_has_name = False elif cmd == "/url": - tag_text = ("" if url_has_name else url_link) + " <" + url_link + ">`_" + tag_text = ("" if url_has_name else url_link) + " <" + url_link + ">`__" tag_depth -= 1 escape_post = True inside_url = False @@ -1127,9 +1127,9 @@ def make_link(url, title): # type: (str, str) -> str # External link, for example: # `http://enet.bespin.org/usergroup0.html` if title != "": - return "`" + title + " <" + url + ">`_" + return "`" + title + " <" + url + ">`__" else: - return "`" + url + " <" + url + ">`_" + return "`" + url + " <" + url + ">`__" if __name__ == "__main__": -- cgit v1.2.3 From 20b56f557cdc21c31f5c8d8c936b085685d9aa6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Tue, 5 Oct 2021 16:26:28 +0200 Subject: makerst: Disable making refs for operator methods As this requires more work to ensure that the refs are valid and unique. --- doc/tools/makerst.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'doc/tools/makerst.py') diff --git a/doc/tools/makerst.py b/doc/tools/makerst.py index 105388dd0b..1ec9627c2c 100755 --- a/doc/tools/makerst.py +++ b/doc/tools/makerst.py @@ -1053,6 +1053,11 @@ def make_method_signature( ret_type = method_def.return_type.to_rst(state) ref_type = "method" + # FIXME: Need to add proper support for operator methods, but generating a unique + # and valid ref for them is not trivial. + if method_def.name.startswith("operator "): + make_ref = False + out = "" if make_ref: -- cgit v1.2.3