Background: #fff
Foreground: #000
PrimaryPale: #8cf
PrimaryLight: #18f
PrimaryMid: #04b
PrimaryDark: #014
SecondaryPale: #ffc
SecondaryLight: #fe8
SecondaryMid: #db4
SecondaryDark: #841
TertiaryPale: #eee
TertiaryLight: #ccc
TertiaryMid: #999
TertiaryDark: #666
Error: #f88
/*{{{*/
body {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}

a {color:[[ColorPalette::PrimaryMid]];}
a:hover {background-color:[[ColorPalette::PrimaryMid]]; color:[[ColorPalette::Background]];}
a img {border:0;}

h1,h2,h3,h4,h5,h6 {color:[[ColorPalette::SecondaryDark]]; background:transparent;}
h1 {border-bottom:2px solid [[ColorPalette::TertiaryLight]];}
h2,h3 {border-bottom:1px solid [[ColorPalette::TertiaryLight]];}

.button {color:[[ColorPalette::PrimaryDark]]; border:1px solid [[ColorPalette::Background]];}
.button:hover {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::SecondaryLight]]; border-color:[[ColorPalette::SecondaryMid]];}
.button:active {color:[[ColorPalette::Background]]; background:[[ColorPalette::SecondaryMid]]; border:1px solid [[ColorPalette::SecondaryDark]];}

.header {background:[[ColorPalette::PrimaryMid]];}
.headerShadow {color:[[ColorPalette::Foreground]];}
.headerShadow a {font-weight:normal; color:[[ColorPalette::Foreground]];}
.headerForeground {color:[[ColorPalette::Background]];}
.headerForeground a {font-weight:normal; color:[[ColorPalette::PrimaryPale]];}

.tabSelected{color:[[ColorPalette::PrimaryDark]];
	background:[[ColorPalette::TertiaryPale]];
	border-left:1px solid [[ColorPalette::TertiaryLight]];
	border-top:1px solid [[ColorPalette::TertiaryLight]];
	border-right:1px solid [[ColorPalette::TertiaryLight]];
}
.tabUnselected {color:[[ColorPalette::Background]]; background:[[ColorPalette::TertiaryMid]];}
.tabContents {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::TertiaryPale]]; border:1px solid [[ColorPalette::TertiaryLight]];}
.tabContents .button {border:0;}

#sidebar {}
#sidebarOptions input {border:1px solid [[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel {background:[[ColorPalette::PrimaryPale]];}
#sidebarOptions .sliderPanel a {border:none;color:[[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel a:hover {color:[[ColorPalette::Background]]; background:[[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel a:active {color:[[ColorPalette::PrimaryMid]]; background:[[ColorPalette::Background]];}

.wizard {background:[[ColorPalette::PrimaryPale]]; border:1px solid [[ColorPalette::PrimaryMid]];}
.wizard h1 {color:[[ColorPalette::PrimaryDark]]; border:none;}
.wizard h2 {color:[[ColorPalette::Foreground]]; border:none;}
.wizardStep {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];
	border:1px solid [[ColorPalette::PrimaryMid]];}
.wizardStep.wizardStepDone {background:[[ColorPalette::TertiaryLight]];}
.wizardFooter {background:[[ColorPalette::PrimaryPale]];}
.wizardFooter .status {background:[[ColorPalette::PrimaryDark]]; color:[[ColorPalette::Background]];}
.wizard .button {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::SecondaryLight]]; border: 1px solid;
	border-color:[[ColorPalette::SecondaryPale]] [[ColorPalette::SecondaryDark]] [[ColorPalette::SecondaryDark]] [[ColorPalette::SecondaryPale]];}
.wizard .button:hover {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::Background]];}
.wizard .button:active {color:[[ColorPalette::Background]]; background:[[ColorPalette::Foreground]]; border: 1px solid;
	border-color:[[ColorPalette::PrimaryDark]] [[ColorPalette::PrimaryPale]] [[ColorPalette::PrimaryPale]] [[ColorPalette::PrimaryDark]];}

#messageArea {border:1px solid [[ColorPalette::SecondaryMid]]; background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]];}
#messageArea .button {color:[[ColorPalette::PrimaryMid]]; background:[[ColorPalette::SecondaryPale]]; border:none;}

.popupTiddler {background:[[ColorPalette::TertiaryPale]]; border:2px solid [[ColorPalette::TertiaryMid]];}

.popup {background:[[ColorPalette::TertiaryPale]]; color:[[ColorPalette::TertiaryDark]]; border-left:1px solid [[ColorPalette::TertiaryMid]]; border-top:1px solid [[ColorPalette::TertiaryMid]]; border-right:2px solid [[ColorPalette::TertiaryDark]]; border-bottom:2px solid [[ColorPalette::TertiaryDark]];}
.popup hr {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::PrimaryDark]]; border-bottom:1px;}
.popup li.disabled {color:[[ColorPalette::TertiaryMid]];}
.popup li a, .popup li a:visited {color:[[ColorPalette::Foreground]]; border: none;}
.popup li a:hover {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; border: none;}
.popup li a:active {background:[[ColorPalette::SecondaryPale]]; color:[[ColorPalette::Foreground]]; border: none;}
.popupHighlight {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}
.listBreak div {border-bottom:1px solid [[ColorPalette::TertiaryDark]];}

.tiddler .defaultCommand {font-weight:bold;}

.shadow .title {color:[[ColorPalette::TertiaryDark]];}

.title {color:[[ColorPalette::SecondaryDark]];}
.subtitle {color:[[ColorPalette::TertiaryDark]];}

.toolbar {color:[[ColorPalette::PrimaryMid]];}
.toolbar a {color:[[ColorPalette::TertiaryLight]];}
.selected .toolbar a {color:[[ColorPalette::TertiaryMid]];}
.selected .toolbar a:hover {color:[[ColorPalette::Foreground]];}

.tagging, .tagged {border:1px solid [[ColorPalette::TertiaryPale]]; background-color:[[ColorPalette::TertiaryPale]];}
.selected .tagging, .selected .tagged {background-color:[[ColorPalette::TertiaryLight]]; border:1px solid [[ColorPalette::TertiaryMid]];}
.tagging .listTitle, .tagged .listTitle {color:[[ColorPalette::PrimaryDark]];}
.tagging .button, .tagged .button {border:none;}

.footer {color:[[ColorPalette::TertiaryLight]];}
.selected .footer {color:[[ColorPalette::TertiaryMid]];}

.sparkline {background:[[ColorPalette::PrimaryPale]]; border:0;}
.sparktick {background:[[ColorPalette::PrimaryDark]];}

.error, .errorButton {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::Error]];}
.warning {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::SecondaryPale]];}
.lowlight {background:[[ColorPalette::TertiaryLight]];}

.zoomer {background:none; color:[[ColorPalette::TertiaryMid]]; border:3px solid [[ColorPalette::TertiaryMid]];}

.imageLink, #displayArea .imageLink {background:transparent;}

.annotation {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; border:2px solid [[ColorPalette::SecondaryMid]];}

.viewer .listTitle {list-style-type:none; margin-left:-2em;}
.viewer .button {border:1px solid [[ColorPalette::SecondaryMid]];}
.viewer blockquote {border-left:3px solid [[ColorPalette::TertiaryDark]];}

.viewer table, table.twtable {border:2px solid [[ColorPalette::TertiaryDark]];}
.viewer th, .viewer thead td, .twtable th, .twtable thead td {background:[[ColorPalette::SecondaryMid]]; border:1px solid [[ColorPalette::TertiaryDark]]; color:[[ColorPalette::Background]];}
.viewer td, .viewer tr, .twtable td, .twtable tr {border:1px solid [[ColorPalette::TertiaryDark]];}

.viewer pre {border:1px solid [[ColorPalette::SecondaryLight]]; background:[[ColorPalette::SecondaryPale]];}
.viewer code {color:[[ColorPalette::SecondaryDark]];}
.viewer hr {border:0; border-top:dashed 1px [[ColorPalette::TertiaryDark]]; color:[[ColorPalette::TertiaryDark]];}

.highlight, .marked {background:[[ColorPalette::SecondaryLight]];}

.editor input {border:1px solid [[ColorPalette::PrimaryMid]];}
.editor textarea {border:1px solid [[ColorPalette::PrimaryMid]]; width:100%;}
.editorFooter {color:[[ColorPalette::TertiaryMid]];}

