Attempt to fix iframes

This commit is contained in:
Francesc Verdugo 2023-08-25 20:42:55 +02:00
parent e775f37ce5
commit 15c08580b9

View File

@ -25,10 +25,9 @@ EditURL = "https://github.com/fverdugo/XM_40017/blob/main/notebooks/SCRIPT_NAME.
```
```@raw html
<iframe id="notebook" src="SCRIPT_NAME" style="width:100%;height:1000px;></iframe>
<iframe id="notebook" src="SCRIPT_NAME_src" style="width:100%;height:1000px;></iframe>
```
"""
#<script>
# document.addEventListener('DOMContentLoaded', function(){
# var myIframe = document.getElementById("notebook");
@ -36,6 +35,7 @@ EditURL = "https://github.com/fverdugo/XM_40017/blob/main/notebooks/SCRIPT_NAME.
#});
#</script>
function convert_embedded_img_to_base64(notebook_path)
doc = open(io->read(io, String), notebook_path)
# Regex matching: extract filename and base64 code
@ -104,10 +104,10 @@ for filepath in notebook_files
convert_embedded_img_to_base64(filepath)
filename_with_ext = splitpath(filepath)[end]
filename = splitext(filename_with_ext)[1]
pth = mkpath(joinpath(repo_root,"docs","src","notebooks",filename))
pth = mkpath(joinpath(repo_root,"docs","src","notebooks",filename*"_src"))
create_md_nb_file(filename)
convert_notebook_to_html("docs/src/notebooks/$filename_with_ext", output_dir=pth, output_name = "index")
modify_notebook_html("docs/src/notebooks/$(filename)/index.html")
modify_notebook_html("docs/src/notebooks/$(filename)_src/index.html")
end
makedocs(;