From: Philippe Proulx Date: Mon, 31 Oct 2016 17:44:12 +0000 (-0400) Subject: Fix validation tool X-Git-Url: https://git.liburcu.org/?a=commitdiff_plain;h=8d1405685572cb63212adce7bd78dc6f6428ba42;p=lttng-docs.git Fix validation tool Signed-off-by: Philippe Proulx --- diff --git a/tools/asciidoc.check.conf b/tools/asciidoc.check.conf index 9b748dc..feaaa0a 100644 --- a/tools/asciidoc.check.conf +++ b/tools/asciidoc.check.conf @@ -2,18 +2,23 @@ note-no-anim="note-no-anim" [macros] -(?su)[\\]?(?Pman):(?P\S*?)\((?P
.*?)\)= +(?su)[\\]?(?Pman):(?P\S*?)\((?P
.+?)\)= +(?su)[\\]?(?Popt):(?P\S*?)\((?P
.+?)\):(?P-[a-zA-Z0-9-]+)= (?su)[\\]?(?Ppath):\{(?P[^}]+)\}= (?su)[\\]?(?Pdir):\{(?P[^}]+)\}= (?su)[\\]?(?Penv):(?P[a-zA-Z0-9_]+)= (?su)[\\]?(?Pcmd):(?P[a-zA-Z0-9_-]+)= +(?su)[\\]?(?Pnoch):\{(?P[^}]+)\}= [man-inlinemacro] - {page} - {section} + {page} + {section} +[opt-inlinemacro] +{opt} + [path-inlinemacro] {path} @@ -26,6 +31,9 @@ note-no-anim="note-no-anim" [cmd-inlinemacro] {var} +[noch-inlinemacro] +{text} + [tabledef-default] style=def def-style=options=("header",) diff --git a/tools/check.py b/tools/check.py index 187cd1c..70bd8d5 100644 --- a/tools/check.py +++ b/tools/check.py @@ -107,13 +107,18 @@ class _Checker: sections_anchors = self._root.findall('.//section') sections_anchors += self._root.findall('.//anchor') sections_anchors += self._root.findall('.//glossary') + sections_anchors += self._root.findall('.//important') + sections_anchors += self._root.findall('.//tip') + sections_anchors += self._root.findall('.//caution') + sections_anchors += self._root.findall('.//warning') + sections_anchors += self._root.findall('.//note') links = self._root.findall('.//link') end_ids = set() for sa in sections_anchors: end_id = sa.get('id') - if end_id is None: + if sa.tag in ('section', 'anchor') and end_id is None: self._perror('Found a section/anchor with no ID', True) end_ids.add(end_id)