script/gen_gallery.py script¶
Generate the images and rst files for gallery of SfePy examples.
The following steps need to be made to regenerate the documentation with the updated example files:
Generate the files:
for sfepy.org deployment:
$ ./script/gen_gallery.py -l ../doc-devel
for local test build run from ./:
$ ./script/gen_gallery.py -l doc/_build/html/
remove doc/examples/:
$ rm -rf doc/examples/
copy gallery/examples/ to doc/:
$ cp -a gallery/examples/ doc/
regenerate the documentation:
$ python setup.py htmldocs
Additional steps for sfepy.org deployment:
- copy doc/_build/html/ to <sfepy.org>/doc-devel/
- copy gallery/index.html and gallery/images/ to <sfepy.org>/
-
gen_gallery.
generate_gallery_html
(examples_dir, output_filename, gallery_dir, rst_dir, thumbnails_dir, dir_map, link_prefix)[source]¶ Generate the gallery html file with thumbnail images and links to examples.
Parameters: - output_filename : str
The output html file name.
- gallery_dir : str
The top level directory of gallery files.
- rst_dir : str
The full path to rst files of examples within gallery_dir.
- thumbnails_dir : str
The full path to thumbnail images within gallery_dir.
- dir_map : dict
The directory mapping returned by generate_rst_files()
- link_prefix : str, optional
The prefix to prepend to links to individual pages of examples.
-
gen_gallery.
generate_images
(images_dir, examples_dir)[source]¶ Generate images from results of running examples found in examples_dir directory.
The generated images are stored to images_dir,
-
gen_gallery.
generate_rst_files
(rst_dir, examples_dir, images_dir)[source]¶ Generate Sphinx rst files for examples in examples_dir with images in images_dir and put them into rst_dir.
Returns: - dir_map : dict
The directory mapping of examples and corresponding rst files.