From 468ff0247115fcebcd64cc007e95005cb6be236c Mon Sep 17 00:00:00 2001 From: Nathan Mannall Date: Fri, 11 Oct 2024 15:01:18 +0100 Subject: [PATCH 1/3] Update intro chapter to use new module structure --- lectures/cpp-intro/index.html | 13 +------------ lectures/template/cpptheme.js | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/lectures/cpp-intro/index.html b/lectures/cpp-intro/index.html index 3b8bc49..0ac278f 100644 --- a/lectures/cpp-intro/index.html +++ b/lectures/cpp-intro/index.html @@ -5,18 +5,7 @@ - - + - - - - - - \ No newline at end of file diff --git a/lectures/template/cpptheme.js b/lectures/template/cpptheme.js index a181302..b582b3d 100644 --- a/lectures/template/cpptheme.js +++ b/lectures/template/cpptheme.js @@ -1,10 +1,16 @@ +import {epcc, Theme} from "https://EPCCed.github.io/remark_theme/latest.js"; epcc.footer_text = "© Rupert Nash, The University of Edinburgh, CC-BY"; -cpptheme = new Theme( - (str => str.substring(0, str.lastIndexOf("/")))(document.currentScript.src), +var cpptheme = new Theme( + (str => str.substring(0, str.lastIndexOf("/")))(import.meta.url), '$BASEURL/style.css', { - thumb: function () { - return '.thumb[\n.thumbtxt[\n' + this +'\n]\n]'; - } - }); + thumb: function () { + return '.thumb[\n.thumbtxt[\n' + this +'\n]\n]'; + } + } +); + +epcc.install(); +cpptheme.install(); +globalThis.slideshow = remark.create({sourceUrl: 'README.md'}); From 285a27bb9cbd5164fb5effc18bd1b32eb1f16969 Mon Sep 17 00:00:00 2001 From: Nathan Mannall Date: Tue, 15 Oct 2024 11:57:22 +0100 Subject: [PATCH 2/3] Allow default footer text to be overridden --- lectures/template/cpptheme.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lectures/template/cpptheme.js b/lectures/template/cpptheme.js index b582b3d..6594a71 100644 --- a/lectures/template/cpptheme.js +++ b/lectures/template/cpptheme.js @@ -1,6 +1,12 @@ import {epcc, Theme} from "https://EPCCed.github.io/remark_theme/latest.js"; -epcc.footer_text = "© Rupert Nash, The University of Edinburgh, CC-BY"; +var footer = new URL(import.meta.url).searchParams.get("footer"); + +if (!footer) { + footer = "© Rupert Nash, The University of Edinburgh, CC-BY"; +} +epcc.footer_text = footer; + var cpptheme = new Theme( (str => str.substring(0, str.lastIndexOf("/")))(import.meta.url), '$BASEURL/style.css', From cd26aeef1b2830986291355f49e4bebbc2ddccc2 Mon Sep 17 00:00:00 2001 From: Nathan Mannall Date: Tue, 15 Oct 2024 11:58:39 +0100 Subject: [PATCH 3/3] Update remaining chapters for the new remark theme --- lectures/algorithms-lambdas-traits/index.html | 24 +++-------------- lectures/classes/index.html | 24 +++-------------- lectures/eigen/index.html | 27 +++++-------------- lectures/loops-containers/index.html | 15 ++--------- lectures/resources/index.html | 15 ++--------- lectures/template/mathjax-setup.js | 8 ++++++ lectures/templates/index.html | 13 +-------- lectures/threads-1/index.html | 16 +++-------- lectures/threads-2/index.html | 16 +++-------- 9 files changed, 32 insertions(+), 126 deletions(-) create mode 100644 lectures/template/mathjax-setup.js diff --git a/lectures/algorithms-lambdas-traits/index.html b/lectures/algorithms-lambdas-traits/index.html index b2fe5d7..868058d 100644 --- a/lectures/algorithms-lambdas-traits/index.html +++ b/lectures/algorithms-lambdas-traits/index.html @@ -1,31 +1,13 @@ -C++ for numerical computing part 2 +Algorithms, lambdas, traits - - + + - - - - - - diff --git a/lectures/classes/index.html b/lectures/classes/index.html index 32819ae..a112137 100644 --- a/lectures/classes/index.html +++ b/lectures/classes/index.html @@ -5,27 +5,9 @@ - - - + + + - - - - - - \ No newline at end of file diff --git a/lectures/eigen/index.html b/lectures/eigen/index.html index 8d0e7f5..b2e2432 100644 --- a/lectures/eigen/index.html +++ b/lectures/eigen/index.html @@ -1,30 +1,17 @@ -A brief introduction to C++ +Linear Algebra for C++ - - - - - - + + + + + - + - diff --git a/lectures/loops-containers/index.html b/lectures/loops-containers/index.html index bdd2a97..6988ae3 100644 --- a/lectures/loops-containers/index.html +++ b/lectures/loops-containers/index.html @@ -1,22 +1,11 @@ -C++ for numerical computing +Containers, loops, and iterators - - + - - - - - - diff --git a/lectures/resources/index.html b/lectures/resources/index.html index 3b8bc49..bdcc5ee 100644 --- a/lectures/resources/index.html +++ b/lectures/resources/index.html @@ -1,22 +1,11 @@ -A brief introduction to C++ +Resource Management - - + - - - - - - \ No newline at end of file diff --git a/lectures/template/mathjax-setup.js b/lectures/template/mathjax-setup.js new file mode 100644 index 0000000..1421317 --- /dev/null +++ b/lectures/template/mathjax-setup.js @@ -0,0 +1,8 @@ +// Setup MathJax +MathJax.Hub.Config({ + tex2jax: { + skipTags: ['script', 'noscript', 'style', 'textarea', 'pre'] + } +}); + +MathJax.Hub.Configured(); \ No newline at end of file diff --git a/lectures/templates/index.html b/lectures/templates/index.html index f14fe01..30abb8a 100644 --- a/lectures/templates/index.html +++ b/lectures/templates/index.html @@ -5,18 +5,7 @@ - - + - - - - - - \ No newline at end of file diff --git a/lectures/threads-1/index.html b/lectures/threads-1/index.html index b895d67..ce289e1 100644 --- a/lectures/threads-1/index.html +++ b/lectures/threads-1/index.html @@ -5,19 +5,9 @@ - - - - - - -var slideshow = remark.create({sourceUrl: 'README.md'}); - - - + \ No newline at end of file diff --git a/lectures/threads-2/index.html b/lectures/threads-2/index.html index f149417..e41742d 100644 --- a/lectures/threads-2/index.html +++ b/lectures/threads-2/index.html @@ -5,19 +5,9 @@ - - - - - - -var slideshow = remark.create({sourceUrl: 'README.md'}); - - - + \ No newline at end of file