Anki-Import

 view release on metacpan or  search on metacpan

lib/Anki/Import.pm  view on Meta::CPAN

                                         # all future notes unless overridden.


    Put {{{another question}}} here.     # Surround text with 3 braces for a cloze

    Here is an field that has
    `                                    # Insert a blank line into a field
    a blank line in it.                  # with a single backtick character
                                         # surrounded by lines with text.
    go_here                              # We set autotags in the last note and
                                         # they will carry forward to this note
                                         # except for the exclusions we place
                                         # here. This note will *not* be tagged
                                         # with 'go_here' but it will still be
                                         # tagged under 'your_tags'.



    What does this code do?              # Another less_basic question

    ```                                  # Preserve whitespace in a field with 3
    This_is_some_code {                  # backticks on a single line.
    `                                    # You must still backtick blank lines
        print 'Whitespace will be        # when preserving whitespace, however.
               preserved';
    `                                    # Another blank line.
    }
    ```                                  # End whitespace preservation

    This is %comma,delimted,text%        # Bullet lists with %item1,item2,item3%

    '                                    # The tags field is left blank. But all
                                         # the auto tags will still be applied.


    Another question                     # Field 1

    `                                    # Field 2 is blank.

    This is *in bold*                    # Field 3 has bold words, followed by a
    `                                    # blank line, followed by
    %an,unordered,list%                  # an ordered list.

    new_tags more_new_tags               # This and future notes will use these
    ^                                    # newer automated tags.


    #basic                               # switch back to a 'basic' note type
    Last question

    Last anser

    add_this_tag_to_autotags             # We add a new_tag to our autotag list
    +                                    # with the '+' sign by itself on a new
                                         # line.

=head3 Getting the most from C<Anki::Import>

By itself, C<Anki::Import> will make it easier for you to format and
input your notes especially if you do a lot of basic HTML formatting. However,
the huge productivity gains of C<Anki::Import> can only be unlocked by getting
proficient wih your text editor of choice.

For example, you can generate templates for each of the note types you use to
make data entry exceptionally painless. And with a text editor like vim, you
can automate the generation of the formatting codes used by C<Anki::Import>
and make Anki note creation joyful, or at least much less tedious.

Teaching you how to use and optimize your text editor for C<Anki::Import> is
well beyond the scope of this document. But if you take the time now and do the
up front work of learning your text editor and tweaking it for use with
C<Anki::Import>, you will save a lot of time in the long run.

In the future, vim configurations and plugins for use with C<Anki::Import>
may be released as they are developed to help you get going faster with vim.
Unfortunately, other text editors cannot be supported as there are far too many
and far too little time to get familiar with all their features.

=head1 USAGE

C<anki_import> can be run from the command line or from within another perl
script. It behaves the same way in both environments.

=head2 Command line usage

The C<Anki::Import> module installs the C<anki_import> command line command
for generating import files which is used as follow:

    anki_import source_file [parent_dir] [--verbosity_level]

    B<Example:> anki_import pop_quiz.txt /home/me --verbose

C<anki_import> processes the C<source_file> and generates files to be imported into
Anki, one file for each note type. These files are placed in a directory called
C<anki_import_files>. This directory is placed in the current working directory
by default.

Note that previously generated files already located in the C<anki_import_files>
directory the command is outputting to will will be overwritten without warning.
Add a unique (C<parent_dir> path to help prevent this.

B<C<parent_dir>> is an optional argument containing the path you want C<Anki::Import>
to save the files for output. You may use a C<~> (tilde) to represent the home
directory for the current user.

B<C<$verbosity>> options can be set to C<--verbose> or C<--vverbose>
(very verbose) or C<--quiet>. The verbosity options have aliases for your
typing convenience: C<-v>, C<-V> and C<-q>, respectively.

Use the C<--verbose> or C<--vverbose> option to help troubleshoot source file
processing issues. The (C<--quiet>) option suppresses the success
message printed upon successful processing of the source file.

=head2 From a script

Invoking the C<anki_import> function mirrors the arguments used from the
command line:

=head2 anki_import($source_file, [$parent_dir], [$verbosity]);

Usage in a script is the same as for the command line except that the arguments



( run in 1.282 second using v1.01-cache-2.11-cpan-df04353d9ac )