commit 0a4659f7e6a2c5d7db19dbcc615fda12dfc1ce05 Author: adyrem Date: Tue May 19 14:58:24 2026 +0200 Initial commit: Anki flashcard creator web app Converts Japanese vocab (Kanji/Hiragana/English) to Anki CSV format. Served on port 4002 with a dark-themed two-panel UI. Co-Authored-By: Claude Sonnet 4.6 diff --git a/AnkiFCCreater.js b/AnkiFCCreater.js new file mode 100644 index 0000000..4b05b78 --- /dev/null +++ b/AnkiFCCreater.js @@ -0,0 +1,53 @@ +/* +takes in a string in the form of: +Kanji text +Hiragana +EN translation; alternative; alternative + +and converts it to: + +Kanji, Hiragana, EN translation; alternative; alternative +EN translation; alternative; alternative, Kanji, Hiragana +*/ + +var toExport = ""; + +function readyForImport(l1, l2, l3) +{ + var front = l1 + ",\"" + l2 + "\n" + l3 + "\""; + var back = l3 + ",\"" + l1 + "\n" + l2 +"\""; + + toExport += "\n" + front + "\n" + back; +} + +function splitIntoComponents(toSplit) +{ + var lines = toSplit.split("\n"); + + for (var i = 0; i + + + + + Anki Flashcard Creator + + + +
+

Anki Flashcard Creator

+

Convert Japanese vocabulary lists into Anki-ready CSV

+
+ +
+
+
+ Input + Kanji · Hiragana · English +
+ +
+ +
+
+ Output + 0 cards +
+ +
+
+ +
+ + + +
+ +
+ Input format — one entry per four lines (blank line between entries):
+ 漢字  →  kanji or word
+ ひらがな  →  reading (hiragana / romaji)
+ English; alt1; alt2  →  translation (semicolon-separated alternatives)
+ (blank line)

+ Output format — two CSV rows per entry (recognition card + production card) +
+ +
+ + + + diff --git a/server.js b/server.js new file mode 100644 index 0000000..4a81bc8 --- /dev/null +++ b/server.js @@ -0,0 +1,30 @@ +const http = require('http'); +const fs = require('fs'); +const path = require('path'); + +const PORT = 4002; +const ROOT = __dirname; + +const mime = { + '.html': 'text/html', + '.css': 'text/css', + '.js': 'text/javascript', +}; + +http.createServer((req, res) => { + const urlPath = req.url === '/' ? '/index.html' : req.url; + const file = path.join(ROOT, urlPath); + + fs.readFile(file, (err, data) => { + if (err) { + res.writeHead(404); + res.end('Not found'); + return; + } + const ext = path.extname(file); + res.writeHead(200, { 'Content-Type': mime[ext] || 'text/plain' }); + res.end(data); + }); +}).listen(PORT, () => { + console.log(`Anki FC Creator running at http://localhost:${PORT}`); +});