and add more lines, here is a sample configuration with ALL the necessary lines:
#The directory where the notebook files are kept, for eg $HOME/.notes or $HOME/.kde/share/apps/kjots
notesdir=/home/user/.notes
#Preferred date format, see 'date --help' on the linux command line for format specification
dateformat=%F
#Preferred time format, see 'date --help' on the linux command line for format specification
timeformat=%r
#Width of the table of contents pane (in characters)
toc=25
#Maximum height of the book list pane (in number of books shown without scrolling)
max_bookshelf_height=200;
#Where the plugin list file is located
plugin_file=/home/user/.cjots_plugins
3. Configure Plugins
Note that the 'plugin file=' variable in the .cjotsrc configuration file refers to the location of
the plugins file. The 'cjots_plugins_sample' file is an example file that comes with Cjots which you can use.
I suggest:
cp cjots_plugins_sample ~/.cjots_plugins
Then specify that location from the config file:
plugin_file=/home/username/.cjots_plugins
where username is .. well it should be obvious.
Look inside the plugins file or the Plugins section of this manufal for information about making your own plugins
4. Run
./cjots.pl
or put it in your $PATH so you just need to type:
cjots.pl
\NewEntry Overview
\ID 3
Cjots is very simple to use, it works like this:
Cjots is broken up into 3 panes. The Book List pane, the Pages pane, and the Text pane.
(These are covered in the sections 'Books', 'Pages' and 'Text' respectively).
Your folder ('notesdir' set in the .cjotsrc config) contains books (which are files). These books appear in the Books List.
Each book contains pages, the pages are shown when you open a book.
Each page contains text, this text is editable when you select a page.
There are a number of things you can do with books, pages and the text in them, read on for details.
You can press F1 at any point in Cjots to get help.
\NewEntry Books
\ID 4
Working with Books concerns the Book List / Bookshelf / Book pane in the TOP LEFT.
This list contains all books, or actually any files found within the directory specified by 'notesdir' variable in your configuration file .cjots. Usually ".notes" in your home directory but if you are using existing KJots books, you'll specify the directory where they are kept.
From this pane you can:
UP/DOWN...Select a book
F6........Create a new book
F2........Rename the selected book
ENTER.....Open the selected book
Note: To delete a book, you have to remove all the pages first (to stop accidental deletions).
\NewEntry Pages
\ID 5
Working with Pages concerns the Page List / Table of Contents pane in the BOTTOM LEFT.
This lists all the pages belonging to the selected book that you have opened.
From this pane you can:
General Operations:
UP/DOWN..Select a page, the text of that page will display to the right in the Text Editor
F6.......Insert a new Page after the currently selected Page
F2.......Rename the currently selected Page
F3.......Save the current book, note that the book is saved under most circumstances automatically, when you change page, quit, etc.
F4.......Focus the book list, the current book is auto-saved and closed
F7.......Run a plugin / External command, see the 'Plugins' Section for more information
F8.......Delete the selected Page
F9.......Export the current book, note that this is different from export PAGE which is done if you press F9 from the PAGE list. You get a choice of HTML or Plain Text.
ENTER....Edit page
Note: All books must have at least 1 page
Cut, Copy & Paste Pages:
x...Cut a page, it is deleted from the list, but stored in memory
y...Yank a page, it is NOT deleted, but stored in memory
p...Paste a page stored in memory (after cutting or yanking it). It is pasted below the currently selected page, thus 'x' and 'y' can be used to move a page in the list.
Note: Cut/Copy/Paste operations can be done between books.
Merging and Splitting Warning: see the 'Bugs' section.
m....Merge a page with another page, be careful entering the number it asks for!
If something goes wrong, your text can be recovered by pressing F12 from within the text editor.
To split a page:
This sounds strange, but just type \NewEntry title where you want to split the page, where title is the name you want to the new page. Put new lines above and below then just press F4 to focus the Book List, and then open the book again - your new page(s) should be listed.
\NewEntry Text
\ID 6
Working with Text concerns the Text Editor pane to the RIGHT.
General Operations
Esc...Focus the Page List
F3....Save (but note that the book is autosaved during most operations like changing page, changing book, quitting, etc)
F4....Focus the book list, your current page and book is autosaved and closed
F7....Run a plugin / External command, see the 'Plugins' Section for more information
F9....Export Page, note that this is different from Export BOOK, which is done if you press F9 from the BOOK LIST
Copy & Paste Text
F11....Copy the contents of the current page to a buffer
F12....Paste the contents of the buffer to the current page
Note: This is a separate buffer to that used to copy entire pages, see the 'Pages' section.
Other operations
See the 'Appendix' of this Document for more key commands which can be used from the editor
\NewEntry Plugins
\ID 7
Cjots plugins are basically just shell commands that can be run to interact with a Cjots Book
These commands are writtin in the 'plugins file' which is any file specified by the plugin_file variable in the configuration file.
Plugins are listed in that file, one per line, in the format of a command and a description separated by one or more tabs.
You can use the following variables:
$file which will be replaced by the filename of the current open book
$page which will be replaced by the text of the currently selected page
$arg which will be replaced by an argument at the time of execution (the user will be prompted)
Lets look at some examples, note that some example need external programs like lynx and aspell to work:
#COMMAND DESCRIPTION
date +"%F" Insert the current date
date +"%r" Insert the current time
date +"[%r] >" Insert the current time as an IRC style time stamp
wc "$file" Char/Word/Paragraph Count of the Book
echo "$page" | wc Char/Word/Paragraph Count of the Page
echo "$page" Print Page to Screen (Better for copy & pasting with mouse)
echo "$page" | aspell -a Spell Check Page
lynx -dump "$arg" Dump a webpage, $arg will be the URL of the webpage to dump
When you press F7 within a Book, you will be prompted to chose a plugin to run (or enter your own command), and then prompted to choose wether to append the output or not to the current page.
There are many more potential commands which can extend the use of Cjots.
\NewEntry Bugs
\ID 8
KN0WN bugs in Cjots 0.82 at the time of writing:
* There is no way to put a literal '$date' or '$time' string in a page/book name, or a literal $file, $page or $arg string in a command / plugin.
* There is no way to have a literal tab within a shell command listed in the plugins file
* Books starting with a stop '.' in the filename will be invisible and not show up in the list.
* If by complete chance you write the string \NewEntry starting on a new line, it will cause the book to be parsed differently next time it is loaded and it will split the page around either side of that line. This can actually be used as a method to split a page. No data will be lost.
* The merging function needs extra work to contol the input. Care should be taken to enter the number correctly when prompted. Any lost text can be recovered by pressing F12 from within the Text Editor. Do NOT press F11 first.
* The selected book and page dont always show as Selected when your in the Editor pane
* There seems to be a problem with cutting, copying and pasting pages under certain circumstances
Notify the author of any further bugs you find:
jesse.read AT gmail.com
\NewEntry Todo
\ID 9
Some things which will be appearing in future versions.
* Auto save with every character or line typed
* Search function
* Scrollbars
* A way to skip through pages from the Editor without going back to the Page List
* 'Exporting' could be better done as a plugin
* Allow use of other editors e.g. VIM to edit pages
* Being able to see the Page List of each book from the Book List without selecting the book first
* Remember the last page open (as well as the last book) when starting Cjots
* Accept some command line arguments
* Esc as well as F4 usabele to return to the Book List, and to return to previously selected book
* Make a Spanish version of everything
* Take care of the situation where there are two instances of Cjots running at once
Anything else you want? Email the author jesse.read AT gmail.com to request a feature for the next version.
\NewEntry FAQ / Troubleshooting
\ID 10
Q: I'm getting a 'Your screen is too small..' message when I start Cjots
A: In your .cjotsrc file, set 'toc' and 'max_bookshelf_height' to smaller values.
Q: The Escape Key does't work for returning to the Page list
A: Sometimes in the terminal you have to hit it twice, and there is a delay. Use F5 Instead, or the HOME key.
Other problems? Questions that need Answering? Email the Author: jesse.read AT gmail.com
\NewEntry Appendix - Key Commands Available in the Editor
\ID 11
See Editor Commands