Skip to content

Commit

Permalink
Reformatted source from pre-push script
Browse files Browse the repository at this point in the history
  • Loading branch information
Dean Wampler committed Dec 4, 2019
1 parent 8615bf9 commit 381e807
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
11 changes: 4 additions & 7 deletions doc/source/conf.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -70,17 +70,14 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones. # ones.
extensions = [ extensions = [
'sphinx.ext.autodoc', 'sphinx.ext.autodoc', 'sphinx.ext.viewcode', 'sphinx.ext.napoleon',
'sphinx.ext.viewcode', 'sphinx_click.ext', 'sphinx-jsonschema', 'sphinx_gallery.gen_gallery'
'sphinx.ext.napoleon',
'sphinx_click.ext',
'sphinx-jsonschema',
'sphinx_gallery.gen_gallery'
] ]


sphinx_gallery_conf = { sphinx_gallery_conf = {
"examples_dirs": ["../examples"], # path to example scripts "examples_dirs": ["../examples"], # path to example scripts
"gallery_dirs": ["sections/examples/auto_examples"], # path where to save generated examples "gallery_dirs": ["sections/examples/auto_examples"
], # path where to save generated examples
"ignore_pattern": "../examples/doc_code/", "ignore_pattern": "../examples/doc_code/",
"plot_gallery": "False", "plot_gallery": "False",
# "filename_pattern": "tutorial.py", # "filename_pattern": "tutorial.py",
Expand Down
6 changes: 4 additions & 2 deletions doc/source/custom_directives.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@ def run(self):
thumb_dir = os.path.join(env.srcdir, "_static/thumbs/") thumb_dir = os.path.join(env.srcdir, "_static/thumbs/")
os.makedirs(thumb_dir, exist_ok=True) os.makedirs(thumb_dir, exist_ok=True)
image_path = os.path.join(thumb_dir, os.path.basename(figname)) image_path = os.path.join(thumb_dir, os.path.basename(figname))
real_figname = os.path.join(env.srcdir, "images", os.path.basename(figname)) real_figname = os.path.join(env.srcdir, "images",
sphinx_gallery.gen_rst.scale_image(real_figname, image_path, 400, 280) os.path.basename(figname))
sphinx_gallery.gen_rst.scale_image(real_figname, image_path, 400,
280)
thumbnail = os.path.relpath(image_path, env.srcdir) thumbnail = os.path.relpath(image_path, env.srcdir)
else: else:
thumbnail = "_static/img/thumbnails/default.png" thumbnail = "_static/img/thumbnails/default.png"
Expand Down

0 comments on commit 381e807

Please sign in to comment.