mirror of
https://github.com/fverdugo/XM_40017.git
synced 2025-11-09 00:24:25 +01:00
commit
9f0ca208f1
32
docs/make.jl
32
docs/make.jl
@ -4,7 +4,7 @@ using Glob
|
|||||||
|
|
||||||
const md_nb_template = """
|
const md_nb_template = """
|
||||||
```@meta
|
```@meta
|
||||||
EditURL = "https://github.com/fverdugo/XM_40017/blob/main/docs/src/notebooks/SCRIPT_NAME.ipynb"
|
EditURL = "https://github.com/fverdugo/XM_40017/blob/main/notebooks/SCRIPT_NAME.ipynb"
|
||||||
```
|
```
|
||||||
|
|
||||||
```@raw html
|
```@raw html
|
||||||
@ -13,7 +13,7 @@ EditURL = "https://github.com/fverdugo/XM_40017/blob/main/docs/src/notebooks/SCR
|
|||||||
<div class="admonition-body">
|
<div class="admonition-body">
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
Download this notebook and run it locally on your machine [recommended]. Click <a href="SCRIPT_NAME.ipynb" download>here</a>.
|
Download this notebook and run it locally on your machine [recommended]. Click <a href="https://www.francescverdugo.com/XM_40017/dev/notebooks/SCRIPT_NAME.ipynb" download>here</a>.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
You can also run this notebook in the cloud using Binder. Click <a href="https://mybinder.org/v2/gh/fverdugo/XM_40017/gh-pages?filepath=dev/notebooks/SCRIPT_NAME.ipynb">here</a>
|
You can also run this notebook in the cloud using Binder. Click <a href="https://mybinder.org/v2/gh/fverdugo/XM_40017/gh-pages?filepath=dev/notebooks/SCRIPT_NAME.ipynb">here</a>
|
||||||
@ -25,16 +25,17 @@ EditURL = "https://github.com/fverdugo/XM_40017/blob/main/docs/src/notebooks/SCR
|
|||||||
```
|
```
|
||||||
|
|
||||||
```@raw html
|
```@raw html
|
||||||
<iframe id="notebook" src="../notebook-html/SCRIPT_NAME.html" style="width:100%"></iframe>
|
<iframe id="notebook" src="SCRIPT_NAME" style="width:100%;height:1000px;></iframe>
|
||||||
<script>
|
|
||||||
document.addEventListener('DOMContentLoaded', function(){
|
|
||||||
var myIframe = document.getElementById("notebook");
|
|
||||||
iFrameResize({log:true}, myIframe);
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
```
|
```
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
#<script>
|
||||||
|
# document.addEventListener('DOMContentLoaded', function(){
|
||||||
|
# var myIframe = document.getElementById("notebook");
|
||||||
|
# iFrameResize({log:true}, myIframe);
|
||||||
|
#});
|
||||||
|
#</script>
|
||||||
|
|
||||||
function convert_embedded_img_to_base64(notebook_path)
|
function convert_embedded_img_to_base64(notebook_path)
|
||||||
doc = open(io->read(io, String), notebook_path)
|
doc = open(io->read(io, String), notebook_path)
|
||||||
# Regex matching: extract filename and base64 code
|
# Regex matching: extract filename and base64 code
|
||||||
@ -87,9 +88,9 @@ function modify_notebook_html( html_filepath )
|
|||||||
s"\1\n\t<script src='../assets/iframeResizer.contentWindow.min.js'></script>\n";
|
s"\1\n\t<script src='../assets/iframeResizer.contentWindow.min.js'></script>\n";
|
||||||
count = 1
|
count = 1
|
||||||
)
|
)
|
||||||
open( html_filepath, "w" ) do html_file
|
#open( html_filepath, "w" ) do html_file
|
||||||
write( html_file, content )
|
# write( html_file, content )
|
||||||
end
|
#end
|
||||||
return nothing
|
return nothing
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -103,9 +104,10 @@ for filepath in notebook_files
|
|||||||
convert_embedded_img_to_base64(filepath)
|
convert_embedded_img_to_base64(filepath)
|
||||||
filename_with_ext = splitpath(filepath)[end]
|
filename_with_ext = splitpath(filepath)[end]
|
||||||
filename = splitext(filename_with_ext)[1]
|
filename = splitext(filename_with_ext)[1]
|
||||||
|
pth = mkpath(joinpath(repo_root,"docs","src","notebooks",filename))
|
||||||
create_md_nb_file(filename)
|
create_md_nb_file(filename)
|
||||||
convert_notebook_to_html("docs/src/notebooks/$filename_with_ext", output_name = filename)
|
convert_notebook_to_html("docs/src/notebooks/$filename_with_ext", output_dir=pth, output_name = "index")
|
||||||
modify_notebook_html("docs/src/notebook-html/$(filename).html")
|
modify_notebook_html("docs/src/notebooks/$(filename)/index.html")
|
||||||
end
|
end
|
||||||
|
|
||||||
makedocs(;
|
makedocs(;
|
||||||
@ -124,7 +126,7 @@ makedocs(;
|
|||||||
"Tasks and channels" => "notebooks/julia_async.md",
|
"Tasks and channels" => "notebooks/julia_async.md",
|
||||||
"Remote calls and remote channels" => "notebooks/julia_distributed.md",
|
"Remote calls and remote channels" => "notebooks/julia_distributed.md",
|
||||||
# "MPI" => "notebooks/mpi_tutorial.md",
|
# "MPI" => "notebooks/mpi_tutorial.md",
|
||||||
# "Matrix Multiplication"=>"notebooks/matrix_matrix.md",
|
"Matrix Multiplication"=>"notebooks/matrix_matrix.md",
|
||||||
# "Jacobi" => "notebooks/jacobi_method.md",
|
# "Jacobi" => "notebooks/jacobi_method.md",
|
||||||
# "ASP" => "notebooks/asp.md",
|
# "ASP" => "notebooks/asp.md",
|
||||||
# "Solutions" => "notebooks/solutions.md",
|
# "Solutions" => "notebooks/solutions.md",
|
||||||
|
|||||||
@ -1116,18 +1116,9 @@
|
|||||||
"source": [
|
"source": [
|
||||||
"# License\n",
|
"# License\n",
|
||||||
"\n",
|
"\n",
|
||||||
"TODO: replace link to website\n",
|
|
||||||
"\n",
|
"\n",
|
||||||
"This notebook is part of the course [Programming Large Scale Parallel Systems](http://localhost:8000/) at Vrije Universiteit Amsterdam and may be used under a [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) license."
|
"This notebook is part of the course [Programming Large Scale Parallel Systems](https://www.francescverdugo.com/XM_40017/dev/) at Vrije Universiteit Amsterdam and may be used under a [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) license."
|
||||||
]
|
]
|
||||||
},
|
|
||||||
{
|
|
||||||
"cell_type": "code",
|
|
||||||
"execution_count": null,
|
|
||||||
"id": "86b7b044",
|
|
||||||
"metadata": {},
|
|
||||||
"outputs": [],
|
|
||||||
"source": []
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"metadata": {
|
"metadata": {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user