#backstageArea {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::TertiaryMid]];}
#backstageArea a {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::Background]]; border:none;}
#backstageArea a:hover {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; }
#backstageArea a.backstageSelTab {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}
#backstageButton a {background:none; color:[[ColorPalette::Background]]; border:none;}
#backstageButton a:hover {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::Background]]; border:none;}
#backstagePanel {background:[[ColorPalette::Background]]; border-color: [[ColorPalette::Background]] [[ColorPalette::TertiaryDark]] [[ColorPalette::TertiaryDark]] [[ColorPalette::TertiaryDark]];}
.backstagePanelFooter .button {border:none; color:[[ColorPalette::Background]];}
.backstagePanelFooter .button:hover {color:[[ColorPalette::Foreground]];}
#backstageCloak {background:[[ColorPalette::Foreground]]; opacity:0.6; filter:'alpha(opacity:60)';}
/*}}}*/
/*{{{*/
* html .tiddler {height:1%;}

body {font-size:.75em; font-family:arial,helvetica; margin:0; padding:0;}

h1,h2,h3,h4,h5,h6 {font-weight:bold; text-decoration:none;}
h1,h2,h3 {padding-bottom:1px; margin-top:1.2em;margin-bottom:0.3em;}
h4,h5,h6 {margin-top:1em;}
h1 {font-size:1.35em;}
h2 {font-size:1.25em;}
h3 {font-size:1.1em;}
h4 {font-size:1em;}
h5 {font-size:.9em;}

hr {height:1px;}

a {text-decoration:none;}

dt {font-weight:bold;}

ol {list-style-type:decimal;}
ol ol {list-style-type:lower-alpha;}
ol ol ol {list-style-type:lower-roman;}
ol ol ol ol {list-style-type:decimal;}
ol ol ol ol ol {list-style-type:lower-alpha;}
ol ol ol ol ol ol {list-style-type:lower-roman;}
ol ol ol ol ol ol ol {list-style-type:decimal;}

.txtOptionInput {width:11em;}

#contentWrapper .chkOptionInput {border:0;}

.externalLink {text-decoration:underline;}

.indent {margin-left:3em;}
.outdent {margin-left:3em; text-indent:-3em;}
code.escaped {white-space:nowrap;}

.tiddlyLinkExisting {font-weight:bold;}
.tiddlyLinkNonExisting {font-style:italic;}

/* the 'a' is required for IE, otherwise it renders the whole tiddler in bold */
a.tiddlyLinkNonExisting.shadow {font-weight:bold;}

#mainMenu .tiddlyLinkExisting,
	#mainMenu .tiddlyLinkNonExisting,
	#sidebarTabs .tiddlyLinkNonExisting {font-weight:normal; font-style:normal;}
#sidebarTabs .tiddlyLinkExisting {font-weight:bold; font-style:normal;}

.header {position:relative;}
.header a:hover {background:transparent;}
.headerShadow {position:relative; padding:4.5em 0em 1em 1em; left:-1px; top:-1px;}
.headerForeground {position:absolute; padding:4.5em 0em 1em 1em; left:0px; top:0px;}

.siteTitle {font-size:3em;}
.siteSubtitle {font-size:1.2em;}

#mainMenu {position:absolute; left:0; width:10em; text-align:right; line-height:1.6em; padding:1.5em 0.5em 0.5em 0.5em; font-size:1.1em;}

#sidebar {position:absolute; right:3px; width:16em; font-size:.9em;}
#sidebarOptions {padding-top:0.3em;}
#sidebarOptions a {margin:0em 0.2em; padding:0.2em 0.3em; display:block;}
#sidebarOptions input {margin:0.4em 0.5em;}
#sidebarOptions .sliderPanel {margin-left:1em; padding:0.5em; font-size:.85em;}
#sidebarOptions .sliderPanel a {font-weight:bold; display:inline; padding:0;}
#sidebarOptions .sliderPanel input {margin:0 0 .3em 0;}
#sidebarTabs .tabContents {width:15em; overflow:hidden;}

.wizard {padding:0.1em 1em 0em 2em;}
.wizard h1 {font-size:2em; font-weight:bold; background:none; padding:0em 0em 0em 0em; margin:0.4em 0em 0.2em 0em;}
.wizard h2 {font-size:1.2em; font-weight:bold; background:none; padding:0em 0em 0em 0em; margin:0.4em 0em 0.2em 0em;}
.wizardStep {padding:1em 1em 1em 1em;}
.wizard .button {margin:0.5em 0em 0em 0em; font-size:1.2em;}
.wizardFooter {padding:0.8em 0.4em 0.8em 0em;}
.wizardFooter .status {padding:0em 0.4em 0em 0.4em; margin-left:1em;}
.wizard .button {padding:0.1em 0.2em 0.1em 0.2em;}

#messageArea {position:fixed; top:2em; right:0em; margin:0.5em; padding:0.5em; z-index:2000; _position:absolute;}
.messageToolbar {display:block; text-align:right; padding:0.2em 0.2em 0.2em 0.2em;}
#messageArea a {text-decoration:underline;}

.tiddlerPopupButton {padding:0.2em 0.2em 0.2em 0.2em;}
.popupTiddler {position: absolute; z-index:300; padding:1em 1em 1em 1em; margin:0;}

.popup {position:absolute; z-index:300; font-size:.9em; padding:0; list-style:none; margin:0;}
.popup .popupMessage {padding:0.4em;}
.popup hr {display:block; height:1px; width:auto; padding:0; margin:0.2em 0em;}
.popup li.disabled {padding:0.4em;}
.popup li a {display:block; padding:0.4em; font-weight:normal; cursor:pointer;}
.listBreak {font-size:1px; line-height:1px;}
.listBreak div {margin:2px 0;}

.tabset {padding:1em 0em 0em 0.5em;}
.tab {margin:0em 0em 0em 0.25em; padding:2px;}
.tabContents {padding:0.5em;}
.tabContents ul, .tabContents ol {margin:0; padding:0;}
.txtMainTab .tabContents li {list-style:none;}
.tabContents li.listLink { margin-left:.75em;}

#contentWrapper {display:block;}
#splashScreen {display:none;}

#displayArea {margin:1em 17em 0em 14em;}

.toolbar {text-align:right; font-size:.9em;}

.tiddler {padding:1em 1em 0em 1em;}

.missing .viewer,.missing .title {font-style:italic;}

.title {font-size:1.6em; font-weight:bold;}

.missing .subtitle {display:none;}
.subtitle {font-size:1.1em;}

.tiddler .button {padding:0.2em 0.4em;}

.tagging {margin:0.5em 0.5em 0.5em 0; float:left; display:none;}
.isTag .tagging {display:block;}
.tagged {margin:0.5em; float:right;}
.tagging, .tagged {font-size:0.9em; padding:0.25em;}
.tagging ul, .tagged ul {list-style:none; margin:0.25em; padding:0;}
.tagClear {clear:both;}

.footer {font-size:.9em;}
.footer li {display:inline;}

.annotation {padding:0.5em; margin:0.5em;}

* html .viewer pre {width:99%; padding:0 0 1em 0;}
.viewer {line-height:1.4em; padding-top:0.5em;}
.viewer .button {margin:0em 0.25em; padding:0em 0.25em;}
.viewer blockquote {line-height:1.5em; padding-left:0.8em;margin-left:2.5em;}
.viewer ul, .viewer ol {margin-left:0.5em; padding-left:1.5em;}

.viewer table, table.twtable {border-collapse:collapse; margin:0.8em 1.0em;}
.viewer th, .viewer td, .viewer tr,.viewer caption,.twtable th, .twtable td, .twtable tr,.twtable caption {padding:3px;}
table.listView {font-size:0.85em; margin:0.8em 1.0em;}
table.listView th, table.listView td, table.listView tr {padding:0px 3px 0px 3px;}

.viewer pre {padding:0.5em; margin-left:0.5em; font-size:1.2em; line-height:1.4em; overflow:auto;}
.viewer code {font-size:1.2em; line-height:1.4em;}

.editor {font-size:1.1em;}
.editor input, .editor textarea {display:block; width:100%; font:inherit;}
.editorFooter {padding:0.25em 0em; font-size:.9em;}
.editorFooter .button {padding-top:0px; padding-bottom:0px;}

