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
This commit is contained in:
str4d
2015-11-14 22:25:17 +00:00
parent ced12f991a
commit abb969b6cf
8 changed files with 146 additions and 146 deletions

View File

@ -727,8 +727,8 @@ class I2PHtmlFormatter(Formatter):
filename, extension = os.path.splitext(filename)
url = self.tagurlformat % {'path': base, 'fname': filename,
'fext': extension}
parts[0] = "<a href=\"%s#%s_%s\">%s" % \
(url, kinds[kind], value, parts[0])
parts[0] = "<a href=\"%s#%s-%s\">%s" % \
(url, kinds[kind], value.lower(), parts[0])
parts[-1] = parts[-1] + "</a>"
# 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[kind], value.lower())
value = '[%s]' % value
if enc: