Writeup 2.5 Quick Reference Guide

Writeup 2.5 Quick Reference Guide

Last updated on 2013-12-23 at 01:23:45 by Andrew Fountain for version 2.50.00 (2013-12-23)

Table of Contents

1. Markup Language

Writeup is a tool for generating content. It takes a plain text file and processes it into HTML

1. Markup Language

1.1 Inline Character Markup

  • Note that the effect of each markup is completely redefinable
Emphasize/italic: _underscore_ defaults to em (italic) unless alphanumeric_both2_sides underscore defaults to em (italic) unless alphanumeric_both2_sides
Bold/strong: *asterisks* default to strong (bold) text asterisks default to strong (bold) text
Smart quotes can be supressed using $smartquotes variable: 'single, "double" <<angle>> & apostrophe's glyph ‘single, “double” «angle» & apostrophe’s glyph
en dash (medium): range 1--10 or if a space both -- sides. Force with ':-' e.g. May:-June range 1–10 or if a space both – sides. Force with ‘:-’ e.g. May–June
em dash (long): All other cases give em--dash. Using '---' e.g. 1---10 will force em-dash All other cases give em—dash. Using ‘—’ e.g. 1—10 will force em-dash
Three ways of getting a non-break space: Non-break space: (\/), ($SP) or (&nbsp;) Non-break space: ( ), ( ) or ( )
Hyperlinks: [[http://writeup.org]] no link text, or [[http://writeup.org with linking text]] writeup.org no link text,

or with linking text

Autolinks are turned on by default $autolinks=TRUE.
Delimited by any non-alphanum at start and whitespace at end:
http://gw.ca/link or https://gw.ca/xx or -http://gw.ca/. or (http://gw.ca/), But not xhttp://gw.ca or [[gw.ca within another link http://gw.ca]]. Note that any .,:;) characters at the end of the url will not be included in the link. gw.ca/link or gw.ca/xx or -gw.ca/. or (gw.ca/), But not xhttp://gw.ca or within another link http://gw.ca. Note that any .,:;) characters at the end of the url will not be included in the link.
Links longer than $autolinkslen are displayed abbreviated…: The link: http://gw.ca/content/long-link.of-meaningless-words is abbreviated. The link: gw.ca/…nk.of-meaningless-words is abbreviated.
Hyperlinks can span multiple lines, if / used to supress paragraph-per-line:
/[[http://gw.ca
...Linked heading
]]
heading
Mailto links are obfuscated by default to deter spammers. (Turn this off with $emailhide=FALSE: [[mailto:a@gw.ca]] a@gw.ca
MediaWiki style hyperlinks can be achieved by setting [=${LINK} and ]=</a>: MediaWiki style link [http://writeup.org with linking text] MediaWiki style link with linking text
Images: No alt/title text [[writeup32.png]] or with alt and title text [[writeup32.png Writeup logo]] No alt/title text image: writeup32.png or with alt and title text Writeup logo
Autolinks work in exactly the same way with images: Here is an image http://writeup.org/writeup32.png in the text Here is an image image: writeup32.png in the text
To link to an image, override the URL detection by setting $mediatype: $set $mediatype1=link [[writeup32.png This is a link to the image]]. This is a link to the image.
Using $hrefroot & $imgroot: See below in URL root and base values to see how url’s can have strings automatically prepended to them.

1.1.2 Special Characters

Will use literal character entities for < > & unless part of html structure: < > and & but <u>tag</u> and &#x25CF; and &reg;. < > and & but tag and ● and ®.
utf-8 characters and named/numbered entities can simply be inserted: UTF8: ⅞ Named entity: &pound; Numbered: &#x00A3; UTF8: ⅞ Named entity: £ Numbered: £

1.1.3 Escaped characters/sequences

Characters can be forced to be literal with ‘\’: \\ \* \$ \_ \a \ * $ _ a
To get $lt; &gt; $amp; &quot; &apos; &nbsp;: \< \> \& \" \' word\/word < > & " ' word word
Special cases for forcing non-escaped characters: \! \n | end-of-line
Hexadecimal single-byte characters or unicode (utf8): Hex: (\x7E) Unicode: \u25CF Hex: (~) Unicode: ●

1.1.4 Pre-defined symbols

  • Although these are considered constants, they can be re-assigned to a new value if necessary, e.g. a different asterisk character could be used or it could be wrapped in a span
Named character constants: $CENT $POUND $EURO $YEN $COPYRIGHT ¢ £ € ¥ ©
Fractions:
$QUARTER $HALF $THREEQUARTERS
$THIRD $TWOTHIRDS

¼ ½ ¾

⅓ ⅔

Punctuation:
$MDASH $NDASH
$LSQUO $RSQUO $LDQUO $RDQUO $LAQUO $RAQUO

— –

‘ ’ “ ” « »

Dots: $DOT $BULL $BULLET $ELIP · • ● …
Misc (note $SLASH == \x2F): $LT $GT $AMP $QUOT $APOS $SLASH $SLASHES < > & " ' / //
Others:
$ASTERISK $UNDERSCORE $UNDERLINE
$ATSYMBOL $CIRCUMFLEX $PERCENT $HASH $DOLLAR

* _ _

@ ^ % # $

Spaces:
non-break:($SP) or (\/)
em:($EMSP)
regular space: ($SPACE) or (\ )
null: ($NULL)
zero width space (for allowing word breaks): ($ZWSP)

non-break:( ) or ( )

em:( )

regular space: ( ) or ( )

null: ()

zero width space (for allowing word breaks): (​)

1.2 Line Breaks

  • Unless within a table (see below), a vertical bar | is identical to starting a new line
    • This is for convenience when it is easier to combine several lines together e.g. $if $test|*testing*|$endif
  • To get a vertical bar, use the $VB constant
  • To generate a newline within a function, use $VB or \n
  • To end a line with an HTML break <br />, simply end it with /
    • Alternatively the $BR constant can be used
  • A line that begins with just two minus signs -- will create a horizontal rule <hr />

  • If it begins with three --- then it will cause a page break. (This is accomplished by adding the css contained in the variable $pagebreakstyle (see below) to the subsequent block tag.

1.3 Block Markup

1.3.1 Headings

  • Note that in some situations a document that is included in another might need all its heading levels adjusted. e.g h1→h2 etc. This can be accomplished by setting $headingbase the value of which will be added to the heading level.
Heading tags 1–6 are supported:
...Heading level 3 (h3 tag)
.....Heading level 5 (h5 tag)
......Heading level 6 (h6 tag)

Heading level 3 (h3 tag)

Heading level 5 (h5 tag)
Heading level 6 (h6 tag)
if $headingbase is set, it is added to the level:
$set $headingbase=2 
.Heading level 3 (using only 1 dot)

Heading level 3 (using only 1 dot)

  • Note that if $autoclose is set to TRUE any open tags are closed at the end of the block with no error messages.

1.3.2 Lists

Ordered lists:
1. Can use a number
#. or default numbering
5. New numbering sequence
 A. indent to start nested list
 #. and so on
  i. upper or lower case or roman numerals
  ii. Any depth of list supported
 #. Indent one space per level of nesting
#. Back to top level
  1. Can use a number
  2. or default numbering
  3. New numbering sequence
    1. indent to start nested list
    2. and so on
      1. upper or lower case or roman numerals
      2. Any depth of list supported
    3. Indent one space per level of nesting
  4. Back to top level
Unordered lists:
-Simply use minus sign
 -and indentations
 a. Can be mixed with ordered lists
 b. to any depth
  -third level
  -and again
  • Simply use minus sign
    • and indentations
    1. Can be mixed with ordered lists
    2. to any depth
      • third level
      • and again
Plain lists

These are what GML called “simple lists” but the <sl> tag never made it into HTML so we fake it with <ol> and list-style-type:none;.

Set $plainlists FALSE to ignore whitespace at the start of lines.:

Plain list
 Simply indent
  one space per level
  and it works as expected.
 -It can also be used to add extra paragraphs
  to one of the other lists
Turn off plainlists $set $plainlists=FALSE 
   Indent ignored!

Plain list

  • Simply indent
    • one space per level
    • and it works as expected.
    • It can also be used to add extra paragraphs
      to one of the other lists

Turn off plainlists

Indent ignored!

Lists extras:
A blank line before a list item puts the "firstline" class on it:

-CSS can then be used to create extra space etc. e.g.: .firstline {margin-top: 6px;}
 -Sometimes a list level needs to be forcibly ended, and this can be done with a minus exclamation mark:
-!
-New list started

A blank line before a list item puts the “firstline” class on it:

  • CSS can then be used to create extra space etc. e.g.: .firstline {margin-top: 6px;}
    • Sometimes a list level needs to be forcibly ended, and this can be done with a minus exclamation mark:
  • New list started
  • Note: Plain lists are implemented with a <div class="plainlist" style="margin-left:40px;". The inline style is included in case no CSS is set, but can be suppressed using $unset $div_plainlist_style.

1.3.3 Tables

Tables are started and ended with four hyphens:
----
| table cell | table cell |
| table cell | table cell |
----
table cell table cell
table cell table cell
The top cells can be headings by adding a “t”:
----t
| table head | table head |
| table cell | table cell |
----
table head table head
table cell table cell
The left by adding “l”, or both with “tl”:
----tl
| table head | table head | table head |
| table head | table cell | table cell |
----
table head table head table head
table head table cell table cell
Tables can also be created using a line (or multiple lines) per cell.
  • --cell at the line start creates a new cell.
  • ----row will start a new row.
  • Cell content can be on the same and/or following lines.
  • first ----row in table is optional.:
----t
every line
is in a cell
--cell Then the next cell
--cell and
a third cell
----row A new row
implicitly a new cell
--cell second column
--cell third column
----row
--cell and
--cell one more
--cell row
----

every line

is in a cell

Then the next cell

and

a third cell

A new row

implicitly a new cell

second column

third column

and

one more

row

1.4 Comments

Anything after a // on the line is commented out: Anything after a // on the line is commented out Anything after a
Block /* comments */ work as expected: Anything between /* on the line */ is commented out Anything between is commented out
HTML comments can simply be inserted: <!--Here is an HTML comment.-->
Hard comments will not even appear in the html: The <!!comment!!> will be removed The will be removed
They can also be inserted programmatically: $set $a=<!! $set $b=!!> The $a disappearing $b word The word

1.5 Inline Code and Pre

1.5.1 <code> and <pre>

  • Surrounding inline text with <( and )> will
    • cause all markup to be escaped, e.g. <span>
    • surround the text with <code> ... </code>
  • If the <( )> block surrounds the whole line, or multiple lines, then the <pre> tag will be used, e.g.
<p>this block is <em>all</em> a <pre> tag
and can be multiple lines</p>

1.5.2 Inline code (passed through raw)