check_spec_links.py
Scan Results
""".format(
anchor=anchor,
icon=MESSAGE_TYPE_ICONS[msg.message_type],
style=MESSAGE_TYPE_STYLES[msg.message_type],
t=self.formatBrief(msg.message_type),
lineNum=msg.context.lineNum,
col=getColumn(msg.context),
arg=msg.message_id.enable_arg()))
self.f.write(self.formatContext(msg.context))
self.f.write('
')
for line in msg.message:
self.f.write(html.escape(line))
self.f.write('
\n')
self.f.write('
See also:
Message originated at {}
'.format(
msg.context.lineNum))
highlightStart, highlightEnd = getHighlightedRange(msg.context)
self.f.write(html.escape(msg.context.line[:highlightStart]))
self.f.write(
'')
self.f.write(html.escape(
msg.context.line[highlightStart:highlightEnd]))
self.f.write('')
self.f.write(html.escape(msg.context.line[highlightEnd:]))
self.f.write('
Items here have been referenced by a linking macro, so these are all broken links in the spec!
Add line to include this file | or add this macro instead | Links to this entity | """) for entity_name, uses in sorted(broken.items()): category = checker.findEntity(entity_name).category anchor = self.getUniqueAnchor() asciidocAnchor = '[[{}]]'.format(entity_name) include = generateInclude(dir_traverse='../../generated/', generated_type='api', category=category, entity=entity_name) self.f.write("""
---|---|---|
{} |
{} |
|
These items are expected to be generated in the spec build process, but aren't included.
However, as they also are not referenced by any linking macros, they aren't broken links - at worst they are undocumented entities,
at best they are errors in check_spec_links.py
logic computing which entities get generated files.
Add line to include this file | or add this macro instead | """) for entity in sorted(missing): fn = checker.findEntity(entity).filename anchor = '[[{}]]'.format(entity) self.f.write("""
---|---|
{filename} |
{anchor} |
""".format(filename=fn, anchor=anchor))
self.f.write("""
""".format(
id=self.makeIdentifierFromFilename(filename),
start=r.start))
for lineNum, line in enumerate(
lines[(r.start - 1):(r.stop - 1)], r.start):
# self.f.write(line)
lineLinks = [x for x in self.fileBackLinks[filename]
if x.lineNum == lineNum]
for col, char in enumerate(line):
colLinks = (x for x in lineLinks if x.col == col)
for link in colLinks:
# TODO right now the syntax highlighting is interfering with the link! so the link-generation is commented out,
# only generating the emoji icon.
# self.f.write('{icon}'.format(
# target=link.target, title=html.escape(link.tooltip),
# icon=MESSAGE_TYPE_ICONS[link.message_type]))
self.f.write(MESSAGE_TYPE_ICONS[link.message_type])
self.f.write('Cross reference: {t} {title}'.format(
title=html.escape(link.tooltip, False), t=link.message_type))
# self.f.write('')
# Write the actual character
self.f.write(html.escape(char))
self.f.write('\n')
self.f.write('
')
self.f.write('