
FILE FORMAT

This program understands three kinds of files, which will be introduced as 
"simple", "record", and "granule", respectively.

When cardflasher tries to load a deck, it does it by some trial and error so
that you can use any of the formats.  It will try to load it as "simple", then
"record", then "granule".

SIMPLE FILE FORMAT

The simple file format looks like this (the "-----" is just for visual effect,
not part of the file:

------------------------------------------------------
Who's on first?  
That's who 

Who was the first president of the US?
George Washington
------------------------------------------------------

Etc.  Any number of blank lines separates the groups of nonblank lines, each
representing a flashcard.

This is probably the easiest format to use.  If you have groups of three or
more lines of text together, the first will be the front of the card, and
the rest will be on the back.  If you need more than one line on the front,
you may either (1) write your deck in reverse and use the --flip option or (2)
use the "record" file format.

RECORD FILE FORMAT

The record file format is the format which cardflasher uses to store its 
internal data.  This need only be used for very complex data.

-------------------------
Who's on first?  
%% 
That's who 
%%
level: 1
expires: 10/4/2004
%%%%

Who was the first president of the US?
%%
George Washington
%%%%
-------------------------

As you can see, the string of four '%' characters separates cards, and the 
pieces of a card are separated with two %%.  If you really need to put a bunch
of % in your card, send me an email and I'll think about adding some more
complex string handling.

The third field contains a series of name:value pairs, which can be anything.
This section is not used, except by cardflasher for its internal storage of
your "level" for a card.  Everything else is ignored, and the "level" is only
used when loading saved data, NOT when reading a user deck.

GRANULE FILE FORMAT

You can also use granule deck files (since this is the program I used, but 
eventually tired of the C++ caused bugs, and needed a remoteable solution).
Here is what they look like, though you probably input them in granule. I've
omitted the noise that my program doesn't care about - this is the part that
matters.

<deck>
	<card>
		<front>Who's on first?</front>
		<back>That's who</back>
	</card>
	<card>
		<front>Who was the first president</front>
		<back>George Washinton</back>
	</card>
	<!-- more cards ... -->
</deck>

Files with the suffix .dkf will be assumed to be granule files, and the normal
trial-and-error choice of what format your file is will be skipped.

SAVED DATA

Each front/back pair is recorded, along with your level of mastery, in the
directory ~/.cardflasher/data in the record file format.  This is just another
deck file, but it is used for gathering statistics.


TODO: add "notebook" when you have n sides instead of 2 sides
