All contributions in this site reflect the authors' opinions and they are not necessarily endorsed by, or reflect the beliefs of, anarchyinthetubes, as neither do most of the opinions in other sites.

cat-v (mirror)

Hit 2.0
=======

General rules
-------------

All content is treated literally, and all HTML special chars are escaped when
converting to HTML.  This means that by design there is no way to insert raw
HTML into the template output, this means that both < and & can be entered
literally without any problems.

Anything that doesn't fit the syntax will be taken literally.  The rules are
designed to avoid the need of escaping or bad formating due to mistakes, this
comes at the cost of requiring one to be a bit more explicit in some corner
cases.



Block Elements
--------------

### Paragraphs and line breaks

Same as [markdown]{}


### Headers

Same as [markdown]{}

In HTML all headers automatically get an id attribute set to `HEADER_TEXT`
where all text is made uppercase and underscores replace spaces.  This allows to
easily link to specific sections of the document.


### Block Quotes

Same as [markdown]{}


### Lists

Lists elements can span a single line that should start by an * followed by any
spaces or tabs and then text.

    * This is one item.
    * This is another.

* This is one item.
* This is another.

Numbered lists have a dot following the *.

*.  Item one.
*.  Item two.

To nest lists use four spaces or tabs.  A list block ends in any line that is not
a list element.


### Code blocks

Same as [markdown]{}


### Horizontal rules

A horizontal rule is inserted in lines that contain three or more alternating
hyphens and spaces.  It should start with a hyphen.

    - - -
    - - - - -


- - -
- - - - -

### Images

See [links and images]{#}.

### Tables

Tables take the form

    { cell1 | cell2 | cell3 }
    { row2 cell1 | row2 cell 2 | row 2 cell 3 }

{ cell1 | cell2 | cell3 }
{ row2 cell1 | row2 cell 2 | row 2 cell 3 }

All rows should have the same number of cells(a way to have multi-col cells
might be added later).  At least one space or tab should separate the content of
the cell from the delimiters.

To set the alignment of the cell content the following heuristic is used:

*.  More than one blank to the left and right: align center.
*.  Only one blank both left and right: align center;
*.  A single blank to the left and many to the right: align left.
*.  A single blank to the right and many to the left: align right.

Example:

    { *column one* | *column 2* | *column 3* }
    { left | center | right }
    { right | left | center }

{ *column one* | *column 2* | *column 3* }
{ left | center | right }
{ right | left | center }



Inline elements
---------------

### Links and images

[a text link]{target}
[!img.jpg An image with a link]{target2}
[!/path/to/img.jpg An image]{}

In non-image links, if target is an empty string, the text of the link is used
instead, if target is the character `#`, the text of the link converted to all
uppercase will be appended to the `#` with all spaces replaced by `_`.

Non fully qualified links that don't start with / or # are first looked up
against local document reference names, and if no match is found, they are used
as links relative to the document.

In images, the text that follows the path is used both as `alt` and `title`.

XXX

### Emphasis

Use surround a word or words with * for emphasis(<em> in in html terms), **
for
extra emphasis(html's <strong>), and *** for maximum
emphasis(<em><strong>).

The opening *s should at the start of line or be preceded by a space or tab,
the closing *s should not be followed by alpha-numeric characters.  You can't
emphasize partial words.

Emphasis can only span a single line and the number of * should be properly
balanced.

### Inline code

To escape any inline text, surround it by backticks, to insert a literal backtick
(inside or outside backticks) use two backticks.

    In `hit` you link like this: `[foo]{bar}`
    Here is a backtick ``, and here is one `inside { some quoted `` } code`.

XXX Actually this creates an ambiguous case if you want code to start with a
backtick


Other
-----

### Index

XXX

Construct a nested list of links to the header hierarchy of the document.

@INDEX@


### Automatic links

All URLs starting with http:// or https:// are automatically converted into links.



@[markdown] http://daringfireball.net/projects/markdown/syntax
original page
cat.4l77.com