.fieldsetFix {border:0; padding:0; margin:1px 0px 1px 0px;}

.sparkline {line-height:1em;}
.sparktick {outline:0;}

.zoomer {font-size:1.1em; position:absolute; overflow:hidden;}
.zoomer div {padding:1em;}

* html #backstage {width:99%;}
* html #backstageArea {width:99%;}
#backstageArea {display:none; position:relative; overflow: hidden; z-index:150; padding:0.3em 0.5em 0.3em 0.5em;}
#backstageToolbar {position:relative;}
#backstageArea a {font-weight:bold; margin-left:0.5em; padding:0.3em 0.5em 0.3em 0.5em;}
#backstageButton {display:none; position:absolute; z-index:175; top:0em; right:0em;}
#backstageButton a {padding:0.1em 0.4em 0.1em 0.4em; margin:0.1em 0.1em 0.1em 0.1em;}
#backstage {position:relative; width:100%; z-index:50;}
#backstagePanel {display:none; z-index:100; position:absolute; margin:0em 3em 0em 3em; padding:1em 1em 1em 1em;}
.backstagePanelFooter {padding-top:0.2em; float:right;}
.backstagePanelFooter a {padding:0.2em 0.4em 0.2em 0.4em;}
#backstageCloak {display:none; z-index:20; position:absolute; width:100%; height:100px;}

.whenBackstage {display:none;}
.backstageVisible .whenBackstage {display:block;}
/*}}}*/
/***
StyleSheet for use when a translation requires any css style changes.
This StyleSheet can be used directly by languages such as Chinese, Japanese and Korean which use a logographic writing system and need larger font sizes.
***/

/*{{{*/
body {font-size:0.8em;}

#sidebarOptions {font-size:1.05em;}
#sidebarOptions a {font-style:normal;}
#sidebarOptions .sliderPanel {font-size:0.95em;}

.subtitle {font-size:0.8em;}

.viewer table.listView {font-size:0.95em;}

.htmlarea .toolbarHA table {border:1px solid ButtonFace; margin:0em 0em;}
/*}}}*/
/*{{{*/
@media print {
#mainMenu, #sidebar, #messageArea, .toolbar, #backstageButton, #backstageArea {display: none ! important;}
#displayArea {margin: 1em 1em 0em 1em;}
/* Fixes a feature in Firefox 1.5.0.2 where print preview displays the noscript content */
noscript {display:none;}
}
/*}}}*/
<!--{{{-->
<div class='header' macro='gradient vert [[ColorPalette::PrimaryLight]] [[ColorPalette::PrimaryMid]]'>
<div class='headerShadow'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
<div class='headerForeground'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
</div>
<div id='mainMenu' refresh='content' tiddler='MainMenu'></div>
<div id='sidebar'>
<div id='sidebarOptions' refresh='content' tiddler='SideBarOptions'></div>
<div id='sidebarTabs' refresh='content' force='true' tiddler='SideBarTabs'></div>
</div>
<div id='displayArea'>
<div id='messageArea'></div>
<div id='tiddlerDisplay'></div>
</div>
<!--}}}-->
<!--{{{-->
<div class='toolbar' macro='toolbar closeTiddler closeOthers +editTiddler > fields syncing permalink references jump'></div>
<div class='title' macro='view title'></div>
<div class='subtitle'><span macro='view modifier link'></span>, <span macro='view modified date'></span> (<span macro='message views.wikified.createdPrompt'></span> <span macro='view created date'></span>)</div>
<div class='tagging' macro='tagging'></div>
<div class='tagged' macro='tags'></div>
<div class='viewer' macro='view text wikified'></div>
<div class='tagClear'></div>
<!--}}}-->
<!--{{{-->
<div class='toolbar' macro='toolbar +saveTiddler -cancelTiddler deleteTiddler'></div>
<div class='title' macro='view title'></div>
<div class='editor' macro='edit title'></div>
<div macro='annotations'></div>
<div class='editor' macro='edit text'></div>
<div class='editor' macro='edit tags'></div><div class='editorFooter'><span macro='message views.editor.tagPrompt'></span><span macro='tagChooser'></span></div>
<!--}}}-->
To get started with this blank TiddlyWiki, you'll need to modify the following tiddlers:
* SiteTitle & SiteSubtitle: The title and subtitle of the site, as shown above (after saving, they will also appear in the browser title bar)
* MainMenu: The menu (usually on the left)
* DefaultTiddlers: Contains the names of the tiddlers that you want to appear when the TiddlyWiki is opened
You'll also need to enter your username for signing your edits: <<option txtUserName>>
These InterfaceOptions for customising TiddlyWiki are saved in your browser

Your username for signing your edits. Write it as a WikiWord (eg JoeBloggs)

<<option txtUserName>>
<<option chkSaveBackups>> SaveBackups
<<option chkAutoSave>> AutoSave
<<option chkRegExpSearch>> RegExpSearch
<<option chkCaseSensitiveSearch>> CaseSensitiveSearch
<<option chkAnimate>> EnableAnimations

