Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: d8292d16d3
Fetching contributors…

Cannot retrieve contributors at this time

73 lines (51 sloc) 4.459 kb

Honden: A Flashcard System Built on Oboeta

This is a collection of scripts built on top of Oboeta, my minimalistic flashcard system. All cards are stored as plain UTF-8 text in flat files: associated media files are stored in subdirectories.

Installing

Open a terminal, navigate to the directory containing Honden's source code, and execute the install.sh script, passing the directory where you want to install the scripts as the first parameter. For example,

$ ./install.sh ~/flashcards

will copy the scripts to ~/flashcards. You might have to change users (e.g., run sudo) depending on which installation directory you select.

Creating a Deck

Most Honden scripts use information stored within a configuration file named config.txt, which is nothing more than a Bourne shell script that sets environment variables. Most of the values are easy to understand.

To create config.txt, create a new directory, navigate to it, and run honden. This will also create the directory hierarchy described in the next section. NOTE: honden will overwrite config.txt if it already exists but it won't overwrite the directories.

The scripts assume that the deck and log files are formatted according to Oboeta's guidelines. The default deck settings assume that each card has four fields: the card's unique integral ID, the card's creation date, the front, and the back. You can specify different filters in config.txt if your card format is different.

The Directory Hierarchy

Assuming . contains config.txt, the directory hierarchy looks like this:

./
  backups/
    This directory contains backup archives created by
    backupall and backupcards.  These are bzipped
    TARs (.tar.bz2).
  media/
    recordings/
      flashcards/
        This directory contains recordings of flashcards.
        Each recording's name is the integral ID of the
        associated flashcard followed by the .wav
        extension.  If there are multiple recordings for
        a single flashcard, then the first one is named
        as just mentioned, whereas subsequent recordings'
        names are the flashcard's unique ID followed by
        ".N", where N is the recording's zero-based index,
        and the .wav extension.
    sds/
      This directory contains Chinese character stroke
      order diagrams.  Each file's name is the character
      that the file describes followed by an image extension.
      Right now, all of my diagrams are PNGs.
  other/
    This directory contains miscellaneous data.  Honden
    ignores it.

The Scripts

Most of the scripts use the Bourne shell (sh), gawk, date, sort, and uniq utilities. All of them should be easy to understand: Open them with your favorite text editor to check them out. Here's a high-level overview of the most important ones:

  • backupall and backupcards back up all files or just cards, respectively, to the backups directory.
  • edeck edits the deck with your favorite text editor.
  • seedeck views the deck with your favorite viewer.
  • nextid scans the decks and its log file for the next unique integral flashcard ID.
  • genline is a handy script that appends new cards generated from its parameters to the deck. It automatically generates the cards' unique IDs.
  • review uses SM-2 to select flashcards from the deck and sets up a local HTTP server on port 1337 to review them.
  • defaultfilter is the filter that config.txt specifies by default to transform oboeta's output into something that oboetahttp can consume. (review uses this.)

License

All of the files in this collection have been dedicated to the public domain via the Creative Commons CC0 Public Domain Dedication in the hope that they would be circulated widely and without restriction. I won't make any money from this code and I feel that it's more important that other people are free to use, modify, and distribute it as they please, with or without charge, even if I could make money from this. Simply put, I like contributing to a healthy public domain. See the file COPYING for a complete copy of the public domain dedication.

Authors

I wrote these scripts by myself primarily for myself, but I hope that others will find them useful.

-- Joodan Van (伴上段), 2012年11月22日

Jump to Line
Something went wrong with that request. Please try again.