Scratch - A Simple Text Formatting Processor

Manual

3. Users Guide

The Users Guide contains information about Scratch for end users, such as CMS Authors, Weblog posters, etc.

3.1. Syntax

Scratch's syntax is designed to mimic the punctuation you would apply to prose to imply semantics such as emphasis and lists. Its goal is to impact the text you are writing as little as possible in its simplest form.

On the flip side Scratch's syntax will allow you to apply complicated styles and classes to elements for advanced users, but with the trade-off that readability declines

The markup in scratch is divided into two categories, Block Elements and Inline Elements.

3.1.1. Block Elements

Block Elements in Scratch are like paragraphs. They are tags which are supposed to apply to a whole paragraph (or block) or text. Hence Block elements will always start at the very beguinning of the block and apply a style to the end of the paragraph.

Scratch defines a paragraph as a block of text that starts with a blank line (or the start of the document) and ends with a blank line (or the end of the document).

3.1.1.1. Header

The Header tag is used for generating headers. Headers come in sizes ranging from 1 to 6, where 1 is the most important and 6 is the least important.

The HTML 4.01 spec has this to say about headers:

A heading element briefly describes the topic of the section it introduces. Heading information may be used by user agents, for example, to construct a table of contents for a document automatically.

Headers should not be used purely for look and feel, but to imply that a piece of text is a header. This information is used by search engines and screen readers for users with disabilities, and incorrectly labeling text as a header causes confusion.

Syntax

hx. text goes here

Examples

h1. My Big Header → <h1>My Big Header</h1>

My Big Header

More information in the W3 Recommendations

3.1.1.2. Paragraph

The paragraph tag can be used to explicitly delimit a paragraph. Scratch will automatically wrap paragraphs in the paragraph tag, so the only time you would want to use this tag is so that you can apply attributes to a paragraph.

Syntax

p. a paragraph about something goes here

Examples

p{color:red}. my paragraph → <p style="color:red">my paragraph</p>

my paragraph

More information in the W3 Recommendations

3.1.1.3. Blockquote

The blockquote tag is used for denoting a block of quoted text.

Syntax

bq. the quote goes here

Examples

bq. They went in single file, running like hounds on a strong scent, and an eager light was in their eyes. Nearly due west the broad swath of the marching Orcs tramped its ugly slot; the sweet grass of Rohan had been bruised and blackened as they passed. → <bq><p>They went in single file, running like hounds on a strong scent, and an eager light was in their eyes. Nearly due west the broad swath of the marching Orcs tramped its ugly slot; the sweet grass of Rohan had been bruised and blackened as they passed.</p></bq>

They went in single file, running like hounds on a strong scent, and an eager light was in their eyes. Nearly due west the broad swath of the marching Orcs tramped its ugly slot; the sweet grass of Rohan had been bruised and blackened as they passed.

More information in the W3 Recommendations

3.1.1.4. Footnote

A footnote is a way of creating a footnote and referencing it in text. A footnote is made up of two parts, the actual footnote and the reference to it.

Footnotes are numerically referenced, so a footnote reference of [1] must match up to a footnote declaration of fn1.

Note that a footnote defenition is a block element, but a footnote reference is technically an inline element as it can occur following any text
Syntax

Footnote: fnx. the footnote goes here

Reference: sometext[x]

Examples

fn1. Note that this is a footnote → <p id="footnote1"><sup>1</sup> Note that this is a footnote</p>

1 Note that this is a footnote.

3.1.1.5. Ordered List

An ordered list is a series of elements that should appear in a numbered list. Sublists can be done by simply indenting the sublist.

Syntax

#list item 1
#list item 2
#list item 3

Examples

#list item 1
#list item 2
#list item 3
→ <ol><li>list item 1</li><li>list item 3</li> <li>list item 3</li></ol>

  1. list item 1
  2. list item 2
  3. list item 3

More information in the W3 Recommendations

3.1.1.6. Unordered List

An unordered list is a series of elements that should appear in a list. Sublists can be done by simply indenting the sublist.

Syntax

*list item 1
*list item 2
*list item 3

Examples

*list item 1
*list item 2
*list item 3
→ <ul><li>list item 1</li><li>list item 3</li> <li>list item 3</li></ul>

  • list item 1
  • list item 2
  • list item 3

More information in the W3 Recommendations

3.1.2. Inline Elements

Inline elements in scratch may occur within Block Elements or within any text