From b60f20870714fafb7e230cf07788caa25e6e22bd Mon Sep 17 00:00:00 2001 From: Shamus Hammons Date: Thu, 2 Feb 2017 09:14:36 -0600 Subject: [PATCH] Added broken internal link checking to build script. --- build.py | 15 +++++++++++++-- include/favorite-plugins-window.html | 6 +++--- include/kde-plasma-5.html | 4 ++-- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/build.py b/build.py index c7b5c53..1d9b89e 100755 --- 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: diff --git a/include/favorite-plugins-window.html b/include/favorite-plugins-window.html index 6e83d38..58a580d 100644 --- a/include/favorite-plugins-window.html +++ b/include/favorite-plugins-window.html @@ -8,7 +8,7 @@ ow">

The Favorite Plugins window is on the top-left side of the Mixer Window. 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.

- +non-working link

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.

@@ -19,7 +19,7 @@ ow">

The Favorite Plugins window provides easy access to frequently used plugins:

- +non-working link - +non-working link

When favorites are added with the Plugin Manager, they are appended to the bottom of the list.

diff --git a/include/kde-plasma-5.html b/include/kde-plasma-5.html index 16c0792..dc15947 100644 --- a/include/kde-plasma-5.html +++ b/include/kde-plasma-5.html @@ -19,7 +19,7 @@ title: KDE Plasma 5
  • Open Workspace > Window Managment.
  • Select Window Rules in the left-hand sidebar. It should default to the Window matching tab.
  • -
  • Click on the New... button.
  • +
  • Click on the New... button.
  • On the line that says Window class (application), set the combo box to Substring Match and type ardour in the text entry field.
  • @@ -31,7 +31,7 @@ title: KDE Plasma 5
  • Check the box next to the Keep above option. On the same line, select Force from the combo box, then click on the Yes radio button for that line.
  • -
  • Click on the OK button to dismiss the dialog. +
  • Click on the OK button to dismiss the dialog.
  • -- 2.37.2