Commit 3d1dbc645ef895da0cc55c9e64fe2f5ab0435bb5

vimd2h.py: track correct tag versions in _urlsCI
No game changer, but error reporting used to loop over ALL url's
Author: Alin Mr
Author date (UTC): 2024-03-19 06:16
Committer name: Alin Mr
Committer date (UTC): 2024-03-19 06:27
Parent(s): d8526087416be63e406159e7843b89e395bb14ba
Signing key:
Tree: f2567aa87bdeb1d3f2f93da91e40da5f1706a5b9
File Lines added Lines deleted
vimd2h.py 8 5
File vimd2h.py changed (mode: 100755) (index edbf7db..ff2b707)
... ... class Link(object):
72 72 class VimDoc2HTML(object): class VimDoc2HTML(object):
73 73 def __init__(self, tags, version=None): def __init__(self, tags, version=None):
74 74 self._urls = { } self._urls = { }
75 self._urlsCI = { }
75 self._urlsCI = { } # lowercased tag -> set of cased versions
76 76 self._urlsUnresolved = set() self._urlsUnresolved = set()
77 77 self._version = version self._version = version
78 78 for line in RE_NEWLINE.split(tags): for line in RE_NEWLINE.split(tags):
 
... ... class VimDoc2HTML(object):
95 95 elif special is not None: classattr = ' class="s"' elif special is not None: classattr = ' class="s"'
96 96 link_plain = part1 + classattr + part2 link_plain = part1 + classattr + part2
97 97 self._urls[tag] = Link(link_pipe, link_plain) self._urls[tag] = Link(link_pipe, link_plain)
98 self._urlsCI[tag.lower()] = True
98 lowerTag = tag.lower()
99 if lowerTag in self._urlsCI:
100 self._urlsCI[lowerTag].add(tag)
101 else:
102 self._urlsCI[lowerTag] = set((tag,))
99 103
100 104 def maplink(self, tag, css_class=None): def maplink(self, tag, css_class=None):
101 105 links = self._urls.get(tag) links = self._urls.get(tag)
 
... ... class VimDoc2HTML(object):
109 113 lowerTag = tag.lower() lowerTag = tag.lower()
110 114 if lowerTag in self._urlsCI: if lowerTag in self._urlsCI:
111 115 print('Unresolved reference: |%s|' % tag) print('Unresolved reference: |%s|' % tag)
112 for key in self._urls:
113 if key.lower() == lowerTag:
114 print(' - tag with different case: |%s|' % key)
116 for okTag in self._urlsCI[lowerTag]:
117 print(' - tag with different case: |%s|' % okTag)
115 118 else: else:
116 119 print('Unresolved reference: |%s|' % tag) print('Unresolved reference: |%s|' % tag)
117 120
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/vimdoc2html

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/vimdoc2html

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master