]> granicus.if.org Git - icinga2/blobdiff - doc/update-links.py
Update the api documentation
[icinga2] / doc / update-links.py
index f1d0b0b9d673b2ae1ccd8f90cf03258b9fc6e008..bd6efd8f965cdaeea2169aaaa0e5f561ec4a19ff 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 # Icinga 2
-# Copyright (C) 2012-2014 Icinga Development Team (http://www.icinga.org)
+# Copyright (C) 2012-2015 Icinga Development Team (http://www.icinga.org)
 #
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License
@@ -23,7 +23,7 @@ import re
 if len(sys.argv) < 2:
     print "Syntax: %s <md-files>"
     print ""
-    print "Updates intra-chapter links in the specified Markdown files."
+    print "Updates inter-chapter links in the specified Markdown files."
     sys.exit(1)
 
 anchors = {}
@@ -51,5 +51,5 @@ def update_anchor(match):
 
 for file in sys.argv[1:]:
     text = open(file).read()
-    new_text = re.sub(r"\[(?P<text>.*)\]\((?P<file>[0-9-[a-z]\.]+)?#(?P<id>[^#\)]+)\)", update_anchor, text)
+    new_text = re.sub(r"\[(?P<text>.*?)\]\((?P<file>[0-9-a-z\.]+)?#(?P<id>[^#\)]+)\)", update_anchor, text)
     open(file, "w").write(new_text)