Fix validation tool
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Mon, 31 Oct 2016 17:44:12 +0000 (13:44 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Mon, 31 Oct 2016 17:44:12 +0000 (13:44 -0400)
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
tools/asciidoc.check.conf
tools/check.py

index 9b748dc76f9211a9f4cb720a6af2120a26a5e394..feaaa0a01683e87292228bac1a47e1a3997611e0 100644 (file)
@@ -2,18 +2,23 @@
 note-no-anim="note-no-anim"
 
 [macros]
-(?su)[\\]?(?P<name>man):(?P<page>\S*?)\((?P<section>.*?)\)=
+(?su)[\\]?(?P<name>man):(?P<page>\S*?)\((?P<section>.+?)\)=
+(?su)[\\]?(?P<name>opt):(?P<page>\S*?)\((?P<section>.+?)\):(?P<opt>-[a-zA-Z0-9-]+)=
 (?su)[\\]?(?P<name>path):\{(?P<path>[^}]+)\}=
 (?su)[\\]?(?P<name>dir):\{(?P<dir>[^}]+)\}=
 (?su)[\\]?(?P<name>env):(?P<var>[a-zA-Z0-9_]+)=
 (?su)[\\]?(?P<name>cmd):(?P<var>[a-zA-Z0-9_-]+)=
+(?su)[\\]?(?P<name>noch):\{(?P<text>[^}]+)\}=
 
 [man-inlinemacro]
 <citerefentry>
-    <refentrytitle>{page}</refentrytitle>
-    <manvolnum>{section}</manvolnum>
+  <refentrytitle>{page}</refentrytitle>
+  <manvolnum>{section}</manvolnum>
 </citerefentry>
 
+[opt-inlinemacro]
+<literal>{opt}</literal>
+
 [path-inlinemacro]
 <filename>{path}</filename>
 
@@ -26,6 +31,9 @@ note-no-anim="note-no-anim"
 [cmd-inlinemacro]
 <command>{var}</command>
 
+[noch-inlinemacro]
+<phrase role="noch">{text}</phrase>
+
 [tabledef-default]
 style=def
 def-style=options=("header",)
index 187cd1c3c95abdf4f13110c450d577e532354c98..70bd8d5d731266da430f749016df6c310a163d34 100644 (file)
@@ -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)
This page took 0.024246 seconds and 4 git commands to generate.