SfePy NTC

Navigation

  • index
  • modules |
  • next |
  • previous |
  • home| 
  • news| 
  • documentation| 
  • examples| 
  • development| 
  • term overview| 
  • downloads
  • Developer Guide »

Previous topic

script/extract_surface.py script

Next topic

script/gen_iga_patch.py script

This Page

  • Show Source

Quick search

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:

  1. 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/
      
  2. remove doc/examples/:

    $ rm -rf doc/examples/
    
  3. copy gallery/examples/ to doc/:

    $ cp -a gallery/examples/ doc/
    
  4. 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.

gen_gallery.generate_thumbnails(thumbnails_dir, images_dir, scale=0.3)[source]¶

Generate thumbnails into thumbnails_dir corresponding to images in images_dir.

gen_gallery.main()[source]¶

Navigation

  • index
  • modules |
  • next |
  • previous |
  • home| 
  • news| 
  • documentation| 
  • examples| 
  • development| 
  • term overview| 
  • downloads
  • Developer Guide »
© Copyright 2017, Robert Cimrman and SfePy developers. Created using Sphinx 1.6.2.