Add the basic template to generate webpage
64
.github/workflows/CI.yml
vendored
Normal file
@ -0,0 +1,64 @@
|
||||
name: CI
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
tags: ['*']
|
||||
pull_request:
|
||||
concurrency:
|
||||
# Skip intermediate builds: always.
|
||||
# Cancel intermediate builds: only if it is a pull request build.
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
|
||||
jobs:
|
||||
test:
|
||||
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
version:
|
||||
- '1.9'
|
||||
os:
|
||||
- ubuntu-latest
|
||||
arch:
|
||||
- x64
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: julia-actions/setup-julia@v1
|
||||
with:
|
||||
version: ${{ matrix.version }}
|
||||
arch: ${{ matrix.arch }}
|
||||
- uses: julia-actions/cache@v1
|
||||
- uses: julia-actions/julia-buildpkg@v1
|
||||
- uses: julia-actions/julia-runtest@v1
|
||||
docs:
|
||||
name: Documentation
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
statuses: write
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: julia-actions/setup-julia@v1
|
||||
with:
|
||||
version: '1'
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4.7.0
|
||||
with:
|
||||
python-version: '3.9'
|
||||
- name: Install nbconvert
|
||||
run: |
|
||||
python -m pip install jupyter nbconvert
|
||||
- name: Configure doc environment
|
||||
run: |
|
||||
julia --project=docs/ -e '
|
||||
using Pkg
|
||||
Pkg.develop(PackageSpec(path=pwd()))
|
||||
Pkg.instantiate()'
|
||||
- uses: julia-actions/julia-buildpkg@v1
|
||||
- uses: julia-actions/julia-docdeploy@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
|
||||
10
Project.toml
Normal file
@ -0,0 +1,10 @@
|
||||
name = "XM_40017"
|
||||
uuid = "bac2549d-7fb4-47a9-ab16-d1e9b77d8fc7"
|
||||
authors = ["Francesc Verdugo <f.verdugo.rojano@vu.nl>"]
|
||||
version = "0.1.0"
|
||||
|
||||
[extras]
|
||||
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
|
||||
|
||||
[targets]
|
||||
test = ["Test"]
|
||||
7
README.md
Normal file
@ -0,0 +1,7 @@
|
||||
# XM_40017
|
||||
Jupyter notebook scripts for the course Programming Large-Scale Parallel Systems (XM_40017) at Vrije Universiteit Amsterdam.
|
||||
|
||||
- [**Go to webpage**](https://fverdugo.github.io/XM_40017/dev)
|
||||
|
||||
## Run webpage locally
|
||||
In XM_40017 folder, call `using LiveServer; servedocs(skip_dir=joinpath("docs","src","notebook-output"))` in terminal.
|
||||
3
docs/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
build/
|
||||
site/
|
||||
Manifest.toml
|
||||
3
docs/Project.toml
Normal file
@ -0,0 +1,3 @@
|
||||
[deps]
|
||||
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
|
||||
XM_40017 = "bac2549d-7fb4-47a9-ab16-d1e9b77d8fc7"
|
||||
62
docs/make.jl
Normal file
@ -0,0 +1,62 @@
|
||||
using XM_40017
|
||||
using Documenter
|
||||
|
||||
# Convert to html using nbconvert
|
||||
function convert_notebook_to_html(notebook_path; output_name = "index", output_dir = "./docs/src/notebook-output", theme = "dark")
|
||||
command_jup = "jupyter"
|
||||
command_nbc = "nbconvert"
|
||||
output_format = "--to=html"
|
||||
theme = "--theme=$theme"
|
||||
output = "--output=$output_name"
|
||||
output_dir = "--output-dir=$output_dir"
|
||||
infile = notebook_path
|
||||
run(`$command_jup $command_nbc $output_format $output $output_dir $theme $infile`)
|
||||
end
|
||||
|
||||
# Resize iframes using IframeResizer
|
||||
function modify_notebook_html( html_name )
|
||||
content = open( html_name, "r" ) do html_file
|
||||
read( html_file, String )
|
||||
end
|
||||
content = replace(content,
|
||||
r"(<script\b[^>]*>[\s\S]*?<\/script>\K)" =>
|
||||
s"\1\n\t<script src='../assets/iframeResizer.contentWindow.min.js'></script>\n";
|
||||
count = 1
|
||||
)
|
||||
content = replace_colors(content)
|
||||
open( html_name, "w" ) do html_file
|
||||
write( html_file, content )
|
||||
end
|
||||
return nothing
|
||||
end
|
||||
|
||||
# Replace colors to match Documenter.jl
|
||||
function replace_colors(content)
|
||||
content = replace( content, "--jp-layout-color0: #111111;" => "--jp-layout-color0: #1f2424;")
|
||||
content = replace(content, "--md-grey-900: #212121;" => "--md-grey-900: #282f2f;")
|
||||
return content
|
||||
end
|
||||
|
||||
convert_notebook_to_html("docs/src/notebooks/matrix_matrix.ipynb", output_name = "matrix_matrix")
|
||||
modify_notebook_html("docs/src/notebook-output/matrix_matrix.html")
|
||||
|
||||
convert_notebook_to_html("docs/src/notebooks/notebook-hello.ipynb", output_name = "notebook-hello")
|
||||
modify_notebook_html("docs/src/notebook-output/notebook-hello.html")
|
||||
|
||||
makedocs(;
|
||||
modules=[XM_40017],
|
||||
authors="Francesc Verdugo <f.verdugo.rojano@vu.nl>",
|
||||
repo="https://github.com/fverdugo/XM_40017/blob/{commit}{path}#{line}",
|
||||
sitename="XM_40017",
|
||||
format=Documenter.HTML(;
|
||||
assets = ["assets/iframeResizer.min.js", "assets/custom.css"],
|
||||
prettyurls=get(ENV, "CI", "false") == "true",
|
||||
canonical="https://fverdugo.github.io/XM_40017",
|
||||
edit_link="main",),
|
||||
pages=["Home" => "index.md","Hello World" => "notebook-hello.md", "Notebooks"=>["Matrix Multiplication"=>"matrix_matrix.md"]],
|
||||
)
|
||||
|
||||
deploydocs(;
|
||||
repo="github.com/fverdugo/XM_40017",
|
||||
devbranch="main",
|
||||
)
|
||||
4
docs/src/assets/custom.css
Normal file
@ -0,0 +1,4 @@
|
||||
#documenter .docs-sidebar .docs-logo > img,
|
||||
html.theme--documenter-dark #documenter .docs-sidebar .docs-logo > img {
|
||||
max-height: 8em;
|
||||
}
|
||||
9
docs/src/assets/iframeResizer.contentWindow.min.js
vendored
Normal file
8
docs/src/assets/iframeResizer.min.js
vendored
Normal file
BIN
docs/src/assets/logo.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
7
docs/src/index.md
Normal file
@ -0,0 +1,7 @@
|
||||
```@meta
|
||||
CurrentModule = XM_40017
|
||||
```
|
||||
# XM_40017
|
||||
|
||||
Welcome!
|
||||
|
||||
31
docs/src/matrix_matrix.md
Normal file
@ -0,0 +1,31 @@
|
||||
```@meta
|
||||
EditURL = "https://github.com/fverdugo/XM_40017/blob/main/notebooks/notebook.ipynb"
|
||||
```
|
||||
|
||||
```@raw html
|
||||
<div class="admonition is-success">
|
||||
<header class="admonition-header">Tip</header>
|
||||
<div class="admonition-body">
|
||||
<ul>
|
||||
<li>
|
||||
Download this notebook and run it locally on your machine [recommended]. Click <a href="notebooks/matrix_matrix.ipynb" download>here</a>.
|
||||
</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/notebook.ipynb">here</a>
|
||||
.
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
```
|
||||
|
||||
```@raw html
|
||||
<iframe id="notebook" src="../notebook-output/matrix_matrix.html" style="width:100%"></iframe>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function(){
|
||||
var myIframe = document.getElementById("notebook");
|
||||
iFrameResize({log:true}, myIframe);
|
||||
});
|
||||
</script>
|
||||
```
|
||||
|
||||
32
docs/src/notebook-hello.md
Normal file
@ -0,0 +1,32 @@
|
||||
|
||||
```@meta
|
||||
EditURL = "https://github.com/fverdugo/XM_40017/blob/main/docs/src/notebooks/notebook-hello.ipynb"
|
||||
```
|
||||
|
||||
```@raw html
|
||||
<div class="admonition is-success">
|
||||
<header class="admonition-header">Tip</header>
|
||||
<div class="admonition-body">
|
||||
<ul>
|
||||
<li>
|
||||
Download this notebook and run it locally on your machine [recommended]. Click <a href="notebooks/notebook-hello.ipynb" download>here</a>.
|
||||
</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/notebook-hello.ipynb">here</a>
|
||||
.
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
```
|
||||
|
||||
```@raw html
|
||||
<iframe id="notebook" src="../notebook-output/notebook-hello.html" style="width:100%"></iframe>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function(){
|
||||
var myIframe = document.getElementById("notebook");
|
||||
iFrameResize({log:true}, myIframe);
|
||||
});
|
||||
</script>
|
||||
```
|
||||
|
||||
15362
docs/src/notebook-output/index.html
Normal file
16559
docs/src/notebook-output/matrix_matrix.html
Normal file
15362
docs/src/notebook-output/notebook-hello.html
Normal file
|
Before Width: | Height: | Size: 391 KiB After Width: | Height: | Size: 391 KiB |
|
Before Width: | Height: | Size: 92 KiB After Width: | Height: | Size: 92 KiB |
|
Before Width: | Height: | Size: 96 KiB After Width: | Height: | Size: 96 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 128 KiB After Width: | Height: | Size: 128 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 139 KiB After Width: | Height: | Size: 139 KiB |
|
Before Width: | Height: | Size: 248 KiB After Width: | Height: | Size: 248 KiB |
|
Before Width: | Height: | Size: 117 KiB After Width: | Height: | Size: 117 KiB |
|
Before Width: | Height: | Size: 136 KiB After Width: | Height: | Size: 136 KiB |
|
Before Width: | Height: | Size: 145 KiB After Width: | Height: | Size: 145 KiB |
187
docs/src/notebooks/notebook-hello.ipynb
Normal file
5
src/XM_40017.jl
Normal file
@ -0,0 +1,5 @@
|
||||
module XM_40017
|
||||
|
||||
greet() = print("Hello World!")
|
||||
|
||||
end # module XM_40017
|
||||