From: vsr Date: Thu, 30 Apr 2020 09:13:20 +0000 (+0300) Subject: Improve doc: classify TUI scripts by plugins X-Git-Tag: V9_5_0b1~29^2^2~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ae47fe30debd0ff7305553b284d17739b004af0d;p=modules%2Fshaper.git Improve doc: classify TUI scripts by plugins --- diff --git a/doc/gui/build_index.py b/doc/gui/build_index.py index 09e22cbe6..c72cd7c95 100755 --- a/doc/gui/build_index.py +++ b/doc/gui/build_index.py @@ -78,7 +78,18 @@ def main(src_dir, build_dir): ## 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) diff --git a/doc/gui/index.rst.in b/doc/gui/index.rst.in index bde9f7476..0f549fd30 100644 --- a/doc/gui/index.rst.in +++ b/doc/gui/index.rst.in @@ -8,7 +8,7 @@ Welcome to SHAPER documentation! .. toctree:: :titlesonly: - :maxdepth: 3 + :maxdepth: 2 General/Introduction.rst General/Tutorial.rst