Anki-Import
    
    
  
  
  
view release on metacpan or search on metacpan
lib/Anki/Import.pm view on Meta::CPAN
    my $count = 0;
    foreach my $part (@$parts) {
      $count++;
      next if ($count % 2);  # only substitute on odd number array items
      $part =~ s/</</g;
    }
    $field = join '`', @$parts;
    # backticked characters
    $field =~ s/(?<!\\)`(.*?)`/<span style="font-family: courier; weight: bold;">$1<\/span>/gm;
    $field =~ s/\\`/`/g;
    # bold
    $field =~ s/(?<!\\)\*(.*?)\*/<span style="weight: bold;">$1<\/span>/gm;
    $field =~ s/\\\*/*/g;
    # unordered lists
    $field =~ s'(?<!\\)%(.*?)%'"<ul><li>" . join ("</li><li>", (split (/,\s*/, $1))) . "</li><\/ul>"'gme;
    $field =~ s/\\%/%/g;
    $field =~ s/(<br>)+$//;
    push @fields, $field;
  }
lib/Anki/Import.pm view on Meta::CPAN
Note: If you use tags on any of your notes in a parcitular note type, you must
use tags on all of your notes or indicate that the tag field should be left
blank with a '`' (backtick) character on a line by itself.
=head3 Applying text formatting to your notes
Learning how to format the source file is key to getting Anki to import your
notes properly and getting the most out of C<Anki::Import>.
Following a few simple rules, you can assign notes to a note type, preserve
whitespace in fields, create bold text, create blank lines in your fields,
add tags, create cloze deletions, indicate which fields are blank and
generate simple lists. Study the example below for details.
Note: Lines containing only whitespace characters are treated as blank lines.
=head4 Example source file
Below is an example of how to format a source data file. Note that the column on
the right containing comments for this example are not permitted in an actual
source data file.
lib/Anki/Import.pm view on Meta::CPAN
    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
t/data/cs61.anki view on Meta::CPAN
```
The first line evaluates the word "hello," the function that was defined. It
does not evaluate to "5" because `define` does not evaluate its arguments. The
second line evaluates to 5, the result of the expression, 2 + 3.
`
#cquest
What is the code in bold referred to as?
```
(define (square <b>x</b>)
    (* x x)
(square (+ 2 3))
```
the formal parameter, the argument that is passed to the function
`
#cquest
What is the code in bold referred to as?
```
(define (square x)
    <b>(* x x)</b>
(square (+ 2 3))
```
the body
`
#cquest
What is the code in bold referred to as?
```
(define (square x)
    <b>(* x x)</b>
(square <b>(+ 2 3)</b>)
```
the argument expression
`
( run in 0.807 second using v1.01-cache-2.11-cpan-5dc5da66d9d )