ANKIDOC(1)

NAME
ankidoc - convert asciidoc notes to anki notes

SYNOPSIS
ankidoc -h, --help
ankidoc -v, --version
ankidoc [ -d | -l | -n ] [-a ATTR] [-D DECK] [-L LV] [-N TYPE] [-o OUT] files

DESCRIPTION
ankidoc is a short python script intended to make writing anki notes in asciidoc easier. It can be used to generate a text file for import into anki from notes written in asciidoc.

The asciidoc notes need to be in a specific format in order for the script to be able to work with them; The idea is that each note — or at least each of the notes the user wants to have in one deck — is assigned a unique ID. It is then split into two asciidoc files, one with the content of the front side of the note, and one of the back side. These two files must now be saved as ID.front and ID.back, ID being the unique note ID that was assigned to the note.

Then the list of .front files desired to be in the final import file can be passed to ankidoc. The script will then find the corresponding .back files (which have to be in the same directory), convert all files to HTML using the asciidoctor(1) utility and output a properly formatted anki import file named out. The name and location of the output file can be adjusted using the -o option.

  MODES
Besides the default mode described above, ankidoc supports additional modes that work slightly differently.

Notegen mode
    In notegen mode — selected by specifying the -n option — ankidoc will only take in one single front file, find its corresponding back file, convert both sides and output a "note" file, which essentially corresponds to a single note how it would appear in the final import file generated in default mode. These note files can then be linked into an anki import file using the link mode.

Link mode
    In link mode — selected by specifying the -l option — ankidoc will treat the input files as "note" files and link them into an anki import file.

Docgen mode
    In docgen mode — selected by specifying the -d option — ankidoc will, instead of generating a import file, generate a HTML document out of the notes. This mode can, for example, be used to preview the notes before importing them into anki.

OPTIONS

-a, --attributes ATTR
    Specify any asciidoc(tor) attributes. Whatever string is specified here will be passed on as-is to the -a argument of the asciidoctor(1) command.

-d, --docgen
    Run ankidoc in docgen mode.

-D, --deck DECK
    Specify a deck name, which will be set as default deck in the import file.

-l, --link
    Run ankidoc in link mode.

-L, --loglevel LV
    Select a logging level from "DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL".

-n, --notegen
    Run ankidoc in notegen mode.

-N, --notetype TYPE
    Specify a note type, which will be set as default note type in the import file.

-o, --output OUT
    Specify the desired output filename.

-v, --version
    Display version information.

files
    Specify the files to operate on. Note that these generally have to be .front files with existing corresponding .back files in oder for ankidoc to work. This is except when operating in link mode, in which case this option has to be one single .note file.

EXIT STATUS

0   Success.

1   Failure.

NOTES
For ankidoc to work you'll have to have asciidoctor(1) installed, as this is the program ankidoc uses to convert the asciidoc to HTML.

SEE ALSO
asciidoctor(1)

https://asciidoctor.org