From cb059c186fb13e80ae7b3c16749588d6772d7472 Mon Sep 17 00:00:00 2001 From: "Jakob L. Kreuze" Date: Wed, 26 Nov 2025 15:46:29 -0500 Subject: Template into single files --- .gitignore | 1 + Makefile | 17 +++++++++++ README.md | 5 ++++ deck-editor.html | 17 ----------- deck-editor.html.tpl | 21 +++++++++++++ srs-anywhere.html | 79 ------------------------------------------------ srs-anywhere.html.tpl | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 127 insertions(+), 96 deletions(-) create mode 100644 .gitignore create mode 100644 Makefile delete mode 100644 deck-editor.html create mode 100644 deck-editor.html.tpl delete mode 100644 srs-anywhere.html create mode 100644 srs-anywhere.html.tpl diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2d19fc7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.html diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a4b9412 --- /dev/null +++ b/Makefile @@ -0,0 +1,17 @@ +all: srs-anywhere.html deck-editor.html + +srs-anywhere.html: srs-anywhere.html.tpl style.css srs-anywhere.js + sed '/@@JS@@/r srs-anywhere.js' < srs-anywhere.html.tpl | \ + sed '/@@JS@@/d' | \ + sed '/@@CSS@@/r style.css' | \ + sed '/@@CSS@@/d' > srs-anywhere.html + +deck-editor.html: deck-editor.html.tpl style.css deck-editor.js + sed '/@@JS@@/r deck-editor.js' < deck-editor.html.tpl | \ + sed '/@@JS@@/d' | \ + sed '/@@CSS@@/r style.css' | \ + sed '/@@CSS@@/d' > deck-editor.html + +.PHONY: all clean +clean: + rm *.html diff --git a/README.md b/README.md index d048e0b..c6511f4 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,11 @@ SRS Anywhere is free software: you can redistribute it and/or modify it under th SRS Anywhere is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with SRS Anywhere. If not, see . +## Building + +Just run `make`. +The build process is very simple, it just tangles the CSS and JavaScript code into an HTML template using `sed`. + ## Usage Open `srs-anywhere.html` in a web browser and press the "Browse..." button in the top right-hand corner to load a deck of cards. diff --git a/deck-editor.html b/deck-editor.html deleted file mode 100644 index d4fca8a..0000000 --- a/deck-editor.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - SRS Anywhere Card Editor - - - -
- - -
-

SRS Anywhere Card Editor

-
- - - diff --git a/deck-editor.html.tpl b/deck-editor.html.tpl new file mode 100644 index 0000000..1f778d3 --- /dev/null +++ b/deck-editor.html.tpl @@ -0,0 +1,21 @@ + + + + + SRS Anywhere Card Editor + + + +
+ + +
+

SRS Anywhere Card Editor

+
+ + + diff --git a/srs-anywhere.html b/srs-anywhere.html deleted file mode 100644 index 879c6e8..0000000 --- a/srs-anywhere.html +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - SRS Anywhere - - - -
-
-
-
- -
-
- No cards loaded! -
-
- - -
- -
- -
- - - - -
- -
-
- - - - - - - diff --git a/srs-anywhere.html.tpl b/srs-anywhere.html.tpl new file mode 100644 index 0000000..cf3010f --- /dev/null +++ b/srs-anywhere.html.tpl @@ -0,0 +1,83 @@ + + + + + + SRS Anywhere + + + +
+
+
+
+ +
+
+ No cards loaded! +
+
+ + +
+ +
+ +
+ + + + +
+ +
+
+ + + + + + + -- cgit v1.3