From 8f75fa200e1042f09f0fe3c4805f5600e3567f54 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Wed, 28 Dec 2022 13:51:16 +0100 Subject: makefile shuffle + WIP yomichan sentence export patch --- .gitignore | 1 + anki-card-temlate/.gitignore | 1 - anki-card-temlate/makefile | 14 ++++---------- common.mk | 8 ++++++++ yomichan/.gitignore | 4 ++++ yomichan/custom.css | 2 +- yomichan/makefile | 30 ++++++++++++++++++++++++++++++ yomichan/readme.md | 4 ++++ yomichan/sentence-export.js | 7 +++++++ 9 files changed, 59 insertions(+), 12 deletions(-) create mode 100644 .gitignore create mode 100644 common.mk create mode 100644 yomichan/.gitignore create mode 100644 yomichan/makefile create mode 100644 yomichan/readme.md create mode 100644 yomichan/sentence-export.js 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##\n#' $@ > $< + +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(); + -- cgit v1.2.3