Ideas for a Custom Version of Crimson Editor

From Project Gutenberg, the first producer of free electronic books (ebooks).

Jump to: navigation, search

Crimson Editoris free and open source. It is being developed under its original name at the Emerald Editorsite at sourceforge. A version could be developed which is optimized for proofreading and any other uses related to Project Gutenberg.

Ideas for Features and Improvements

Highlighting Guide

It needs three different types of ranges:

  1. Based strictly on character class: alphabetic characters versus punctuation and digits
  2. Both beginnings and ends using the same marker, such as quoted text.
  3. Each end using different markers, such as braces, parentheses and some multi-character markers.

Background colors should only be used for text within ranges other than quoted text. All ranges delimited by markers should be global and fully nestable. It should detect improperly nested markers and alert the user.

Suitable efficiency for highlighting should be obtainable by maintaining an array of on/off events for all supported ranges. An element of the event array would consist of an 8-bit code for the event and 24 bits for the line number, for a total of 32 bits per element:
struct RANGEEVENT {
	unsigned int code: 8;
	unsigned int line: 24;
};

For highlighting purposes, there's no need to store the character positions where the events occur. All range markers would be retained in the text, of course. 24 bits can store values up to 16,777,216, which should be plenty for line numbers. Using this method should result in very fast code and be fairly easy to implement.

Sample on/off codes for ranges (except letters and delimiters). For "off" events, a code's MSB is set to zero.
#define BoldOn			0x80
#define BoldOff			0x00
#define ItalicsOn		0x81
#define ItalicsOff		0x01
#define DblQuoteOn		0x82
#define DblQuoteOff		0x02
#define SnglQuoteOn		0x83
#define SnglQuoteOff		0x03
#define IllustOn		0x84
#define IllustOff		0x04
#define ParenOn			0x85
#define ParenOff		0x05
#define SquareOn		0x86
#define SquareOff		0x06
#define CurlyOn			0x87
#define CurlyOff		0x07
#define AngleOn			0x88
#define AngleOff		0x08
#define ContentsOn		0x89
#define ContentsOff		0x09

There needs to be separate codes for each alternative markup styles.

Codes for Other Types of Content to Provide Markers For:
#define Book			0xC0
#define Volume			0xC1
#define Section			0xC2
#define Chapter			0xC3
#define Extra			0xC4 // copyright, producer notes and so on...
#define BkMark			0xC5
#define Error			0xC6
#define Spell			0xC7

It should support at least one group of keywords to use as temporary markers by automatic error checking code.

Links