Recent Changes - Search:

Home Pages Pidgin   Azarennya (S|N) Mac Textanium Reference ToDo Food Local Edit

Local: Hide

Language: Hide

Fantasy: Hide

SciFi: Hide

Film: Hide

Music: Hide

REALbasic: Hide

ResourcesGarageUniversityWebRingForums:REALElfDataPlugins and Code:BKeeneyDeclareSubEinhugurJoeRestrepoTempelmannZAZ

Coding: Hide

Forums:PowWebPHPWebmasterCodingWalkersPerlIntroMonksPHPJavaScriptToolboxUnobtrusiveJavaScriptJavaScriptCompressorRegularExpressions (test)JSLintSQLCocoaCocoaBuilderCocoaDevCocoaLabAppleScriptBBSUserlandFaqintoshFileMakerFileMakerTipsFileMakerWorldFileMakerPlugins

Science: Hide

History: Hide

1421

News/Politics: Hide

Cults/Crime: Hide

ClambakeInfidels

Miscellaneous: Hide

MarkupLinoleum

JustTextAndTables?

Line types

In Linoleum, each line (after being trimmed) begins either with a regular text character (a letter, number, underscore, or single or double quote), or it begins with a special ASCII character, which indicates that the line isn't just ordinary text, but a particular type of text container:

  • * Bulleted item. One asterisk indicates a top-level bulleted item. Two indicate a second-level item, and so on.
  • # Numbered item. One hash mark indicates a top-level numbered item. Two indicate a second-level item, and so on.
  • \ Line of text. The backslash allows a text line to begin with a character that would otherwise signal something other than a text line.
  • % Table cell. One percent sign signals a table cell (<td>). Two indicate a new row (<tr>). (Might also want to indicate table headers.)
  • > Blockquote. One greater-than sign signals a blockquote. Two or more indicate nested quotes.
  • ^ Merged line. The caret merges the current line with the previous one. Thus a single bulleted item, for example, can span more than one line.
  • ; Comment. This allows you to put comments in the Wiki text that do not show up in the web page.
  • $ Code. This produces a <pre> section.
  • ! HTML. This allows HTML, PHP, etc. to pass unchanged into the finished page. (The Wiki can put security restrictions on such lines, so that only certain people are allowed to use this.)

Rules

  • Each line type (except the merged line) "shuts off" the context established by previous types. Thus a bulleted item closes whatever paragraph, table, blockquote, comment, code section, or HTML section was already open, and opens a new unordered list. (The exception is the comment, which does NOT close the current section.)
  • One or more nonblank lines of text are merged into a paragraph (enclosed in <p>...</p> tags). Use blank lines to separate paragraphs.
  • One or more blockquote lines are merged into a blockquote (enclosed in <blockquote>...</blockquote> tags). Use blank blockquote lines (">" on a line by itself) to break a blockquote up into paragraphs. Use ">-" to mark a right-aligned line of text in a blockquote.

Formatting within lines

Formatting remains within a line. Any formatting and any command not closed before the end of the line will be closed automatically at the end of the line by the Wiki software.

  • ''Italic'', '''bold''', and '''''bold italic'''''.
  • [[Links]].
  • &#HTML entities.
  • [Bracketed commands]. This is to allow custom formatting commands, such as "[film Star Wars]" automatically creating a link to IMDB.com or to Netflix.

Coding

Coding thus becomes fairly simple. The Wiki text is processed line-by-line. The processor need only track the type of the previous line to decide what HTML tags to output.

Closing previous sections:

  • Output </p> if previous section was text.
  • Output </tr> if previous section was a table (whether new section is a new row or something that isn't a table).
  • Output </table> if previous section was a table (and new section is not).
  • Output </p></blockquote> if previous section was a blockquote.
  • Output </pre> if previous section was code.
  • Output </ul> if previous section was a bullet list.
  • Output </ol> if previous section was a numbered list.
  • Output nothing if previous section was a comment or an HTML section.

Handling nested-and-mixed bulleted and numbered lists might be a challenge, but doable. (Bulleted and numbered lists and blockquotes can be nested, and the number of asterisks, hash marks, or greater-than signs indicate the number of HTML tags to output.)

Edit - History - Print - Recent Changes - Search
Page last modified on February 04, 2008, at 01:46 PM