----
Also see AdvancedOptions
This is actually not a RedBook file. If you're using Linux, for example, you may find this file in your home directory as it is used by programs using the Readline library (like Bash) to define custom key mappings.
If you have the Readline Library installed on your system, you can use (or create, if it's not there) this file and specify some custom key bindings. The following //.inputrc// file is distributed with RedBook:

{{{
"\t": menu-complete
"\etest": ":use test\n"
"\edef": ":use default\n"
"\etoday": ":select :plain :from today\n"
"\ecoffee": ":log Coffee Break :with break\n"
"\elunch": ":log Lunch Break :with break\n"
"\ework": ":log Working Day\n"
"\ehome": ":select :pending :from :%today :silent\n:finish 1\n"
"\email": ":log Checking/answering emails :with mail\n"
"\eph": ":log Phone Call\n"
"\eb": ":backup\n"
"\ea": ":archive\n"
"\ek": kill-whole-line
"\e\t": ":finish\n"
"\e\b": ":clear\n"
"\e\e": ":quit\n"
"\e5": ":select :plain :last 5\n
"\e10": ":select :plain :last 10\n
"\epend": ":select :pending :from :%today\n"
"\edone": ":select :completed :from :%today\n"
"\eplain": ":select :plain :from :%today\n"
"\eweek": ":select :plain :from :%monday :to :%friday\n"


# Re-mapping brackets etc. (useful for international keyboards)
"\M-<": "["
"\M->": "]"
"\M-{": "{"
"\M-}": "}"
"\M-\\": "\\"
"\M-|": "|"
"\M-@": "@"
"\M-^": "~"
}}}

<<<
''NOTE''
//Readline will try to load the .inputrc file from the location specified in the INPUTRC environment variable or an .inputrc file placed in your HOME directory.//
<<<

What does this file do? Well, it defines some useful custom key binding, using the syntax defined [[here|http://tiswww.case.edu/php/chet/readline/rluserman.html#SEC10]]. Bindings are specified by a key (on the left) and an action or string macro which will be inputted in the program.

For example, the following:
{{{"\ework": ":log Started Working\n"}}}
Means that whenever you type [ESC] followed by "work", the command ":log Started Working" will be automatically executed ("\n" means newline, appending it to a command string makes RedBook execute the command, as it thinks someone pressed [ENTER]).
!!!Syntax
{{{
:archive
}}}
!!!Description
Archives your current log to a file named {{{<log_alias>_<date>@<time>.yml.gz}}} to the archives directory specified in [[rbconfig.yml]].
!!!Examples
{{{
:archive
}}}
!!!Syntax
{{{
:backup
}}}
!!!Description
Backs up your current log to a file named {{{<log_alias>.bkp.yml}}} to the backups directory specified in [[rbconfig.yml]].
!!!Examples
{{{
:backup
}}}
!!!Syntax
{{{
:blank
}}}
!!!Description
Erases the current log file (after asking confirmation to the user).
!!!Examples
{{{
:blank
}}}
!!!Syntax
{{{
:calc [<index1> ... <indexN>]
}}}
!!!Description
Calculates the time elapsed between two or more tasks. If no parameters are specified, it calculates the time elapsed between each task in the current dataset. It is possible to specify one or more //message indexes// to calculate the time elapsed between specific tasks //(see [[:select]] for more information)//.
<<<
''NOTE''
//This command must be executed after a [[:select]].//
<<<
!!!Examples
{{{
:calc
:calc 1 5
:calc 3 6 2
}}}
!!!Syntax
{{{
:clear
}}}
!!!Description
Clears the screen.
!!!Examples
{{{
:clear
}}}
!!!Syntax
{{{
:config
}}}
!!!Description
Reloads and prints the configuration file ([[rbconfig.yml]]) on the screen.
!!!Examples
{{{
:config
}}}
!!!Syntax
{{{
:dataset
}}}
!!!Description
Displays the messages loaded in the current dataset.
!!!Examples
{{{
:dataset
}}}
!!!Syntax
{{{
:delete [<index1> ... <indexN>]
}}}
!!!Description
Deletes the specified activities from the log file, after asking the user for confirmation. If no indices are specified, all the activities in the current dataset will be deleted.
<<<
''NOTE''
//This command must be executed after a [[:select]].//
<<<
!!!Examples
{{{
:delete
:delete 2 7
:delete 9 7 22
}}}
!!!Syntax
{{{
:dump [<path-to-file> :type <file-type>]
}}}
!!!Description
Saves output of the last :select command to a text file. If nothing else is specified, saves the log according to the path specified via the {{{:default_save_file:}}} setting in [[rbconfig.yml]].
<<<
''NOTE''
//This command must be executed immediately after a [[:select]].//
<<<
!!!Examples
{{{
:dump
:dump /home/tmp/log.txt
}}}
!!!Syntax
{{{
:finish [<index>]
}}}
!!!Description
Re-logs an already logged activity prepending [COMPLETED] to it. If no index is specified, it completes:
* The last activity of the current dataset //(if present)//
* The last logged activity //(in case of an empty dataset)//
!!!Examples
{{{
:finish
:finish 5
}}}
!!!Syntax
{{{
:log <message> [:tags|:with <tag1> ... <tagN> :dest <log-alias>]
}}}
!!!Description
Logs {{{<message>}}} to a log file. Directives can be logged by postponing a - to the leading colon, like :-select, :-log, etc.
!!!Supported Directives
!!!! :tags (:with)
{{{:tags}}} or its synonim {{{:with}}} can be used in conjunction with this operation to tag a message with a list of space-separated tags.
!!!! :dest
This directive can be used to specify a destination for the message via a log alias defined in [[rbconfig.yml]].
!!!Examples
{{{
:log First message :with test first multi_word :dest test
:log Second message
:log Third message :tags test third
}}}
!!!Syntax
{{{
:quit
}}}
!!!Description
Exists RedBook.
!!!Examples
{{{
:quit
}}}
!!!Syntax
{{{
:refresh
}}}
!!!Description
Reloads the current log (useful if the log file has been modified externally).
!!!Examples
{{{
:refresh
}}}
!!!Syntax
{{{
:relog <index>
}}}
!!!Description
Re-logs a previously-logged message, specified via an {{{index}}}, with the same tags but a different timestamp. 
<<<
''NOTE''
//This command must be executed after a [[:select]].//
<<<
!!!Examples
{{{
:relog 8
}}}
!!!Syntax
{{{
:restore
}}}
!!!Description
Overwrite the current log file with the last backup (after asking confirmation to the user).
!!!Examples
{{{
:restore
}}}
!!!Syntax
{{{
:ruby <arbitrary Ruby code>
}}}
!!!Description
Evaluates a chunk of Ruby code and outputs the result. It can be used as a quick calculator or converter. ''USE WITH CARE!''
!!!Examples
{{{
:ruby Time.now
}}}
!!!Syntax
{{{
:save [<path-to-file> :type <file-type>]
}}}
!!!Description
Saves the current dataset to a TXT, CSV or YAML file. If nothing else is specified, saves the log according to the path specified via the {{{:default_save_file:}}} setting in [[rbconfig.yml]].
<<<
''NOTE''
//This command must be executed after a [[:select]].//
<<<
!!!Supported Directives
!!!! :type
Used to specify the export file's type. 
<<<
''NOTE''
//txt, yml and csv extensions are automatically mapped to their respective file types.//
<<<
!!!Examples
{{{
:save
:save /home/tmp/log.txt
:save /home/tmp/test.log :type txt
}}}
!!!Syntax
{{{
:select [/<regular expression>/ :negate :pending|:plain|:completed|:avg|:count|:total|:duration :nodiff :first|:last <number> :from|:since <time expression> :to|:till|:until <time expression> :tags|:with <tag1> !<tag2> | ... <tagN> :silent]
}}}
!!!Description
Retrieves and displays (unless {{{:silent}}} is specified) a list of messages matching an optional regular expression and/or according to the additional directives specified. If no parameters are specified, the command displays all messages contained in the current log file.
Messages retrieved by {{{:select}}} constitute the //current dataset// and are displayed in the following format:
{{{<index> <timestamp>: <message> [<tag1>] ... [<tagN>]}}}
The //index// of each message refers to the current dataset, not to the whole log.
This operation must be performed prior to executing the following operations, which rely on the current dataset:
* [[:calc]]
* [[:delete]]
* [[:relog]]
* [[:save]]
* [[:update]]
!!!Supported Directives
* '':negate'' -- Negate the specified regular expression.
!!!! Activity status filters (:plain/:pending/:completed)
Used to select only a certain type of activity, i.e.:
* '':pending'' -- Only activities which have not been completed will be returned ''Note: This may take some time if large quantities of data need to be processed!''
* '':completed'' -- Only activities which have been completed will be returned
* '':plain'' -- Everything but [COMPLETED] activities will be returned.
!!!! Aggregations (:avg/:count/:total/:duration)
The following aggregations are supported:
* '':avg'' -- Average time spent
* '':count'' -- Number of messages in the dataset
* '':total'' -- Total time spent
* '':duration'' -- Duration of each completed activity within the dataset
If :avg, :total or :duration are specified, the time spent on sub-activites will be automatically (and recursively) deducted from the relative main activity.To avoid this behavior, it is possible to specify the '':nodiff'' directive.
!!!! :first/:last
Used to limit the number of messages returned by the query, either the first or last retrieved, depending on whether {{{:first}}} or {{{:last}}} is used.
!!!! :from/:since
Used to limit the number of messages returned by the query by specifying a start date via a //natural language time expression// supported by the [[Chronic|http://chronic.rubyforge.org/]] library, like:
* yesterday at 4:00
* thursday last week
* 3 months ago saturday at 5:00 pm
* 7 hours ago
!!!! :to/:till/:until
Similar to {{{:from}}} or {{{:since}}}, but used to set an end date.
!!!! :tags/:with
Used to limit the number of messages returned by the query by specifying a set of tags which must be present (or not be present) in the messages. 
//Remarks://
* The list of tags supports the {{{|}}} (OR) and {{{!}}} (NOT) boolean operators.
* The AND operator is implicit.
* {{{!}}} is always prepended to a tag (and only one).
* Operator precedence: NOT > AND > OR.
* It is not possible to use parenthesis.
<<<
''EXAMPLES''
* {{{high_priority todo important}}} can be used to filter messages tagged with {{{high_priority}}} AND {{{todo}}} AND {{{important}}} 
* {{{!todo mail | low_priority mail}}} can be used to filter messages tagged with ({{{mail}}} AND NOT {{{todo}}}) OR ({{{low_priority}}} AND {{{mail}}})
<<<
!!! :silent
Used to prevent RedBook from displaying the list of messages returned by the query.
!!!Examples
{{{
:select
:select :from today
:select :last 10 :with important !mail !meeting | todo
:select :from last year :silent
:select :completed :from 2 weeks ago :until today
:select :pending :from today
:select :avg :with mail meeting :nodiff
}}}
!!!Syntax
{{{
:update <index> :message <new-message> :tags|:with <new-tags> 
}}}
!!!Description
Updates a previously-logged activity overwriting its message and/or its tags, without changing its timestamp.
<<<
''NOTE''
//This command must be executed after a [[:select]].//
<<<
!!!Examples
{{{
:update 3 :message Status Meeting :with work meeting
:update 14 :with mail work
:update 7 :message Writing documentation
}}}
!!!Syntax
{{{
:use <log-alias>
}}}
!!!Description
Switches the current log to another log file specified via an alias defined in [[rbconfig.yml]].
!!!Examples
{{{
:use default
:use test
}}}
This chapter contains additional information about the following topics:
* [[Resources]] 
* [[ChangeLog]]
* [[License]]
* [[Contact Information|Fabio Cevasco]]
//{{{
version.extensions.breadCrumbs = {major: 2, minor: 0, revision: 1, date: new Date("Jan 31, 2006")};
var crumbsToShow = 7;
var breadCrumbs = [];

onClickTiddlerLink_orig_breadCrumbs = onClickTiddlerLink;
onClickTiddlerLink = function(e) {
	onClickTiddlerLink_orig_breadCrumbs(e);
	breadcrumbsAdd(e);
}

restart_orig_breadCrumbs = restart;
function restart() {
	story.closeAllTiddlers();
	story.displayTiddlers(null,store.getTiddlerText("DefaultTiddlers").readBracketedList());
	breadCrumbs = [];
	breadcrumbsRefresh();
}

function breadcrumbsAdd(e) {
	var uniqueCrumb = true;
	var crumbIndex = 0;
	if (!e) var e = window.event;
	var target = resolveTarget(e);
	var thisCrumb="[["+resolveTarget(e).getAttribute("tiddlyLink")+"]]";
	var lastInactiveCrumb = breadCrumbs.length - (breadCrumbs.length <crumbsToShow ? breadCrumbs.length : crumbsToShow);
	for(t=lastInactiveCrumb; t<breadCrumbs.length; t++) {
		if(breadCrumbs[t] == thisCrumb) {
			uniqueCrumb = false;
			crumbIndex = t+1;
		}
	}
	if(uniqueCrumb) {
		breadCrumbs.push(thisCrumb);
	}
	else {
		breadCrumbs = breadCrumbs.slice(0,crumbIndex);
	}
	breadcrumbsRefresh();
}

function breadcrumbsRefresh() {

	if (!document.getElementById("breadCrumbs")) {
		// Create breadCrumbs div
		var ca = document.createElement("div");
		ca.id = "breadCrumbs";
		ca.style.visibility= "hidden";
		var targetArea = document.getElementById("tiddlerDisplay");
		targetArea.parentNode.insertBefore(ca,targetArea);
	}

	var crumbArea = document.getElementById("breadCrumbs");
	crumbArea.style.visibility = "visible";
	removeChildren(crumbArea);
	createTiddlyButton(crumbArea,"Home",null,restart);
	crumbArea.appendChild(document.createTextNode(" > "));

	var crumbLine = "";
	var crumbCount = breadCrumbs.length;
	var firstCrumb = crumbCount -(crumbCount < crumbsToShow ? crumbCount : crumbsToShow);
	for(t=firstCrumb; t<crumbCount; t++) {
		if(t != firstCrumb) {
			crumbLine += " > ";
		}
		crumbLine += breadCrumbs[t];
	}
	wikify(crumbLine,crumbArea)
}
//}}}
''0.5 (Beta):''
* Added :negate flag to negate the regular expression in :select
* It is now necessary to provide a valid regular expression (enclosed in / /). This allows regexp switches like /i.
* Added :dataset operation to dump the current dataset.
* Added :- escape sequence for logging directives inside messages.
* Added :dump operation to save output of :select commands to a text file.
* Added custom fields (/:%[a-z_]+/) with auto-completion
* Added :blank operation to blank the current log.
* Added :restore operation to restore the backup of the current log.
* Added :archive operation to archive current log in .gz format.
* Added support for backups/archives folders in rbconfig.yml
* rbconfig.yml can now be placed in $HOME, project folder or lib folder.
* Placed executables in /bin folder
* :config now also prints the configuration (unless :silent is specified).
* Added start.bat for setting %INPUTRC% on Windows and launching redbook.exe (setenv.exe no longer necessary).

''0.4 (Beta):''
* Added RedBook icon for Windows executables, by [[Benno Meyer|http://www.iconarchive.com/category/folder/benno-system-icons-by-benno-meyer.html]]
* Added :nodiff keyword to disable automatic time difference of nested activities
* Duration of sub-activities automatically deducted from main activity (unless _concurrent tag specified)
* Added time tracking keywords for :select -- :avg, :total, :count, :duration
* Added :delete operation
* Added :update operation and :message directive
* Updated exampe rbconfig.yml (Readline and Iconv now enabled by default)
* Updated example .inputrc (added new key bindings, modified some of the existing ones)
* Added :plain keyword to select all activities except those starting with [COMPLETED]
* Added :completed keyword to select all completed activities
* Added :pending keyword to select all activities which have not been completed.

''0.3 (Beta):''
* Added new manual powered by [[TiddlyWiki|http://www.tiddlywiki.com/]]
* Substituted :stop keyword with :quit
* Added support for international characters through Iconv.
* Added rbconfig.yml lookup in $HOME or %HOME%
* Substituted :timecalc keyword with :calc
* Prevented re-completing the same task more than once
* New tags are automatically added to auto-completion list.
* Messages logged via :finish or :relog are automatically added to the current dataset
* Added :relog keyword to re-log a previously entered message with the current timestamp (unless is a completed task)
* Corrected small bug in message matching
* Added matching for negated tags
* Substituted :complete keyword with :finish
* Removed :load, :load_config, :load_log; use :select, :config and :use/:refresh instead.
* Fixed bug in :complete -- the command didn't work when the last index of the dataset was specified.
* Added :ruby keyword to perform ruby code evaluation
* Added :clear keyword to clean the screen
* Removed Win32::Console for compatibility problems with Readline -- colors are disabled on Windows platforms.
* Included Readline library: added auto-completion for keywords and tags, history, and custom key bindings (via .inputrc)

''0.2 (Alpha):''
* Support for multiple log files.
* Added manual backup of current log using the :backup keyword.
* Added :dest keyword override for :log operation, allowing to log a message to a different log file.
* Fixed unhandled exception on Regexp error, now a ~LoggerError is raised instead. Regular expressions now supported for :load message filter.
* Added :complete keyword, to automatically log a [COMPLETED] message when the last task or a user-specified task has been completed.
* Added redbooklet.rb, standalone script to be used for quick logging or Launchy/~QuickSilver integration (redbooklet.exe provided as well).
//{{{
if (config.macros.toolbar._createCommand == undefined) // safeguard
{
    config.macros.toolbar._createCommand = config.macros.toolbar.createCommand; 
    config.macros.toolbar.createCommand = function(place,command,tiddler,theClass) 
    { 
        if(command.condition == undefined || command.condition(tiddler)) 
               this._createCommand(place,command,tiddler,theClass); 
    }
}
//}}}
After unpacking the files, RedBook can immediately run with some default settings. To change these settings you can manually edit the following files:
* [[rbconfig.yml]]
* [[.inputrc]]
[[Welcome]]
[[Table of Contents]]
//{{{
// Inserts a "disable editing"/"enable editing" button into the SideBarOptions shadow tiddler as the last button.

var systemConfig = "systemConfig";
var pluginName = "~DisableEditTiddler"; // name of our sibling plugin
var editDisabled = store.getTiddler(pluginName).getTags().indexOf(systemConfig) >= 0;

if (window.location.protocol == "file:")  // when hosted at iewiki.net: || editDisabled == false)
	config.shadowTiddlers.SideBarOptions = config.shadowTiddlers.SideBarOptions.replace("<<slider","<<disableEditView>><<slider");
if (editDisabled)
{
	TiddlyWiki.prototype._notifyAll  = TiddlyWiki.prototype.notifyAll;
	TiddlyWiki.prototype.notifyAll = function()
	{
		readOnly = true;
		this._notifyAll();
	}
}
disableEditButton = function()
	{
		var tag = editDisabled ? "" : systemConfig;
		store.saveTiddler(pluginName,null,null,null,null,tag);
		if (TiddlyWiki.prototype._saveTiddlerHook == undefined) // unless server-hooked
			saveChanges();
		window.location.reload(); // to see the effect on the toolbar
	}

config.macros.disableEditView = { 
	handler: function(place)
	{
		if(editDisabled)
			createTiddlyButton(place,"enable editing","Restores the edit/view button on the tiddler toolbar (and saves changes)",
							function () {disableEditButton(); return false;},null,null,this.accessKey);
		else
			createTiddlyButton(place,"disable editing","Removes the edit/view button on the tiddler toolbar (and saves changes)",
							function () {disableEditButton(); return false;},null,null,this.accessKey);
	}
}

//}}}
For suggestions, bugs, feature requests, complaints, and anything else, feel free to contact Fabio Cevasco, the creator of RedBook:
* ''Personal Website:'' [[www.h3rald.com|http://www.h3rald.com/]]
* ''Email'': h3rald [at] h3rald.com
~RedBook is free and open source, and it can be downloaded from [[http://code.google.com/p/redbook/downloads/list]].

Note that three packages can be downloaded:

* [[RedBook Source Code (Cross Platform)]] -- This package contains ~RedBook source files, configuration files and documentation which can be run on any machine able to execute Ruby script (provided that the [[prerequisites|Prerequisites]] are met). 
* [[RedBook Portable (Windows)]] -- This package contains two exe files which can be executed only on MS Windows platforms, along with the same configuration files and documentation.
* [[RedBook Installer (Windows)]] -- Windows setup file which will install ~RedBook automatically.
The following pages explain how to download and get ~RedBook up and running:
* [[RedBook Source Code (Cross Platform)]]
* [[RedBook Portable (Windows)]] 
* [[RedBook Installer (Windows)]]
/***
|''Name:''|LegacyStrikeThroughPlugin|
|''Description:''|Support for legacy (pre 2.1) strike through formatting|
|''Version:''|1.0.2|
|''Date:''|Jul 21, 2006|
|''Source:''|http://www.tiddlywiki.com/#LegacyStrikeThroughPlugin|
|''Author:''|MartinBudden (mjbudden (at) gmail (dot) com)|
|''License:''|[[BSD open source license]]|
|''CoreVersion:''|2.1.0|
***/

//{{{
// Ensure that the LegacyStrikeThrough Plugin is only installed once.
if(!version.extensions.LegacyStrikeThroughPlugin) {
version.extensions.LegacyStrikeThroughPlugin = {installed:true};

config.formatters.push(
{
	name: "legacyStrikeByChar",
	match: "==",
	termRegExp: /(==)/mg,
	element: "strike",
	handler: config.formatterHelpers.createElementAndWikify
});

} //# end of "install only once"
//}}}
Copyright &copy; 2007, Fabio Cevasco

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of the copyright owner nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
[[Table of Contents]]
[[Welcome]]
[[Requirements]]
[[Getting RedBook]]
[[Installation]]
[[Configuration]]
[[Usage]]
[[Operations]]
[[Appendixes]]

The [[RedBook Query Language]] supports a wide variety of different operations:
* [[:archive]]
* [[:backup]]
* [[:blank]]
* [[:calc]]
* [[:clear]]
* [[:config]]
* [[:dataset]]
* [[:delete]]
* [[:dump]]
* [[:finish]]
* [[:log]]
* [[:quit]]
* [[:refresh]]
* [[:relog]]
* [[:restore]]
* [[:ruby]]
* [[:save]]
* [[:select]]
* [[:update]]
* [[:use]]
Basically, ~RedBook can run on any platform able to execute Ruby scripts. If you don't know anything about Ruby or you want to know how to download and install it on your machine, check out the [[official Ruby web site|http://www.ruby-lang.org/]] for more information.

~RedBook has been successfully tested on ''MS Windows'' and ''Linux'', and some user reported that he could run it on ''Mac OS X'' as well.

If you are a MS Windows user and you don't want or can't install Ruby on your machine, check out the special [[EXE Edition|Executable files]]: basically it's a single, chunky .exe file which packs a full Ruby interpreter and all the necessary libraries to run the program.
In order to run ~RedBook (source code distribution), you need the following

* [[Ruby|http://www.ruby-lang.org]] -- The programming language used for this script.
* [[Chronic|http://chronic.rubyforge.org/]] -- An excellent natural-language time parser. You can installing by executing {{{gem install chronic --include-dependencies}}} from your terminal/console/command-prompt.
* [[GNU Readline Library|http://tiswww.case.edu/php/chet/readline/rltop.html]] -- for auto-completion and custom key bindings. This is optional, but highly recommended //(it is already included by default in many pre-compiled Ruby distributions)//.
* [[GNU libiconv|http://www.gnu.org/software/libiconv/]] -- For international characters support. This is optional, but highly recommended //(it is already included by default in many pre-compiled Ruby distributions)//.
RedBook can be executed like any other Ruby script, i.e.:
* On Linux/Mac OS X: {{{./redbook}}}
* On Windows: {{{ruby redbook}}}
<<<
NOTE
//If you downloaded the [[Windows executable files distribution|Windows Executable Files]] you just need to double-click on it.//
<<<
RedBook was designed to be an interactive script. If you want something to just log messages and integrate with launchers like [[Launchy|http://www.launchy.net/]] or [[QuickSilver|http://quicksilver.blacktree.com/]], check out RedBooklet.
To install RedBook via the Windows installer, simply double-click the RedBook-x.x.x_Win32-setup file and follow the instructions of the setup wizard. 
The automatic setup will perform the following operations:
* Install the following files to a RedBook folder in Program Files:
** readbook.exe
** redbooklet.exe
** rbconfig.yml //(unless already present)//
** log.yml //(unless already present)//
** .inputrc
** start.bat
** doc/manual.html
** doc/license.txt
Optionally, the setup will also create Desktop, Start Menu and Quick Launch shortcuts -- in particular, a //Log// shortcut to redbooklet.exe will be created for  automatic [[Launchy|http://www.launchy.net/]] integration.


!! Remarks
* By default, .inputrc, log.yml and rbconfig.yml are not removed when uninstalling.
* If you chose to create a RedBook shortcut in the Start Menu, it will be possible to start or bring up RedBook automatically by pressing CTRL+ALT+R

<<<
''TIP''
By default, the Windows command prompt looks really ugly. For a better experience, right-click anywhere in the RedBook window Title Bar while it is running, select properties, and configure the following settings:
* Font tab:
** Set the font to ''Lucida Console''
** Set the size to ''12''
* Layout tab:
** Set the screen buffer size to ''120x300''
** Set the windows size to ''120x40''
<<<



RedBook is also available in binary form for MS Windows only. Ruby code cannot be compiled (yet), so the executable file provided in this package simply includes a whole, fully functional ruby interpreter and all the libraries needed to run the program (for more information, refer to [[RubyScript2Exe|http://www.erikveen.dds.nl/rubyscript2exe/]]).
* start.bat - Use this to start RedBook (it enables auto-completion by setting the %INPUTRC% variable to point to your .inputrc file in the application directory).
* redbook.exe -- The program to start RedBook in interactive mode.
* redbooklet.exe -- The program used to simply log messages (suitable for integration with launchers like QuickSilver or Launchy).
* config.yml -- RedBook's configuration file in YAML format, used by both redbook.rb and redbooklet.rb
* log.yml -- A default log file in YAML format (empty).
* .inputrc -- An example .inputrc used by the Readline library.

The RedBook Query Language (you can call it RBQL, if you like) is //not// actually a full blown query language like SQL of course, it's just a conventional term I decided to use to group RedBook's commands together.
As a matter of fact, I was looking for something which was:
* Easy to type
* Easy to remember
* Easy to code
RedBook's parser is tiny, extremely simple and possibly a little bit stupid -- but it does the job for now. The following sections describes the fundamentals of RBQL (it's really not much).
! Basic Concepts
The idea behind RBQL is very simple: everything which does something -- an operation, a keyword, etc. -- needs to be easily parseable and not too difficult to type. These special words, let's call them //directives// from now on, are always prepended by a colon, i.e. like {{{:select}}} or {{{:from}}}. What follows after a directive is meant to be a parameter of some sort.
So, to sum up, a //command// looks like:
{{{:directive [parameters] :directive [parameters]}}}
Simple enough. 
! Example Commands
Let's have a look at some example commands which are understandable by RedBook:

{{{:log This is a test message :with testing example}}}
This will log a message ("This is a test message") tagged with "testing" and "example". //Check the [[:log]] page for more information on this operation.//

{{{:select :from today :with testing !work}}}
This will return all messages logged today tagged with "testing" but not with "work". //Check the [[:select]] page for more information on this operation.//

{{{:backup}}}
This will backup your log file. //Check the [[:backup]] page for more information on this operation.//
! Syntax Rules
RedBook parser is fairly simple and doesn't enforce a lot of constraints, however you should try to follow some rules when inputting commands
* Your command //must// contain one operation (you'll get an error otherwise).
* You are only allowed to use one operation per command. If you use more than one, the last one will be considered.
* It is possible to escape directives by adding a dash after the colon, i.e. {{{:-select}}}, {{{:-log}}}.
* It is possible to insert custom fields as {{{:%<custom field name>}}}, e.g. {{{:%week}}} (provided that the custom field is defined in [[rbconfig.yml]]).
* Directives can be used in any order (e.g. {{{:log message text :with test}}} is the same as {{{:with test :log message}}}).
* Invalid directives will cause the whole command to fail.
* Valid directives but not supported for a particular operation will be ignored (e.g. {{{:select :from today :type yml}}} will be executed successfully, although {{{:type yml}}} will be ignored, as it is not supported by the {{{:select}}} operation).
!Variables
It is possible to include custom variables in commands by prepending their name with {{{:%}}}, e.g.:

{{{:select :completed :from :%today}}}

Variables can be set in the [[rbconfig.yml]] file, e.g.:

{{{:var_today: "today at 8:00 am"}}}

When ~RedBook encounters a variable in a command, it will substitute it with its value, so the previous command will be processed as:

{{{:select :completed :from today at 8:00 am}}}

Note that variables can be used within other variables, for example:

{{{
:var_monday: "last monday at 8 am"
:var_friday: "last friday at 8 pm"
:var_week: ":select :plain :from :%monday :to :%friday"
}}}

In this case, {{{:%week}}} will be evaluated as:

{{{:select :plain :from last monday at 8 am :to last friday at 8 pm}}}
The full ~RedBook source code is provided in a single zipped file, just uncompress it in a folder of your choice. The package contains the following folders and files:
* //bin// -- This folder contains the following executable ruby files:
** ''redbook'' -- The script to start RedBook in interactive mode.
** ''redbooklet'' -- RedBooklet is a standalone ruby script, just for logging messages (suitable for integration with launchers like ~QuickSilver or Launchy).
* //doc// -- This folder //will// contain ~RedBook's ~RDoc documentation.
* //lib// -- This folder contains the "core" of ~RedBook, i.e. the most important source files.
* //test// -- This folder contains some Unit Tests.
* config.yml -- ~RedBook's configuration file in YAML format, used by both redbook.rb and redbooklet.rb
* log.yml -- A default log file in YAML format (empty).
* .inputrc -- An example .inputrc used by the Readline library.
RedBooklet can be executed like any other Ruby script, i.e.:
* On Linux/Mac OS X: {{{./redbooklet <message to log> [:tags|:with <tags> :dest <log alias>]}}}
* On Windows: {{{ruby redbooklet <message to log> [:tags|:with <tags> :dest <log alias>]}}}
<<<
NOTE
//If you downloaded the [[Windows executable files distribution|Windows Executable Files]] you just need run the exe file with the necessary parameters.//
<<<
The {{{<message to log>}}} parameter is mandatory, the others are optional. Basically RedBooklet can be used just to log a message with an optional set of tags to a specified log file (if {{{:dest}}} is not specified, the default log file will be used -- exactly like any [[:log]] operation).
RedBooklet can be used in conjunction with a launcher like [[Launchy|http://www.launchy.net/]] or [[QuickSilver|http://quicksilver.blacktree.com/]], to make logging messages much easier and faster.
! Example: Using redbooklet.exe with Launchy
To use redbooklet.exe to work with Launchy, proceed as follows:
# Create a shortcut to redbooklet.exe (or to a way to execute the corresponding ruby script) named //log//.
# Copy the “log” shortcut anywhere in your start menu.
# Bring up launchy (ALT+SPACE) and type in //log//.
# Hit TAB
# Type in your log message, optionally with the any {{{:tags}}}/{{{:with}}}) or {{{:dest}}} directives.
# The message will be logged to your default log file or to the log you specified using the {{{:dest}}} directive. If an error occurs, it will appear in a command line window for 15 seconds before the program is closed.
The following pages specify the requirements to run ~RedBook:
* [[Platform]] -- Which ~OSes are supported?
* [[Prerequisites]] -- Which Ruby Gems and libraries are required or optional to run ~RedBook?
For more information about RedBook, don't forget to visit:
* [[RedBook Home Page|http:///redbook.h3rald.com/]] -- The online version of this manual.
* [[H3RALD|http://www.h3rald.com/]] -- The [[author|Fabio Cevasco]]'s personal website.
* [[RedBook - A simple Ruby program for your daily logging needs|http://www.h3rald.com/articles/redbook]] -- An introductory article about RedBook.
* Announcements:
** [[Release 0.5.0 (beta)|http://www.h3rald.com/blog/redbook-050-released]]
** [[Release 0.4.0 (beta)|http://www.h3rald.com/blog/redbook-040-released]]
** [[Release 0.3.0 (beta)|http://www.h3rald.com/blog/redbook-030-released]]
** [[Release 0.2.0 (beta)|http://www.h3rald.com/blog/redbook-020-released]]
* [[Tickets|http://www.assembla.com/spaces/tickets/index/bWE7NkzCqr3k25abIlDkbG?spaces_tool_id=cl4LteCnKr3iQFabIlDkbG]] -- Submit your bugs and feature requests here.
* [[Timeline|http://www.assembla.com/spaces/new_items/bWE7NkzCqr3k25abIlDkbG]] -- SVN commits, messages, etc.
* [[Milestones|http://www.assembla.com/spaces/milestones/index/bWE7NkzCqr3k25abIlDkbG?spaces_tool_id=ceS8UazCqr3k25abIlDkbG]] -- Features planned for the next RedBook releases.
* [[SVN Repository|http://tools.assembla.com/svn/redbook]] -- Subversion Repository //(requires access)//.
* [[Download|http://www.assembla.com/spaces/files/bWE7NkzCqr3k25abIlDkbG]] -- RedBook download page.
* Other useful links:
** [[Official Ruby Web Site|http://www.ruby-lang.org]]
** [[Chronic Library Documentation|http://chronic.rubyforge.org/]]
** [[GNU Readline Library|http://tiswww.case.edu/php/chet/readline/rltop.html]]
** [[GNU libiconv|http://www.gnu.org/software/libiconv/]] 
** [[RubyScript2Exe, a Ruby 'compiler'|http://www.erikveen.dds.nl/rubyscript2exe/]]
//{{{
version.extensions.SinglePageMode= {major: 2, minor: 5, revision: 1, date: new Date(2007,10,8)};

if (config.options.chkSinglePageMode==undefined) config.options.chkSinglePageMode=false;
if (config.options.chkSinglePagePermalink==undefined) config.options.chkSinglePagePermalink=true;
if (config.options.chkTopOfPageMode==undefined) config.options.chkTopOfPageMode=false;
if (config.options.chkBottomOfPageMode==undefined) config.options.chkBottomOfPageMode=false;

if (config.optionsDesc) {
	config.optionsDesc.chkSinglePageMode="Display one tiddler at a time";
	config.optionsDesc.chkSinglePagePermalink="Automatically permalink current tiddler";
	config.optionsDesc.chkTopOfPageMode="Always open tiddlers at the top of the page";
	config.optionsDesc.chkBottomOfPageMode="Always open tiddlers at the bottom of the page";
} else {
	config.shadowTiddlers.AdvancedOptions += "\
		\n<<option chkSinglePageMode>> Display one tiddler at a time \
		\n<<option chkSinglePagePermalink>> Automatically permalink current tiddler \
		\n<<option chkTopOfPageMode>> Always open tiddlers at the top of the page \
		\n<<option chkBottomOfPageMode>> Always open tiddlers at the bottom of the page";
}

config.SPMTimer = 0;
config.lastURL = window.location.hash;
function checkLastURL()
{
	if (!config.options.chkSinglePageMode)
		{ window.clearInterval(config.SPMTimer); config.SPMTimer=0; return; }
	if (config.lastURL == window.location.hash)
		return;
	var tiddlerName = convertUTF8ToUnicode(decodeURI(window.location.hash.substr(1)));
	tiddlerName=tiddlerName.replace(/\[\[/,"").replace(/\]\]/,""); // strip any [[ ]] bracketing
	if (tiddlerName.length) story.displayTiddler(null,tiddlerName,1,null,null);
}

if (Story.prototype.SPM_coreDisplayTiddler==undefined) Story.prototype.SPM_coreDisplayTiddler=Story.prototype.displayTiddler;
Story.prototype.displayTiddler = function(srcElement,title,template,animate,slowly)
{
	if (config.options.chkSinglePageMode)
		story.closeAllTiddlers();
	else if (config.options.chkTopOfPageMode)
		arguments[0]=null;
	else if (config.options.chkBottomOfPageMode)
		arguments[0]="bottom";
	if (config.options.chkSinglePageMode && config.options.chkSinglePagePermalink && !config.browser.isSafari) {
		window.location.hash = encodeURIComponent(convertUnicodeToUTF8(String.encodeTiddlyLink(title)));
		config.lastURL = window.location.hash;
		document.title = wikifyPlain("SiteTitle") + " - " + title;
		if (!config.SPMTimer) config.SPMTimer=window.setInterval(function() {checkLastURL();},1000);
	}
	this.SPM_coreDisplayTiddler.apply(this,arguments); // let CORE render tiddler
	var tiddlerElem=document.getElementById(story.idPrefix+title);
	if (tiddlerElem) {
		var yPos=ensureVisible(tiddlerElem); // scroll to top of tiddler
		if (config.options.chkSinglePageMode||config.options.chkTopOfPageMode)
			yPos=0; // scroll to top of page instead of top of tiddler
		if (config.options.chkAnimate) // defer scroll until 200ms after animation completes
			setTimeout("window.scrollTo(0,"+yPos+")",config.animDuration+200); 
		else
			window.scrollTo(0,yPos); // scroll immediately
	}
}

if (Story.prototype.SPM_coreDisplayTiddlers==undefined) Story.prototype.SPM_coreDisplayTiddlers=Story.prototype.displayTiddlers;
Story.prototype.displayTiddlers = function(srcElement,titles,template,unused1,unused2,animate,slowly)
{
	// suspend single-page mode (and/or top/bottom display options) when showing multiple tiddlers
	var saveSPM=config.options.chkSinglePageMode; config.options.chkSinglePageMode=false;
	var saveTPM=config.options.chkTopOfPageMode; config.options.chkTopOfPageMode=false;
	var saveBPM=config.options.chkBottomOfPageMode; config.options.chkBottomOfPageMode=false;
	this.SPM_coreDisplayTiddlers.apply(this,arguments);
	config.options.chkBottomOfPageMode=saveBPM;
	config.options.chkTopOfPageMode=saveTPM;
	config.options.chkSinglePageMode=saveSPM;
}
//}}}
Logging and time-tracking made easy
~RedBook
* [[Welcome]]
* [[Requirements]]
** [[Platform]]
** [[Prerequisites]]
* [[Getting RedBook]]
* [[Installation]]
** [[RedBook Source Code (Cross Platform)]]
** [[RedBook Portable (Windows)]]
** [[RedBook Installer (Windows)]]
* [[Configuration]]
** [[rbconfig.yml]]
** [[.inputrc]]
* [[Usage]]
** [[RedBook Query Language]]
** [[RedBook]]
** [[RedBooklet]]
* [[Operations]]
** [[:archive]]
** [[:backup]]
** [[:blank]]
** [[:calc]]
** [[:clear]]
** [[:config]]
** [[:dataset]]
** [[:delete]]
** [[:dump]]
** [[:finish]]
** [[:log]]
** [[:quit]]
** [[:refresh]]
** [[:relog]]
** [[:restore]]
** [[:ruby]]
** [[:save]]
** [[:select]]
** [[:update]]
** [[:use]]
* [[Appendixes]]
** [[Resources]]
** [[ChangeLog]]
** [[License]]

RedBook is an interactive console program, and this means that everything is done basically through the keyboard, by inputting commands. RedBook commands are designed to be very simple and easy to remember, but powerful at the same time.
This section covers the basics of [[RedBook Query Language]] and the usage of both RedBook and RedBooklet. For a more detailed description on each specific operation you can perform with the RedBook Query Language, refer to the [[Operations]] section.
* [[RedBook Query Language]]
* [[RedBook]]
* [[RedBooklet]]
~RedBook is an interactive Ruby script able to:
* Log your daily activities onto a YAML file (multiple log files supported).
* Export a set of activities to a txt, csv or yml file.
* Display activities matching a specific string (Regexp supported), tags (with boolean operators), or time frame.
* Calculate the time elapsed between two or more logged activities.
* Calculate the number, the duration, the average and total time spent on a set of activities matching user-specified criteria.
* Update and delete logged activities.
* Backup, archive and restore log files.
* Evaluate arbitrary Ruby code, for example to act as a "emergency calculator" when needed.
Additionally, this script supports:
* International characters and character encoding conversions.
* Auto-completion for directives and tags.
* Custom key bindings.
* User-define variables
! About this document
This document covers everything you need to know to download, install and run the program, including a complete reference of all operations (with their own specific keywords) and configuration settings. 
In order to make it easier for me to write it and for you to read it, I decided to write this manual using [[TiddlyWiki|http://www.tiddlywiki.com/]], this means that:
* it //can// be edited (if you click the "enable editing" link on the right), but you are not supposed to (if you're browsing this online, the link is not there and editing is disabled).
* it can be easily viewed in any web browser able to understand Javascript properly.
* it is a single file, so it's easy to copy and distribute (you can grab a copy by [[downloading RedBook|Getting RedBook]]).
* it is possible to search through all the manual and display only relevant pages

Enjoy your reading and happy logging, 

-- //[[Fabio Cevasco]]//
When RedBook (or RedBooklet) starts, it will look for a file named config.yml in one of the following directories
* $HOME (on Linux(Mac OS X) or %HOME% in Windows (this variable should be set to "C:\Documents and Settings\<your windows username>").
* The same directory as the script
! General Settings
!!!:time_format: 
''Default:'' "%a %b %d %Y - %I:%M:%S %p"
The time format used when displaying timestamps. It must be a string acceptable by the [[strftime|http://ruby-doc.org/core/classes/Time.html#M000297]] method.
!!!:show_tags: 
''Default:'' true
If enabled, tags will be displayed when displaying messages.
!!!:enable_readline: 
''Default:'' true
If enabled, RedBook will support [[auto-completion and custom key bindings|.inputrc]].
!!!:enable_iconv: 
''Default:'' true
If enabled, RedBook will support international characters (see the //*_charset// settings for more details on this).
! Character Encodings
These settings are related to the character encodings handled by RedBook and RedBooklet. For more information on the supported character encodings, refer to the [[GNU libiconv documentation|http://www.gnu.org/software/libiconv/]].
!!!:input_charset:
''Default:'' "~CP437"
The character set used when running RedBook from your console. It defaults to ~CP437, the character set used by MS DOS.
!!!:redbooklet_input_charset:
''Default:'' "~CP1252"
The character set used when running RedBooklet. It defaults to ~CP437, the character set used by MS Windows.
!!!:output_charset:
''Default:'' "~UTF-8"
The character set used when saving log messages to a file through the [[:save]] operation.
!!!:log_charset:
''Default:'' "~UTF-8"
The character set used for log files.
! Save File Settings
!!!:default_save_file: 
''Default:'' "log.txt"
The default file path where messages will be exported to.
!!!:default_save_file_type: 
''Default:'' "txt"
The default file type for the export file.
!!!:archives_folder: 
''Default:'' ""
The path to the folder where log archives will be saved.
!!!:backups_folder: 
''Default:'' ""
The path to the folder where log backups will be saved.
! Log File Aliases
It is possible to define any number of different logs by specifying aliases in the form {{{:data_<alias name>}}}.
!!!:data: 
''Default:'' "log.yml"
The path to the default log file (the file must exist). 
!!!:data_test: 
''Default:'' "test.yml"
The path to additional log files. The user can configure any number of '':data_<alias>:'' settings, each corresponding to a particular log file (the file must exist).
! Variables
It is possible to define any number of different [[variables|RedBook Query Language]] in the form {{{:var_<custom field name>}}}, e.g.:
{{{
:var_monday: "last monday at 8 am"
:var_friday: "last friday at 8 pm"
:var_week: ":select :plain :from :%monday :to :%friday"
:var_today: "today at 8:00 am
}}}
//{{{
config.commands.editTiddler.condition = function(tiddler) { return ! tiddler.isReadOnly(); } // Disables editing 
//}}}
© 2007 - Fabio Cevasco