Skip to content

Commit

Permalink
Add README
Browse files Browse the repository at this point in the history
  • Loading branch information
mkrump committed Jul 9, 2020
1 parent 5a89b9f commit 98c0604
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
TODO.md
.envrc
24 changes: 24 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -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:'
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
build:
go build -o ~/bin/anki
go build -o ~/bin/anki-autogen
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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,"<img src=""carta1594235647385625000.jpg"">",[sound:carta1594235647047358000.mp3],letter,
```

After importing into Anki

![Image of example card](examples/example.png)
Binary file added examples/example.apkg
Binary file not shown.
Binary file added examples/example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 98c0604

Please sign in to comment.