5555 'sphinx.ext.extlinks' , # Sphinx built-in extension
5656 'sphinx_tabs.tabs' ,
5757 'wazuh-doc-images' , # Custom extension
58- 'sphinx_reredirects'
58+ 'sphinx_reredirects' ,
59+ 'sphinx_markdown_builder'
5960]
6061
6162# Add any paths that contain templates here, relative to this directory.
148149 current_release [0 ] == v3_release [0 ] and
149150 current_release [1 ] < v3_release [1 ])
150151 html_theme_options ['is_pre_v3' ] = is_pre_v3
151-
152+
152153 # Allow dark mode is set to false by default
153154 html_theme_options ['include_mode' ] = True
154155 # Allow switching between modes is set to false by default
241242# Add link anchors for each heading and description environment. Default: True.
242243html_permalinks = True
243244
244- # Text for link anchors for each heading and description environment. HTML entities
245+ # Text for link anchors for each heading and description environment. HTML entities
245246# and Unicode are allowed. Default: a paragraph sign; ¶
246247html_permalinks_icon = ''
247248
370371# A list of files that should not be packed into the epub file.
371372epub_exclude_files = ['search.html' , 'not_found.html' ]
372373
374+ # -- Options for Markdown output --------------------------------------------
375+
376+ # Options for sphinx-markdown-builder
377+ markdown_http_base = '' # Use relative links
373378
374379# -- Extension configuration -------------------------------------------------
375380
@@ -435,7 +440,7 @@ def setup(app):
435440 os .mkdir (static_path_str )
436441
437442 if html_theme == 'wazuh_doc_theme_v3' :
438-
443+
439444 # Download spec file if the file is missing or older that spec_max_age
440445 if api_tag != '' and apiURL != '' :
441446 spec_max_age = 60 * 15 # 15 minutes
@@ -450,7 +455,7 @@ def setup(app):
450455 except FileNotFoundError :
451456 print (server_api_spec_path + " not found" )
452457 download_needed = True
453-
458+
454459 if download_needed == True :
455460 print ('Downloading ' + 'spec-' + api_tag + '.yaml' )
456461 spec_path , url_retrieve_headers = urlretrieve (apiURL , server_api_spec_path )
@@ -633,16 +638,16 @@ def finish_and_clean(app, exception):
633638 os .remove (mapFilePath )
634639 except :
635640 print ("Error while deleting file : " , mapFilePath )
636-
641+
637642 # Remove the source mapping URLs
638643 for assetsFilePath in assetsFiles :
639644 try :
640645 with open (assetsFilePath , "r" ) as f :
641646 lines = f .readlines ()
642647 with open (assetsFilePath , "w" ) as f :
643648 for line in lines :
644- line = re .sub ("//# sourceMappingURL=.*\.map" , "" , line )
645- line = re .sub ("/\*# sourceMappingURL=.*\.map \*/" , "" , line )
649+ line = re .sub (r "//# sourceMappingURL=.*\.map" , "" , line )
650+ line = re .sub (r "/\*# sourceMappingURL=.*\.map \*/" , "" , line )
646651 f .write (line )
647652 except :
648653 print ("Error while removing source mapping from file: " , assetsFilePath )
0 commit comments