Last active
August 29, 2015 14:27
-
-
Save davidgiven/91750dbcdd73be10761d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Welcome to WordGrinder
Important note for Windows users
WordGrinder is a port of a Unix program, and a few things don’t map well onto the way Windows works. There are some things you need to know.
There’s more information on using WordGrinder with Windows further down in this file.
Introduction
WordGrinder is a word processor for processing words.
WordGrinder is not WYSIWYG. It is not point and click. It is not a desktop publisher. It is not a text editor. It is not do fonts and it barely does styles.
What it does do is words. It’s designed for writing text. It gets out of your way and lets you type.
Survival Guide
All your favourite navigation keys should work. Just type and it should do the right thing.
Important things you need to know:
You can load and save files using the File menu. A Document Set is a file on disk. Each file can contain multiple Documents. Pay careful attention to whether WordGrinder is talking about Documents or Document Sets. There’s more information below.
Some operations (applying character styles, cut and paste) require you to select text. To do this, move to one end of the area to mark; press CTRL+SPACE; move to the other end. The operation will be applied to the highlighted text between the mark and the cursor. Note that the marks are always placed on the left side of the cursor. Pressing CTRL+SPACE again will remove the marks.
That’s it. Now you can work WordGrinder.
Styles
Character styles
WordGrinder supports the following character styles:
That’s all. To apply them, select some text and then use Style_→_Italic (CTRL+I) or Style_→_Underline (CTRL+B) to apply. To remove styles, use Style_→_Plain (CTRL+O). When you type type new text, it will always appear unstyled (even if in the middle of a styled word).
Tip: to type a new word in a particular character style, make sure nothing’s selected, press CTRL+I, CTRL+B or CTRL+U to toggle the insertion state (look down at the right hand side of the status bar), and then type.
Paragraph styles
WordGrinder supports a number of paragraph styles. See Style_→_Paragraph Styles (CTRL+P) for the list. Each style applies to a complete paragraph. If you want to see what style each paragraph has set, use Style_→_Set Margin Mode_→_Show Paragraph Styles. The style names will be displayed in the left-hand margin.
Paragraph styles are not currently customisable, but they may become so in the future.
The RAW paragraph style is interesting as it allows you to embed arbitrary chunks of data into your document which, when exported, are emitted intact into the output file. I use this to insert HTML into documents I’m writing.
Documents and Document Sets
Each WordGrinder file can contain multiple pieces of text. A file is referred to as a Document Set; each piece of text within the Document Set is a Document.
You can have as many documents in a document set as you like (within reason). You can manage them using the File_→_Manage Documents... menu item, and can quickly see and switch between documents using the Documents menu (ESC, D).
Documents have their own text, selection, viewing style, cursor position, etc. The clipboard, however, is shared across the entire document set. This allows you to move pieces of text around within the document set using the clipboard.
Importing non-WordGrinder files always results in a new document being added to the current document set.
Menu customisation
You can change any of the keyboard shortcuts assigned to menu items. These are then saved as part of the document set, so each WordGrinder file takes its keyboard configuration with it.
To do this, open the menu, navigate to the entry you want to change, and then press CTRL+V followed by the key you want to bind. You can’t bind the text entry keys. You also can’t bind a key that’s already in use elsewhere. You can remove a binding by navigating to the appropriate menu item and pressing CTRL+X. You have to manually remove a binding from a menu item before you can bind a different key to it. Watch the status bar while a menu’s open for reminders.
All WordGrinder keybindings (except ESC, and menu and dialogue navigation) appear on the menus, so they’re all configurable. Things like the cursor keys appear in the Navigation menu.
If you get irrecoverably confused, you can reset all the keybindings by opening a menu and doing CTRL+R.
Note: WordGrinder’s keyboard support is at the mercy of which keys your platform supports, and this can vary wildly from platform to platform. For example, on some platforms that use ncurses it doesn’t seem possible to bind CTRL+arrow keys. In addition, some platforms have keys that I don’t know about. WordGrinder will support these, but they’ll be labelled as UNKNOWN_1234 or similar. If this happens to you, please get in touch so I can make it display a sensible name.
Importing
If you don’t want to write a document from scratch in WordGrinder, it’s possible to import documents in a small number of other formats using File_→_Import new document. These all add a new document to the existing document set, rather than replacing the current one. The followng formats are available:
..
become paragraph styles H1 to H4; all
or
.
Exporting
Once you’re done with your document, you can export it to a small but growing variety of other formats using the File_→_Export current document menu option. The following formats are available:
.
Manually configuring WordGrinder
All WordGrinder configuration optiosn are automatically saved with your document set. All of them. Menu bindings, settings, etc; you can change them through the user interface and they’ll be saved into the file and reloaded later.
However, there is also a mechanism for allowing these settings to be overridden. I use this to have different keybindings on machines with different keyboards. It is currently very clunky and under development, and so may change without notice.
To use, run this command:
This will show the command line options, and at the bottom will tell you where your configuration file lives. Open this in a (non-Wordgrinder) text editor.
Now run:
WordGrinder will display all the menu items it knows about, plus their menu ID. You can now enter lines like this in your configuration file:
...where the first item is the key to override, and the second is the menu ID over the thing you want to happen when the key is pressed.
These settings override any document set settings, but they are not saved with the document set --- if you load the document set into an instance of WordGrinder which doesn’t have that configuration file available, the standard keybindings apply. The settings are not shown in the menus and rebinding menu items will not affect them.
Some global settings use variables. Change these with:
This whole area needs some work. We apologise for the inconvenience.
Platforms
WordGrinder can be used on several platforms.
Unix terminal
WordGrinder will run in a terminal on practically any Unix platform with a modern curses library; I use Linux with ncurses.
Underlined text is displayed underlined. Italicised text will be displayed in italics if you have a curses which is new enough, if your terminal supports italics, and if WordGrinder can figure out that your terminal supports italics; otherwise it will be displayed highlighted. Bold text... is also display highlighted. Sorry. That’s the best ncurses can do.
ncurses’ keyboard support is hugely variant on what terminal you’re using, and some terminals don’t support things like SHIFT+UP/DOWN, CTRL+arrows, SHIFT+function keys, etc. In addition, ncurses enforces a one second delay when responding to the ESCAPE key. This is really annoying, but can be avoided by using ALT+letter instead.
You will also need a decent terminal emulator with Unicode support. I use xfce4-terminal with the Terminus font.
Unix X11
There is also a specific version of WordGrinder which will run natively on X. You get antialiased fonts, configurable colours, underline, bold and italicised text being displayed natively as underline, bold and italics, and most key combinations work (including SHIFT+CTRL+cursor keys).
Unicode support is not so great as font substitution is not done, so you’re at the mercy of whatever glyphs your font supports. If Unicode is important to you, use a font like Unifont which good Unicode coverage.
Configuration is done by setting values in your configuration file (which is not very user friendly; sorry). See the section above on manually configuring WordGrinder. Set the following variables:
Apple OS X
The Unix build of WordGrinder will run happily on OS X, in a Terminal window, behaving exactly like any other Unix system.
For best use it’s recommended that you turn on the ‘Use Option as meta key’ setting in Terminal (it’s in Preferences->Keyboard). This will let you use ALT+letter to open menus. Without it you have to use ESC. Personally I think that the Homebrew or Pro themes for Terminal look best with WordGrinder, although you’ll most likely need to increase the font size.
Fullscreen mode works very well.
Windows
WordGrinder will also run as a Window application. Some menu options have been added to the titlebar menu (single click on the icon on the top-left corner of the screen) to allow you to change the font and toggle full-screen mode on and off; this last may also be done with ALT+ENTER (note that this is not rebindable).
Underline, bold and italics are displayed as underline, bold and italics.
The Windows version provides good keyboard support and most key combinations are supported.
WordGrinder will do its best to display Unicode characters. If the font you choose does not contain a particular glyph, WordGrinder will attempt to find a glyph from the closest matching font. Unfortunately this works quite badly with bitmap fonts, resulting in quite ugly results, but it does work.
I strongly suggest installing a decent TrueType Unicode monospaced font. Consolas is good and is supplied by default on most Windows systems, but I like DejaVu Sans Mono:
http://dejavu.sourceforge.net/wiki/index.php/Download
Neat features
Table of contents
In a document containing structured content (like this one), you can use Edit_→_Goto to bring up a dialogue showing an outline of the document and which allows you to jump quickly to any heading in it.
Undo
WordGrinder will remember every change you make, up to a limit of about 500. Use CTRL+Z to undo, and then CTRL+Y to redo an undone change. You can only use redo if you haven’t made any changes in the mean time, as usual.
The undo stack is not saved along with your document --- the undo stack always starts as empty when a document is loaded. (Because otherwise the files get stupidly big, and very slow to load and save.)
Autosave
WordGrinder also has a feature that will save a timestamped snapshot of your document set periodically. This is disabled by default; to enable this, go to File_→_Settings_→_Autosave. You can specify how long between snapshots and what filename pattern you want WordGrinder to use.
Note that autosaving will only happen if you don’t touch the keyboard for a few seconds, to prevent a dialogue box from being popped up just as you’re about to press a key. Autosaving will also only happen if your document set contains unsaved changes. (In this situation, autosaving does not count as saving your changes, and your document set will remain dirty.)
Unicode
WordGrinder supports UNICODE!
(If you see a bunch of boxes in the above line, it means that your platform doesn’t support displaying exotic Unicode characters. WordGrinder will still let you edit them, you just won’t be able to see what you’re doing.)
Mostly, at any rate. Combining characters and right-to-left are unsupported. This means that you can use, say, Français, русский язык, 한국어 and 日本語, but you can’t use Arabic or Hebrew because they end up mangled (العربية and עברית respectively). You can use line art but that’s not what WordGrinder’s for and it’ll probably work badly.
Unfortunately, how to actually enter Unicode characters is entirely up to your operating system and your terminal application. WordGrinder can’t help you there.
This document set contains a Unicode test document containing a rather more strenuous workout than the above paragraph; see the Documents menu.
Scrapbook
The Edit_→_Scrapbook provides various options to allow you to quickly copy fragments of document to a scrapbook document. Fragments get appended onto the end of the scrapbook with an optional timestamp; this is configurable in File_→_Settings_→_Scrapbook. (The scrapbook itself is just another document; you can even copy things to the scrapbook while viewing it, but it probably won’t behave the way you want!)
Page count
For some applications it’s important to know --- roughly --- how many pages you’ve written, rather than how many words. WordGrinder doesn’t know what pages are, but there’s a feature to allow you to show you a rough estimate as to how many pages you’ve got based on the number of words. See File_→_Settings_→_Page Count.
Widescreen mode
Running WordGrinder full screen on a widescreen monitor is typically pretty uncomfortable, as you end up with very long lines. Widescreen mode allows you to restrict the text to a column in the centre of the screen. (Dialogue boxes are not affected.) See File_→_Settings_→_Widescreen mode. I find that 80 or 100 columns is the most comfortable.
Smart quotes
WordGrinder supports smart quotation marks, “like this” or ‘like this’. To turn on, see File_→_Settings_→_Smart quotes. It’ll convert them when you type, or when you paste into your document. To bulk convert text, simply copy it into the clipboard and paste it back again. You can change the characters used for quotation marks (which is useful if, e.g. «you’re French»).
Command line
There are some WordGrinder features which can be used from the command line, both on Unix and Windows. Firstly, it’s completely scriptable in Lua: write a file in Lua, then run WordGrinder with wordgrinder --lua filename.lua and it’ll run and then exit. Or use wordgrinder --lua "lua command". Nearly all of WordGrinder is written in Lua and it’s all available via this interface. The API is, unfortunately, beyond the scope of this document; if you’re interested, ask the author (or look at the source code).
Secondly, the file .wordgrinder.lua in your home directory will be automatically loaded and run whenever WordGrinder starts; see the section above on configuring WordGrinder for information.
Thirdly, you can use WordGrinder to automatically convert between any supported document formats. For example:
...will convert the default document in sourcefile.wg to OpenDocument format.
See wordgrinder --help for more information.
When Things Go Wrong
Is WordGrinder behaving funny? Did it just crash?
If so, please get in touch. Software shouldn’t crash, and if you tell me about it, I will fix it so it won’t. (Probably.)
When reporting bugs, it will make my life considerably easier if you can (a) duplicate the bug, and (b) show me the stack trace produced by the debug version of WordGrinder. (Windows users should get in touch and I’ll send you a copy of the debug version, and show you how to get at the stack trace.) Without these, I’m afraid there’s not a lot I can do.