-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the basic template to generate webpage
- Loading branch information
Showing
41 changed files
with
47,715 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 }} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
build/ | ||
site/ | ||
Manifest.toml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[deps] | ||
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" | ||
XM_40017 = "bac2549d-7fb4-47a9-ab16-d1e9b77d8fc7" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#documenter .docs-sidebar .docs-logo > img, | ||
html.theme--documenter-dark #documenter .docs-sidebar .docs-logo > img { | ||
max-height: 8em; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.