Skip to content

Commit

Permalink
🎨
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoGorelli committed Dec 19, 2020
1 parent fdb0199 commit 1e8b9ea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/source/pymc-examples
9 changes: 4 additions & 5 deletions docs/source/sphinxext/gallery_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,10 @@ class NotebookGenerator:

def __init__(self, filename, target_dir):
self.basename = os.path.basename(filename)
self.stripped_name = os.path.splitext(self.basename)[0]
self.output_html = str(
Path("..") / Path(filename).relative_to(Path.cwd()).with_suffix(".html")
)
stripped_name = os.path.splitext(self.basename)[0]
self.output_html = str(".." / Path(filename).relative_to(Path.cwd()).with_suffix(".html"))
self.image_dir = os.path.join(target_dir, "_images")
self.png_path = os.path.join(self.image_dir, f"{self.stripped_name}.png")
self.png_path = os.path.join(self.image_dir, f"{stripped_name}.png")
with open(filename) as fid:
self.json_source = json.load(fid)
self.pagetitle = self.extract_title()
Expand Down Expand Up @@ -188,6 +186,7 @@ def build_gallery(srcdir, gallery):
js_file = os.path.join(image_dir, f"gallery_{gallery}_contents.js")
with open(table_of_contents_file) as toc:
table_of_contents = toc.read()

js_contents = "Gallery.examples = {}\n{}".format(json.dumps(data), table_of_contents)

with open(js_file, "w") as js:
Expand Down

0 comments on commit 1e8b9ea

Please sign in to comment.