[issue22593] Automate update of doc references to UCD version when it changes.
Noah Massman-Hall added the comment: I took a crack at the rst side of this, to see if I could reduce it to just one easy to parse for line in each file that needs to be modified. Yeah, not so easy. Substituting text in rst isn't hard, you just insert '|ucd_version|' where the version string should go and then include the following line somewhere below. .. |ucd_version| replace:: 12.1.0 The problem is that I cant find any combination that makes this work for substituting the version string inside of a hyperlink. I've tried multiple combinations and every time the hyperlink gets broken. So this, inside Doc/library/stdtypes.rst: See http://www.unicode.org/Public/\ |ucd_version|\ /ucd/extracted/DerivedNumericType.txt Becomes this in the html: See http://www.unicode.org/Public/";>http://www.unicode.org/Public/12.1.0/ucd/extracted/DerivedNumericType.txt It does in fact do the substitution, but the substituted text onward doesn't get included in the hyperlink. It gets worse if you try to hyperlink text instead of just the url. In Doc/library/unicodedata.rst I tried this: compiled from the |ucd_link|_. .. |ucd_link| replace:: UCD version |ucd_version| .. _ucd_link: http://www.unicode.org/Public/|ucd_version|/ucd and got: compiled from the http://www.unicode.org/Public/|ucd_version|/ucd">UCD version 12.1.0 The sub inside a sub works fine, but no combination I tried could get it to work in the hyperlink itself. Near as I can tell, the only way to accomplish this would require adding or possibly creating a plugin for sphinx. -- nosy: +nmassman ___ Python tracker <https://bugs.python.org/issue22593> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22593] Automate update of doc references to UCD version when it changes.
Change by Noah Massman-Hall : -- keywords: +patch pull_requests: +17155 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/17710 ___ Python tracker <https://bugs.python.org/issue22593> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22593] Automate update of doc references to UCD version when it changes.
Change by Noah Massman-Hall : -- pull_requests: -17155 ___ Python tracker <https://bugs.python.org/issue22593> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22593] Automate update of doc references to UCD version when it changes.
Change by Noah Massman-Hall : -- pull_requests: +17186 pull_request: https://github.com/python/cpython/pull/17748 ___ Python tracker <https://bugs.python.org/issue22593> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22593] Automate update of doc references to UCD version when it changes.
Noah Massman-Hall added the comment: I ended up doing exactly what I said would probably be needed, and wrote a small sphinx extension that handles this. I kept the same reST substitution syntax, but I'm parsing for '|ucd_version|' as the source files are read in and just replacing it with the version number. Feedback is much appreciated. This is my first really involved PR. :) -- ___ Python tracker <https://bugs.python.org/issue22593> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com