]> granicus.if.org Git - esp-idf/commitdiff
tools: replace absolute URLs in Kconfig docs
authorRoland Dobai <dobai.roland@gmail.com>
Tue, 29 Jan 2019 15:27:02 +0000 (16:27 +0100)
committerRoland Dobai <dobai.roland@gmail.com>
Tue, 29 Jan 2019 15:27:02 +0000 (16:27 +0100)
tools/kconfig_new/gen_kconfig_doc.py

index 49169b1336d29bc0c73407f9e50cea7ad506d37a..6d6d7b1fafe81ab62a6e26a00a0c1975432da1f3 100644 (file)
@@ -94,6 +94,8 @@ def format_rest_text(text, indent):
     # Escape some characters which are inline formatting in ReST
     text = text.replace("*", "\\*")
     text = text.replace("_", "\\_")
+    # replace absolute links to documentation by relative ones
+    text = re.sub(r'https://docs.espressif.com/projects/esp-idf/\w+/\w+/(.+)\.html', r':doc:`../\1`', text)
     text += '\n'
     return text