]> Shamusworld >> Repos - ardour-manual-diverged/commitdiff
Added broken internal link checking to build script.
authorShamus Hammons <jlhamm@acm.org>
Thu, 2 Feb 2017 15:14:36 +0000 (09:14 -0600)
committerShamus Hammons <jlhamm@acm.org>
Thu, 2 Feb 2017 15:14:36 +0000 (09:14 -0600)
build.py
include/favorite-plugins-window.html
include/kde-plasma-5.html

index c7b5c53a91e0cf5f932a1f032bf3963e3f7d5475..1d9b89e4123e92c7aac32ea87f912c5905a8d4cd 100755 (executable)
--- a/build.py
+++ b/build.py
@@ -201,7 +201,7 @@ def FindInternalLinks(fs):
 # 'link:' field in the part header. We have to find all occurances and replace
 # them with the appropriate link.
 #
-def FixInternalLinks(links, content):
+def FixInternalLinks(links, content, title):
 
        # Make key1|key2|key3|... out of our links keys
        pattern = re.compile('|'.join(links.keys()))
@@ -209,6 +209,17 @@ def FixInternalLinks(links, content):
        # Use a lambda callback to substitute each occurance found
        result = pattern.sub(lambda x: links[x.group()], content)
 
+       # Check for missing link targets, and report them to the user
+       match = re.findall('"@@.*"', result)
+
+       if len(match) > 0:
+               print('\nMissing link target(s) in "' + title + '":')
+
+               for s in match:
+                       print('  ' + s[3:-1])
+
+               print()
+
        return result
 
 
@@ -426,7 +437,7 @@ for header in fileStruct:
                                content = '[something went wrong]'
 
        # Fix up any internal links
-       content = FixInternalLinks(links, content)
+       content = FixInternalLinks(links, content, header['title'])
 
        # Set up the actual page from the template
        if 'style' not in header:
index 6e83d38fd92c3017b1f658a8e192ea7c259de868..58a580dab96ac2224b87271bee890b99034860a3 100644 (file)
@@ -8,7 +8,7 @@ ow">
 <p>
   The <dfn>Favorite Plugins</dfn> window is on the top-left side of the <dfn>Mixer Window</dfn>. Like other elements in that window it has variable height and can be hidden by dragging it to zero-height. If it is not visible, the top-handle can be grabbed and dragged down to reveal it.
 </p>
-
+<a href="@@foo-blitzsky">non-working link</a>
 <p>
   Plugin names that have a right facing triangle next to them have presets associated with them; clicking on the triangle will cause all presets associated with the plugin to show in the list.
 </p>
@@ -19,7 +19,7 @@ ow">
 <p>
   The Favorite Plugins window provides easy access to frequently used plugins:
 </p>
-
+<a href="@@bar-blitzsky">non-working link</a>
 <ul>
   <li>Plugins can be dragged from the window to any track or bus <a href="@@processor-box"><dfn>processor box</dfn></a>, which will add the plugin to that track or bus at the given position.</li>
   <li>The list includes user-presets for the plugins. Dragging a preset to a given track or bus will load that preset after adding the plugin.</li>
@@ -28,7 +28,7 @@ ow">
   <li>The context-menu allows the deletion of presets or removal of the plugin from the list.</li>
   <li>Plugins in the list can be re-ordered using drag &amp; drop. The custom order is saved.</li>
 </ul>
-
+<a href="@@baz-blitzsky">non-working link</a>
 <p class="note">
   When favorites are added with the <a href="@@plugin-manager">Plugin Manager</a>, they are appended to the bottom of the list.
 </p>
index 16c0792e4046959a08206b6410c5e5b11b80e9dd..dc15947847d1892b374d29de39958317a64a0be9 100644 (file)
@@ -19,7 +19,7 @@ title: KDE Plasma 5
   <li>Open <kbd class="menu">Workspace &gt; Window Managment</kbd>.</li>
   <li>Select <kbd class="menu">Window Rules</kbd> in the left-hand sidebar. It
   should default to the <kbd class="menu">Window matching</kbd> tab.</li>
-  <li>Click on the <kbd class="button">New...</kbd> button.</li>
+  <li>Click on the <kbd class="menu">New...</kbd> button.</li>
   <li>On the line that says <kbd class="menu">Window class (application)</kbd>,
   set the combo box to <kbd class="menu">Substring Match</kbd> and type <kbd
   class="user">ardour</kbd> in the text entry field.</li>
@@ -31,7 +31,7 @@ title: KDE Plasma 5
   <li>Check the box next to the <kbd class="menu">Keep above</kbd> option. On
   the same line, select <kbd class="menu">Force</kbd> from the combo box, then
   click on the <kbd class="menu">Yes</kbd> radio button for that line.</li>
-  <li>Click on the <kbd class="button">OK</kbd> button to dismiss the dialog.
+  <li>Click on the <kbd class="menu">OK</kbd> button to dismiss the dialog.
   </li>
 </ol>