Improve replacement logic so it also works with openHAB HTTPS links (#2488)
Nowadays HTTPS links are more common which should also be replaced. Signed-off-by: Wouter Born <github@maindrain.net>pull/2480/head^2
parent
ac2e9941b1
commit
48cd9ce3a7
|
@ -116,10 +116,12 @@ def process_file(indir, file, outdir, source)
|
|||
line = line.gsub(%r{]\((.*)/(.*)\)}, '](../thing.html?manufacturer=\1&file=\2)') if file == "zwave/doc/things.md"
|
||||
|
||||
# Misc replaces (relative links, remove placeholder interpreted as custom tags)
|
||||
line = line.gsub("http://docs.openhab.org/addons/uis/habpanel/readme.html", "/docs/configuration/habpanel.html")
|
||||
line = line.gsub("http://docs.openhab.org/addons/uis/basic/readme.html", "/addons/ui/basic/")
|
||||
line = line.gsub(%r{http://docs\.openhab\.org/addons/(.*)/(.*)/readme\.html}, '/addons/\1/\2/')
|
||||
line = line.gsub("http://docs.openhab.org/", "/docs/")
|
||||
line = line.gsub(%r{https?://docs\.openhab\.org/addons/uis/habpanel/readme\.html}, "/docs/configuration/habpanel.html")
|
||||
line = line.gsub(%r{https?://docs\.openhab\.org/addons/uis/basic/readme\.html}, "/addons/ui/basic/")
|
||||
line = line.gsub(%r{https?://docs\.openhab\.org/addons/(.*)/(.*)/readme\.html}, '/addons/\1/\2/')
|
||||
line = line.gsub(%r{https?://docs\.openhab\.org/}, "/docs/")
|
||||
line = line.gsub(%r{https?://openhab\.org/docs/}, "/docs/")
|
||||
line = line.gsub(%r{https?://www\.openhab\.org/docs/}, "/docs/")
|
||||
line = line.gsub("/addons/io/", "/addons/integrations/")
|
||||
line = line.gsub("{{base}}/", "./docs/")
|
||||
line = line.gsub("(images/", "(./images/")
|
||||
|
|
Loading…
Reference in New Issue