]> SALOME platform Git repositories - modules/shaper.git/blobdiff - doc/gui/build_index.py
Salome HOME
updated copyright message
[modules/shaper.git] / doc / gui / build_index.py
index 09e22cbe6b4453e9ccbc0595254514953b4f4838..0caf21e02b2196af5c2b216bc10bd42164520041 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2014-2020  CEA/DEN, EDF R&D
+# Copyright (C) 2014-2023  CEA, EDF
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -74,11 +74,24 @@ def main(src_dir, build_dir):
                 shutil.rmtree(dist_dir)
             shutil.copytree(lib_dir, dist_dir)
             ## Collect index file
-            indices.append(osp.join(plugin_name, plugin_name + '.rst'))
+            ## For Sphinks type of slash is important.
+            ## Even for Windows the slash direction has to be the same
+            indices.append(plugin_name + "/" + plugin_name + '.rst')
             ## Collect TUI scripts
             tui_files = sorted(f for f in os.listdir(lib_dir) if \
                                    osp.isfile(osp.join(lib_dir, f)) and re.match('TUI_.*\.rst', f))
-            tui_scripts += [osp.join('..', plugin_name, i) for i in tui_files]
+            if tui_files:
+                tui_list_file = osp.join(dist_dir, 'TUI_examples.rst')
+                with open(tui_list_file, 'w') as flist:
+                    flist.write('.. _tui_{}:\n\n'.format(plugin_name.lower()))
+                    title = plugin_name.replace('Plugin', ' plug-in')
+                    flist.write('{}\n'.format(title))
+                    flist.write('{}\n\n'.format('='*len(title)))
+                    flist.write('.. toctree::\n')
+                    flist.write('   :titlesonly:\n')
+                    flist.write('   :maxdepth: 1\n\n')
+                    flist.writelines(['   {}\n'.format(i) for i in tui_files])
+                tui_scripts.append(osp.join('..', plugin_name, 'TUI_examples.rst'))
             ## Mark plugin as processed
             processed.append(plugin_name)