From abb969b6cfe01dfe242aaff5735419383006e69c Mon Sep 17 00:00:00 2001 From: str4d Date: Sat, 14 Nov 2015 22:25:17 +0000 Subject: [PATCH] Updated spectags * ctags are case-sensitive, and the dataspecs use CamelCase. * HTML anchor tags are case-sensitive. The old specs used CamelCase to match the ctags, and the existing documentation references them extensively. * reStructuredText links are case-insensitive, and the HTML anchor tags that it generates are lower case. Therefore, the links in the .rst files are given in CamelCase, and the dataspec formatters convert this to lower case for links. In direct HTML references (in specs or other areas of documentation), lower case must be used (to be fixed). Command to generate the file: cd i2p2www/spec && ctags -f spectags --langdef=rst --langmap=rst:.rst --regex-rst=/_type-\([a-zA-Z0-9]+\)/\\1/t,type/ --regex-rst=/_struct-\([a-zA-Z0-9]+\)/\\1/s,struct/ --regex-rst=/_msg-\([a-zA-Z]+\)/\\1/m,msg/ -R -n *.rst --- i2p2www/extensions.py | 4 +- i2p2www/formatters.py | 6 +-- i2p2www/pages/site/spectags | 76 ------------------------------ i2p2www/spec/common-structures.rst | 46 +++++++++--------- i2p2www/spec/i2cp.rst | 46 +++++++++--------- i2p2www/spec/i2np.rst | 34 ++++++------- i2p2www/spec/spectags | 76 ++++++++++++++++++++++++++++++ i2p2www/spec/tunnel-message.rst | 4 +- 8 files changed, 146 insertions(+), 146 deletions(-) delete mode 100644 i2p2www/pages/site/spectags create mode 100644 i2p2www/spec/spectags diff --git a/i2p2www/extensions.py b/i2p2www/extensions.py index 8442930a..27d6f677 100644 --- a/i2p2www/extensions.py +++ b/i2p2www/extensions.py @@ -105,13 +105,13 @@ class HighlightExtension(Extension): if ctags: if 'tagsfile' not in parameters: - parameters['tagsfile'] = module_path() + '/pages/site/spectags' + parameters['tagsfile'] = module_path() + '/spec/spectags' if 'tagurlformat' not in parameters: lang = 'en' if hasattr(g, 'lang') and g.lang: lang = g.lang - parameters['tagurlformat'] = '/' + lang + '/%(path)s%(fname)s' + parameters['tagurlformat'] = '/spec/%(path)s%(fname)s' if formatter == 'textspec': formatter = TextSpecFormatter(**parameters) diff --git a/i2p2www/formatters.py b/i2p2www/formatters.py index ce4c58f8..a5987b68 100644 --- a/i2p2www/formatters.py +++ b/i2p2www/formatters.py @@ -727,8 +727,8 @@ class I2PHtmlFormatter(Formatter): filename, extension = os.path.splitext(filename) url = self.tagurlformat % {'path': base, 'fname': filename, 'fext': extension} - parts[0] = "%s" % \ - (url, kinds[kind], value, parts[0]) + parts[0] = "%s" % \ + (url, kinds[kind], value.lower(), parts[0]) parts[-1] = parts[-1] + "" # for all but the last line @@ -876,7 +876,7 @@ class TextSpecFormatter(Formatter): filename, extension = os.path.splitext(filename) url = self.tagurlformat % {'path': base, 'fname': filename, 'fext': extension} - refs[value] = '\n[%s]: %s#%s_%s' % (value, url, kinds[kind], value) + refs[value] = '\n[%s]: %s#%s-%s' % (value, url, kinds[HTTP/1.1 200 OK X-Frame-Options: SAMEORIGIN Date: Wed, 23 Jul 2025 04:27:00 GMT Content-Type: text/plain; charset=utf-8 Connection: close Transfer-Encoding: chunked Cache-Control: max-age=0, private, must-revalidate, no-transform Set-Cookie: i_like_gitea=f2acaeb0df6773f7; Path=/; HttpOnly; Secure; SameSite=Lax Set-Cookie: _csrf=5Loidz_6Swb3BvjiOs53N2zqTZM6MTc1MzI0NDgyMDUyNTc4NTI2OA; Path=/; Max-Age=86400; HttpOnly; Secure; SameSite=Lax X-Cache-Status: HIT X-Cache-Age: 0 62e7 From abb969b6cfe01dfe242aaff5735419383006e69c Mon Sep 17 00:00:00 2001 From: str4d Date: Sat, 14 Nov 2015 22:25:17 +0000 Subject: [PATCH] Updated spectags * ctags are case-sensitive, and the dataspecs use CamelCase. * HTML anchor tags are case-sensitive. The old specs used CamelCase to match the ctags, and the existing documentation references them extensively. * reStructuredText links are case-insensitive, and the HTML anchor tags that it generates are lower case. Therefore, the links in the .rst files are given in CamelCase, and the dataspec formatters convert this to lower case for links. In direct HTML references (in specs or other areas of documentation), lower case must be used (to be fixed). Command to generate the file: cd i2p2www/spec && ctags -f spectags --langdef=rst --langmap=rst:.rst --regex-rst=/_type-\([a-zA-Z0-9]+\)/\\1/t,type/ --regex-rst=/_struct-\([a-zA-Z0-9]+\)/\\1/s,struct/ --regex-rst=/_msg-\([a-zA-Z]+\)/\\1/m,msg/ -R -n *.rst --- i2p2www/extensions.py | 4 +- i2p2www/formatters.py | 6 +-- i2p2www/pages/site/spectags | 76 ------------------------------ i2p2www/spec/common-structures.rst | 46 +++++++++--------- i2p2www/spec/i2cp.rst | 46 +++++++++--------- i2p2www/spec/i2np.rst | 34 ++++++------- i2p2www/spec/spectags | 76 ++++++++++++++++++++++++++++++ i2p2www/spec/tunnel-message.rst | 4 +- 8 files changed, 146 insertions(+), 146 deletions(-) delete mode 100644 i2p2www/pages/site/spectags create mode 100644 i2p2www/spec/spectags diff --git a/i2p2www/extensions.py b/i2p2www/extensions.py index 8442930a..27d6f677 100644 --- a/i2p2www/extensions.py +++ b/i2p2www/extensions.py @@ -105,13 +105,13 @@ class HighlightExtension(Extension): if ctags: if 'tagsfile' not in parameters: - parameters['tagsfile'] = module_path() + '/pages/site/spectags' + parameters['tagsfile'] = module_path() + '/spec/spectags' if 'tagurlformat' not in parameters: lang = 'en' if hasattr(g, 'lang') and g.lang: lang = g.lang - parameters['tagurlformat'] = '/' + lang + '/%(path)s%(fname)s' + parameters['tagurlformat'] = '/spec/%(path)s%(fname)s' if formatter == 'textspec': formatter = TextSpecFormatter(**parameters) diff --git a/i2p2www/formatters.py b/i2p2www/formatters.py index ce4c58f8..a5987b68 100644 --- a/i2p2www/formatters.py +++ b/i2p2www/formatters.py @@ -727,8 +727,8 @@ class I2PHtmlFormatter(Formatter): filename, extension = os.path.splitext(filename) url = self.tagurlformat % {'path': base, 'fname': filename, 'fext': extension} - parts[0] = "%s" % \ - (url, kinds[kind], value, parts[0]) + parts[0] = "%s" % \ + (url, kinds[kind], value.lower(), parts[0]) parts[-1] = parts[-1] + "" # for all but the last line @@ -876,7 +876,7 @@ class TextSpecFormatter(Formatter): filename, extension = os.path.splitext(filename) url = self.tagurlformat % {'path': base, 'fname': filename, 'fext': extension} - refs[value] = '\n[%s]: %s#%s_%s' % (value, url, kinds[kind], value) + refs[value] = '\n[%s]: %s#%s-%s' % (value, url, kinds[ 0