diff --git a/.gitignore b/.gitignore index 3aa864b..b225413 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ TODO.md +.envrc diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..261561a --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,24 @@ +before: + hooks: + # You may remove this if you don't use go modules. + - go mod download +builds: +- env: + - CGO_ENABLED=0 +archives: +- replacements: + darwin: Darwin + linux: Linux + windows: Windows + 386: i386 + amd64: x86_64 +checksum: + name_template: 'checksums.txt' +snapshot: + name_template: "{{ .Tag }}-next" +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:' diff --git a/Makefile b/Makefile index a92edde..7805858 100644 --- a/Makefile +++ b/Makefile @@ -1,2 +1,2 @@ build: - go build -o ~/bin/anki + go build -o ~/bin/anki-autogen diff --git a/README.md b/README.md new file mode 100644 index 0000000..80c0fb2 --- /dev/null +++ b/README.md @@ -0,0 +1,37 @@ +A command line tool to autogenerate Spanish-English Anki cards. Can be combined with an automation tool like Keyboard Maestro to quickly generate cards while reading Spanish content. + +### Build + +``` +go build +``` + +### Usage + +``` +Usage of anki-autogen: + -collectionsDir string + location of anki collections.media dir. (e.g. Users/username/Library/Application Support/Anki2/collection.media) + -numberDefns int + number of cards to create (default 1: will create a card for the top usage). + -outputFile string + csv output file name. import this file into anki. + -word string + the word to create card for. +``` + +### Example +generate card for word `carta` +``` +anki-autogen -word contar -outputFile cards.csv -collectionsDir "/MEDIA_DIR/collection.media" +``` + +results in `./cards.csv` (cards are appended to this file, so `anki-autogen` can be run repeatedly and all of the cards loaded via a single import) + +```.csv +Ya no se escriben tantas cartas como antes.,carta,"",[sound:carta1594235647047358000.mp3],letter, +``` + +After importing into Anki + +![Image of example card](examples/example.png) diff --git a/examples/example.apkg b/examples/example.apkg new file mode 100644 index 0000000..28e79f4 Binary files /dev/null and b/examples/example.apkg differ diff --git a/examples/example.png b/examples/example.png new file mode 100644 index 0000000..5483f88 Binary files /dev/null and b/examples/example.png differ