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; Every note needs to be a directory with its name ending in .anote. The name of this directory (excluding the extension), will become the ID of the note in the final import file.

For everything to work correctly, this directory must contain three files:

front.adoc
    An asciidoc file containing everything that should be on the front side of the note.

back.adoc
    An asciidoc file containing everything that should be on the back side of the note.

tags.txt
    A text file containing space-separated tags for the note. This file is optional, but its absence will throw a warning.

In its default operating mode, ankidoc will take a list of such anote directories as input and generate a single anki import file out of them.

  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 anote directory 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
    Similarly to the notegen mode, when running in docgen mode, ankidoc will only take in a single anote directory, but instead of producing HTML formatted as a note file, it produces an asciidoc document.

Preview mode
    Similarly to the docgen mode, when running in preview mode, ankidoc will only take in a single anote directory, but instead of producing an asciidoc document, it will produce a HTML file that can be opened using a browser to preview the note.

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.

-f, --front-matter
    When running in docgen mode, add front matter in TOML to the output, for use in static site generators like HUGO or 11ty.

-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 one ore multiple .anote directories in oder for ankidoc to work. When operating in link mode, however, these files have to be .note files.

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