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
Wouter Born 2025-05-07 15:34:30 +02:00 committed by GitHub
parent ac2e9941b1
commit 48cd9ce3a7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 4 deletions

View File

@ -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/")