Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Commit

Permalink
update replacement in notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
sdpython committed Nov 27, 2021
1 parent 9c012f3 commit 1e33bef
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 6 additions & 2 deletions src/pyquickhelper/helpgen/post_process.py
Expand Up @@ -592,8 +592,10 @@ def post_process_html_output(file, pdf, python, slides, exc=True,
# js
if fLOG:
fLOG("[post_process_html_output] js: replacements")
repl = {'https://unpkg.com/@jupyter-widgets/html-manager@^0.20.0/dist/embed-amd.js':
'../_static/embed-amd.js'}
repl = {
'https://unpkg.com/@jupyter-widgets/html-manager@^0.20.0/dist/embed-amd.js':
'../_static/embed-amd.js',
'</head>': '<script src="../_static/require.js"></script>\n</head>'}
lines = text.split('\n')
new_lines = []
for line in lines:
Expand Down Expand Up @@ -646,6 +648,8 @@ def post_process_slides_output(file, pdf, python, slides, exc=True,
require = "require(" in text
text = text.replace("reveal.js/dist/reveal.css",
"reveal.js/css/reveal.css")
text = text.replace("reveal.js/dist/reveal.js",
"reveal.js/js/reveal.js")
text = text.replace("reveal.js/dist/theme/simple.css",
"reveal.js/css/theme/simple.css")
text = text.replace("https://unpkg.com/@jupyter-widgets/html-manager@0.20.0/dist/embed-amd.js",
Expand Down
8 changes: 4 additions & 4 deletions src/pyquickhelper/helpgen/process_notebooks.py
Expand Up @@ -748,10 +748,10 @@ def _process_notebooks_in(notebooks, outfold, build, latex_path=None, pandoc_pat

# image
for image in os.listdir(build):
if image.endswith(".png") or image.endswith(".html") or \
image.endswith(".pdf") or image.endswith(".svg") or \
image.endswith(".jpg") or image.endswith(".gif") or \
image.endswith(".xml") or image.endswith(".jpeg"):
if (image.endswith(".png") or image.endswith(".html") or
image.endswith(".pdf") or image.endswith(".svg") or
image.endswith(".jpg") or image.endswith(".gif") or
image.endswith(".xml") or image.endswith(".jpeg")):
image = os.path.join(build, image)
dest = os.path.join(outfold, os.path.split(image)[-1])

Expand Down

0 comments on commit 1e33bef

Please sign in to comment.