aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-12-28 13:51:16 +0100
committerlonkaars <loek@pipeframe.xyz>2022-12-28 13:51:16 +0100
commit8f75fa200e1042f09f0fe3c4805f5600e3567f54 (patch)
tree8a88264e7bd04ef493d6ce8a481c899b22408d90
parentec000fcbb7e721bfd2638427d54f56f2dae76316 (diff)
makefile shuffle + WIP yomichan sentence export patch
-rw-r--r--.gitignore1
-rw-r--r--anki-card-temlate/.gitignore1
-rw-r--r--anki-card-temlate/makefile14
-rw-r--r--common.mk8
-rw-r--r--yomichan/.gitignore4
-rw-r--r--yomichan/custom.css2
-rw-r--r--yomichan/makefile30
-rw-r--r--yomichan/readme.md4
-rw-r--r--yomichan/sentence-export.js7
9 files changed, 59 insertions, 12 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..e6090ab
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+**/*.min.*
diff --git a/anki-card-temlate/.gitignore b/anki-card-temlate/.gitignore
index 7bfb9f9..e49c5f5 100644
--- a/anki-card-temlate/.gitignore
+++ b/anki-card-temlate/.gitignore
@@ -1,2 +1 @@
*-template.html
-*.min.*
diff --git a/anki-card-temlate/makefile b/anki-card-temlate/makefile
index 8b715d3..deb4c29 100644
--- a/anki-card-temlate/makefile
+++ b/anki-card-temlate/makefile
@@ -1,18 +1,12 @@
all: back-template.html front-template.html
-.PRECIOUS: card.min.js
+.PRECIOUS: card.min.js card.min.css
+.PHONY: clean
-card.min.js: card.js
- sed 's/\/\/.*$$//g' $< | tr '\n' ' ' | sed 's/\t//g' | sed 's/ */ /g' > $@
-
-card.min.css: card.css
- cat $< | tr '\n' ' ' | sed 's/\t//g' | sed 's/ */ /g' > $@
-
-%.html: %.m4
- m4 $< > $@
+include ../common.mk
back-template.html: card.min.js card.min.css
front-template.html: card.min.js card.min.css
clean:
- $(RM) back-template.html front-template.html card.min.js
+ $(RM) back-template.html front-template.html card.min.js card.min.css
diff --git a/common.mk b/common.mk
new file mode 100644
index 0000000..5944b64
--- /dev/null
+++ b/common.mk
@@ -0,0 +1,8 @@
+%.min.js: %.js
+ sed 's/\/\/.*$$//g' $< | tr '\n' ' ' | sed 's/\t//g' | sed 's/ */ /g' > $@
+
+%.min.css: %.css
+ cat $< | tr '\n' ' ' | sed 's/\t//g' | sed 's/ */ /g' > $@
+
+%.html: %.m4
+ m4 $< > $@
diff --git a/yomichan/.gitignore b/yomichan/.gitignore
new file mode 100644
index 0000000..c692a18
--- /dev/null
+++ b/yomichan/.gitignore
@@ -0,0 +1,4 @@
+*.src
+yomichan-settings-*.json
+yomichan
+yomichan-chrome.zip
diff --git a/yomichan/custom.css b/yomichan/custom.css
index 6c132ab..0458a3b 100644
--- a/yomichan/custom.css
+++ b/yomichan/custom.css
@@ -6,7 +6,7 @@
border: 2px solid var(--tag-color);
border-radius: 6px;
}
-.frequency-group-tag { border: none !important; }
+.frequency-group-tag .tag { border: none !important; }
.tag .tag-body::before { display: none; }
.frequency-value {
color: var(--tag-color);
diff --git a/yomichan/makefile b/yomichan/makefile
new file mode 100644
index 0000000..a4f19df
--- /dev/null
+++ b/yomichan/makefile
@@ -0,0 +1,30 @@
+all:
+
+.PHONY: clean patch update
+
+include ../common.mk
+
+yomichan/js/user.js: sentence-export.min.js yomichan
+ ln -sf ../../$< $@
+
+yomichan-chrome.zip:
+ curl https://github.com/FooSoft/yomichan/releases/latest/download/$@ -Lso- > $@
+
+yomichan: yomichan-chrome.zip
+ unzip -qo yomichan-chrome.zip -d yomichan
+
+yomichan/manifest.json.bak: yomichan/manifest.json
+ mv $< $@
+ jq '.content_scripts[0].js[.content_scripts[0].js | length] |= .+ "js/user.js"' $@ > $<
+
+yomichan/search.html.bak: yomichan/search.html
+ mv $< $@
+ sed 's#</body>#<script defer src="/js/user.js"></script>\n</body>#' $@ > $<
+
+patch: yomichan yomichan/search.html.bak yomichan/manifest.json.bak
+
+update: yomichan
+
+clean:
+ $(RM) sentence-export.min.js sentence-export.src
+
diff --git a/yomichan/readme.md b/yomichan/readme.md
new file mode 100644
index 0000000..5459c21
--- /dev/null
+++ b/yomichan/readme.md
@@ -0,0 +1,4 @@
+# yomichan stuff
+
+- [custom css](custom.css)
+- and a userscript injection makefile (WIP)
diff --git a/yomichan/sentence-export.js b/yomichan/sentence-export.js
new file mode 100644
index 0000000..c01e985
--- /dev/null
+++ b/yomichan/sentence-export.js
@@ -0,0 +1,7 @@
+function run() {
+ console.log("it workey");
+}
+
+run();
+window.onload = () => run();
+