commit c5e91631d127039ba1268b4204249e6641c9d6bf Author: Buutti Education <> Date: Thu Jun 19 12:55:54 2025 +0000 Initial commit diff --git a/.scripts/buildHTMLslides.bat b/.scripts/buildHTMLslides.bat new file mode 100644 index 0000000..c4bfb46 --- /dev/null +++ b/.scripts/buildHTMLslides.bat @@ -0,0 +1,11 @@ +for /d %%A in (.\*) do ( + set "except=" + if /i "%%~nxA" == "temp" set "except=1" + if /i "%%~nxA" == "_site" set "except=1" + if /i "%%~nxA" == ".jekyll-cache" set "except=1" + if not defined except ( + for %%j in (%%A\*.md) do ( + marp %%j -o %%~pj%%~nj-slides.html --html true + ) + ) +) diff --git a/.scripts/buildPDFslides.bat b/.scripts/buildPDFslides.bat new file mode 100644 index 0000000..545efa3 --- /dev/null +++ b/.scripts/buildPDFslides.bat @@ -0,0 +1,11 @@ +for /d %%A in (.\*) do ( + set "except=" + if /i "%%~nxA" == "temp" set "except=1" + if /i "%%~nxA" == "_site" set "except=1" + if /i "%%~nxA" == ".jekyll-cache" set "except=1" + if not defined except ( + for %%j in (%%A\*.md) do ( + marp %%j -o %%~pj%%~nj.pdf --html true + ) + ) +) diff --git a/.scripts/convertAndReplaceAll.bat b/.scripts/convertAndReplaceAll.bat new file mode 100644 index 0000000..90512b5 --- /dev/null +++ b/.scripts/convertAndReplaceAll.bat @@ -0,0 +1,26 @@ +call convertPptxToMd.bat +REN img imgs + +chcp 65001 + +wsl bash replace.sh "![](img%%5C" "![](imgs/" +wsl bash replace.sh "\." "." +wsl bash replace.sh "\," "," +wsl bash replace.sh "\!" "!" +wsl bash replace.sh "\-" "-" +wsl bash replace.sh "\*" "*" +wsl bash replace.sh "\#" "#" +wsl bash replace.sh "\\+" "+" +wsl bash replace.sh "\(" "(" +wsl bash replace.sh "\)" ")" +wsl bash replace.sh "\{" "{" +wsl bash replace.sh "\}" "}" +wsl bash replace.sh "\[" "[" +wsl bash replace.sh "\]" "]" +wsl bash replace.sh "_[" "[" +wsl bash replace.sh ")_" ")" +wsl bash replace.sh "”" "\"" +wsl bash replace.sh "“" "\"" +wsl bash replace.sh "’" "'" +wsl bash replace.sh "‘" "'" +wsl bash removeLinebreaks.sh \ No newline at end of file diff --git a/.scripts/convertPptxToMd.bat b/.scripts/convertPptxToMd.bat new file mode 100644 index 0000000..f2e50e2 --- /dev/null +++ b/.scripts/convertPptxToMd.bat @@ -0,0 +1,3 @@ +for %%j in (.\*.pptx) do ( + pptx2md --disable-color "%%j" -o "%%~pj%%~nj.md" +) \ No newline at end of file diff --git a/.scripts/removeHtmls.bat b/.scripts/removeHtmls.bat new file mode 100644 index 0000000..63d5351 --- /dev/null +++ b/.scripts/removeHtmls.bat @@ -0,0 +1,5 @@ +for /D %%i in (.\*) do ( + for %%j in (%%i\*.md) do ( + del %%~pj%%~nj.html + ) +) diff --git a/.scripts/removeLinebreaks.sh b/.scripts/removeLinebreaks.sh new file mode 100644 index 0000000..4cbe3a3 --- /dev/null +++ b/.scripts/removeLinebreaks.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +for file in *.md; do + perl -0777 -i -pe ' + s/\r\n/\n/g; # Normalize Windows line endings to Unix + s/(?:[ \t]*\n){2,}/\n\n/g; # Collapse multiple blank lines (even with whitespace) + ' "$file" +done + +echo "Collapsed extra blank lines." \ No newline at end of file diff --git a/.scripts/replace.sh b/.scripts/replace.sh new file mode 100644 index 0000000..2d8538f --- /dev/null +++ b/.scripts/replace.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +SEARCH="$1" +REPLACE="$2" + +for file in *.md; do + SEARCH="$SEARCH" REPLACE="$REPLACE" perl -i -pe ' + BEGIN { + $search = quotemeta($ENV{"SEARCH"}); + $replace = $ENV{"REPLACE"}; + $replace =~ s/\\/\\\\/g; # escape backslashes in replacement + $replace =~ s/\$/\\\$/g; # escape $ in replacement + } + s/$search/$replace/g; + ' "$file" +done + +echo "Literal replacement complete." \ No newline at end of file diff --git a/.themes/buutti.css b/.themes/buutti.css new file mode 100644 index 0000000..86097a1 --- /dev/null +++ b/.themes/buutti.css @@ -0,0 +1,10 @@ +/* buutti.css */ +/* @theme buutti */ + +@import "default"; + +.columns { + display: grid; + grid-template-columns: repeat(2, minmax(0, 1fr)); + gap: 1rem; +} \ No newline at end of file diff --git a/.vscode/markdown.code-snippets b/.vscode/markdown.code-snippets new file mode 100644 index 0000000..d8ba3ee --- /dev/null +++ b/.vscode/markdown.code-snippets @@ -0,0 +1,117 @@ +{ + "python code block" : { + "scope": "markdown", + "prefix": "py", + "body": [ + "```python", + "$0", + "```" + ], + "description": "Python code block" + }, + "cpp code block" : { + "scope": "markdown", + "prefix": "cpp", + "body": [ + "```cpp", + "$0", + "```" + ], + "description": "C++ code block" + }, + "csharp code block" : { + "scope": "markdown", + "prefix": "cs", + "body": [ + "```csharp", + "$0", + "```" + ], + "description": "C# code block" + }, + "js code block" : { + "scope": "markdown", + "prefix": "js", + "body": [ + "```js", + "$0", + "```" + ], + "description": "JavaScript code block" + }, + "ts code block" : { + "scope": "markdown", + "prefix": "ts", + "body": [ + "```ts", + "$0", + "```" + ], + "description": "TypeScript code block" + }, + "inline code" : { + "scope": "markdown", + "prefix": "c", + "body": [ + "`$0`", + ], + "description": "Inline code block" + }, + "extra slide" : { + "scope": "markdown", + "prefix": "extra", + "body": [ + "## Extra: $0", + "", + ], + "description": "Extra slide colors" + }, + "exercise slide" : { + "scope": "markdown", + "prefix": "exercise", + "body": [ + "## Exercise $0.", + "", + ], + "description": "Exercise slide colors" + }, + "marp front matter" : { + "scope": "markdown", + "prefix": "marp", + "body" : [ + "---", + "marp: true", + "paginate: true", + "math: mathjax", + "theme: buutti", + "title: N. $0", + "---", + "", + "# $0", + "", + "", + "" + ] + }, + "marp columns" : { + "scope": "markdown", + "prefix": "column", + "body" : [ + "
", + "
", + "$0", + "
", + "
", + "", + "
", + "
", + ] + }, + "marp footer" : { + "scope": "markdown", + "prefix": "footer", + "body" : [ + "" + ] + } +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..3f7eefa --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,14 @@ +{ + "markdown.marp.themes": ["./.themes/buutti.css"], + "saveAndRun": { + "commands": [ + { + "match": "\\.md$", + "notMatch": "README\\.md$", + "cmd": "marp ${fileDirname}\\${fileBasename} -o ${fileDirname}\\${fileBasenameNoExt}-slides.html --html true", + "useShortcut": false, + "silent": false + }, + ] + } +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..e162620 --- /dev/null +++ b/README.md @@ -0,0 +1,14 @@ +# Contents + +Material completion denoted with 🌑🌘🌗🌖🌕 . + +| # | Lecture | Materials | Exercises | +| ---: | ------------------------------------- | --------: | --------: | +| 1 | [Example Lecture](example-lecture.md) | 🌕 | 🌕 | + + +## Repository notes (remove before publishing) + +- After reading, remove [example-lecture.md](./example-lecture.md), [example-lecture-slides.html](./example-lecture-slides.html) and [buuttilogo.png](./imgs/buuttilogo.png) +- See [Markdown code snippets](.vscode/markdown.code-snippets) for autocomplete stuff. +- Remove the .gitkeep files from imgs and solutions folders after adding new files to those folders. \ No newline at end of file diff --git a/example-lecture-slides.html b/example-lecture-slides.html new file mode 100644 index 0000000..71b16e0 --- /dev/null +++ b/example-lecture-slides.html @@ -0,0 +1,80 @@ +N. Example Lecture
+

Example Lecture

+
+
+

Section

+
    +
  • This line appears instantly
  • +
+
    +
  • This line appears by pressing spacebar
  • +
  • This line has an inline code variable
    console.log("Here's a coloured JavaScript code block");
    +console.log("Remember indentation so it's revealed after the bullet point.");
    +
    +
  • +
  • This line has an inline LaTeX maths equation
  • +
  • Here's a maths block:
  • +
+

Footers are exclusive to presentation; they are not shown in the webpage markdown document
+
+
+

Columns

+
+
+

+
    +
  • Basic image example
  • +
+
+
+

+
    +
  • Wider image
  • +
+
+
+
    +
  • This line is outside the columns and goes from left all the way to the right
  • +
+
+
+

Setup

+ +
+
\ No newline at end of file diff --git a/example-lecture.md b/example-lecture.md new file mode 100644 index 0000000..f7c6df9 --- /dev/null +++ b/example-lecture.md @@ -0,0 +1,64 @@ +--- +marp: true +paginate: true +math: mathjax +theme: buutti +title: N. Example Lecture +--- + +# Example Lecture + + + + +## Section + +- This line appears instantly +* This line appears by pressing spacebar +* This line has an inline code `variable` + ```js + console.log("Here's a coloured JavaScript code block"); + console.log("Remember indentation so it's revealed after the bullet point."); + ``` +* This line has an inline LaTeX maths equation $c = \frac{a^2}{\sqrt{b}}$ +* Here's a maths block: + +$$ +F(x) = \int_a^b f(x) dx +$$ + + + +## Columns + +
+
+ +![](imgs/buuttilogo.png) + +* Basic image example + +
+
+ +![width:800px](imgs/buuttilogo.png) +* Wider image + +
+
+ +* This line is outside the columns and goes from left all the way to the right + + +## Setup + +* In VS Code, install the extensions + * [Marp for VS code](https://marketplace.visualstudio.com/items?itemName=marp-team.marp-vscode) + * So you can see the slideshow preview when editing. + * [Markdown all in one](https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one) + * [Markdown table formatter](https://marketplace.visualstudio.com/items?itemName=fcrespo82.markdown-table-formatter) + * *Right click > Format document* makes tables pretty + * [Save and run](https://marketplace.visualstudio.com/items?itemName=wk-j.save-and-run) + * An HTML version of the lecture is created on save + * See [settings.json](./.vscode/settings.json) + * Add filenames to `notMatch` if a HTML on save is not needed \ No newline at end of file diff --git a/imgs/.gitkeep b/imgs/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/imgs/buuttilogo.png b/imgs/buuttilogo.png new file mode 100644 index 0000000..8c35578 Binary files /dev/null and b/imgs/buuttilogo.png differ diff --git a/solutions/.gitkeep b/solutions/.gitkeep new file mode 100644 index 0000000..e69de29