From a1c2d8fe71cb1585a917424bacd4aed35d389cc2 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Wed, 28 Feb 2024 10:38:40 +0200 Subject: [awk-edits/MEL-Teaching] Added special styles and single line tag for teaching articles --- src/styles.csma | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/styles.csma') diff --git a/src/styles.csma b/src/styles.csma index 2b8f9d3..764e2ec 100644 --- a/src/styles.csma +++ b/src/styles.csma @@ -257,6 +257,7 @@ {} {} {} + {} {} @@ -344,6 +345,19 @@ } } +
{ + { + .exercise-solution { + float: right; + font-weight: bold; + } + + /* Slightly smaller than browser defaults https://stackoverflow.com/a/70720104/12036073 https://stackoverflow.com/a/47560151/12036073 */ + h2 ~ .exercise-solution { font-size: 1.4em; margin-top: 0.6em; } + h3 ~ .exercise-solution { font-size: 1.1em; margin-top: 0.8em; } +} +} +
{ { -- cgit v1.3.1-23-gd82d From c2e4d7c2c124f71c768072d8ccbe17aa8e06fa2c Mon Sep 17 00:00:00 2001 From: Syndamia Date: Wed, 3 Apr 2024 18:57:22 +0300 Subject: [awk-edits/Pagenav] Added breadcrumbs navigation --- awk-edits/Pagenav.awk | 28 ++++++++++++++++++++++++++-- src/styles.csma | 5 ++++- 2 files changed, 30 insertions(+), 3 deletions(-) (limited to 'src/styles.csma') diff --git a/awk-edits/Pagenav.awk b/awk-edits/Pagenav.awk index 14772ef..3b05c10 100644 --- a/awk-edits/Pagenav.awk +++ b/awk-edits/Pagenav.awk @@ -16,10 +16,34 @@ nopagenav == 0 && /

" ORS \ +" Reading: " (int(words / 180) + 1) " min || Created: " created " || Edited: " edited "" ORS \ +" || GitLab source" ORS \ +"" + + # Breadcrumbs element + sub(/\/[^/]*$/, "", path) + foldersLen = split(path, folders, "/") + + href = ".." + breadcrumb = " » " folders[foldersLen] "" + for (i = foldersLen-1; i > 0; i--) { + breadcrumb = " » " "" folders[i] "" breadcrumb + href = "../" href + } + breadcrumb = \ +"
" ORS \ +" " breadcrumb ORS \ +"
" + + # Pagenav element $0 = $0 ORS \ "
" ORS \ -" Reading: " (int(words / 180) + 1) " min || Created: " created " || Edited: " edited "" ORS \ -" || GitLab source" ORS \ + stats ORS \ + breadcrumb ORS \ "
" nopagenav = 1 diff --git a/src/styles.csma b/src/styles.csma index 764e2ec..29d63fe 100644 --- a/src/styles.csma +++ b/src/styles.csma @@ -320,8 +320,11 @@ font-size: 0.8em; margin: 0 0 3rem 2rem; } - #pagenav > * { white-space: nowrap; } + #pagenav strong, #pagenav a { white-space: nowrap; } #pagenav + h2, #pagenav + h3, #pagenav + h4 { margin-top: 0; } + + #pagenav-breadcrumb { font-weight: bold; } + #pagenav-breadcrumb em { font-weight: normal; } } } -- cgit v1.3.1-23-gd82d From e80e02cb52f4d7d67b257a5f72e7fbe28c5b74f9 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sat, 10 Aug 2024 15:31:25 +0300 Subject: feat!: Removed CSMA, made minor styling changes --- .gitmodules | 3 - awk-edits/Heading-anchors.awk | 2 +- csma | 1 - generate.sh | 14 +- src/_header.html | 34 +-- src/scripts/expand-navbar.js | 8 +- src/scripts/page-width.js | 4 +- src/styles.csma | 656 ------------------------------------------ src/styles.css | 498 ++++++++++++++++++++++++++++++++ 9 files changed, 524 insertions(+), 696 deletions(-) delete mode 160000 csma delete mode 100644 src/styles.csma create mode 100644 src/styles.css (limited to 'src/styles.csma') diff --git a/.gitmodules b/.gitmodules index b36ee4c..600c751 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ [submodule "csg"] path = csg url = https://gitlab.com/Syndamia/csg.git -[submodule "csma"] - path = csma - url = https://gitlab.com/Syndamia/csma.git diff --git a/awk-edits/Heading-anchors.awk b/awk-edits/Heading-anchors.awk index 10f4aa9..7d4edf8 100644 --- a/awk-edits/Heading-anchors.awk +++ b/awk-edits/Heading-anchors.awk @@ -12,5 +12,5 @@ gap = "
" ORS } match($0, /id="[^"]*"/) - $0 = gap $0 ORS "§" + $0 = gap $0 ORS "#" } diff --git a/csma b/csma deleted file mode 160000 index a00471f..0000000 --- a/csma +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a00471ff2e26fa5f1cb6be4d9ba3d3dbdff0a578 diff --git a/generate.sh b/generate.sh index 7240951..43023af 100755 --- a/generate.sh +++ b/generate.sh @@ -31,17 +31,7 @@ EOF /usr/bin/env dash ./csg/csg "$REPO_FOLDER/src" "$GEN_FOLDER" '& \\— Syndamia' 'https://syndamia.com' "$AWK_FOLDER" # }}} -# 2. CSMA to CSS {{{ - echo "[Stage 3] CSMA" - while read -r stylesheet - do - /usr/bin/env -S awk -f './csma/csmap.awk' "$stylesheet" > "${stylesheet:0: -4}css" - rm "$stylesheet" - done << EOF -$(find "$GEN_FOLDER" -type f -name "*.csma") -EOF -# }}} -# 3. Tiny version, strip away styles and other stuff {{{ +# 2. Tiny version, strip away styles and other stuff {{{ [ ! -d "$GEN_TINY_FOLDER" ] && mkdir "$GEN_TINY_FOLDER" [ $# -eq 0 -a "$(stat -c %U "$GEN_TINY_FOLDER")" != "www-data" ] && echo "[Warning] Running in \"production\" while $GEN_TINY_FOLDER isn't owned by www-data!" @@ -63,7 +53,7 @@ EOF done } - echo "[Stage 4] Tiny website" + echo "[Stage 3] Tiny website" if [ $# -eq 0 ]; then improveForTINY diff --git a/src/_header.html b/src/_header.html index 817318c..16c1d00 100644 --- a/src/_header.html +++ b/src/_header.html @@ -25,7 +25,7 @@