Text Formatting

Silki uses an extended dialect of the Markdown text formatting language. Markdown is designed to be a natural language for adding formatting to plain text.

Paragraphs

A paragraph is one or more lines of text. Paragraphs are separated by a blank line.

<&| .markdown-and-output, keep_paras => 1 &> This is a paragraph. It has several sentences. It also has a line break. This is a separate paragraph consisting of a single sentence on two lines.

Headers

We recommend that you don't use first-level headers in pages. The page title itself should serve as the first-level header. Inside the page, start with second-level headers and work from there.

Headers come in two variants. underlined and prefixed. The underlined variant puts the header text on one line and the header markers on the next:

<&| .markdown-and-output, fixed => 1 &> Second-level Header -------------------

You can also create headers by prefixing the text with hash marks (#):

<&| .markdown-and-output &> ## Second-level Header ### Third-level Header

Wiki Links

Linking a page in the same wiki is simple, just wrap the page title in double parentheses:

((Page Title))

If you want to link to a page in another wiki on the same server, you need to include the wiki name with the page name, separated by a slash (/):

((Other Wiki/Page Title))

External Links

When linking to an external site, you can set the link text (the text people see in the page), and the URL:

<&| .markdown-and-output &> [a great directory of veg-friendly restaurants](http://www.vegguide.org)

If you just want to put a URL in the text, wrap it in angle brackets:

<&| .markdown-and-output &>

Linking to Files

You can link to files in the current wiki, or any other wiki you have access to.

Take a look at the PDF: {{file: file.pdf}}

Take a look at the PDF: file.pdf

If you want to change the link text, put the link text in square brackets before the link:

Take a look at [the attached PDF]{{file: file.pdf}}

Take a look at the attached PDF

You can also link to files in other wikis. Of course, if a user viewing the page does not have access to the other wiki, they won't be able to see the file.

Take a look at the PDF: {{file: Other Wiki/file.pdf}}

Take a look at the PDF: file.pdf

Linking to Images

Image links look like file links, but they embed the image in the wiki page:

The attached logo: {{image: logo.png}}

The attached logo: vegguide-logo.png

The image will be scaled down so that is no wider than 400 pixels, and no taller than 150 pixels. The image will also link to a larger version of itself.

Bold and Italics

To make some text bold, wrap it with two asterisks (**):

<&| .markdown-and-output &> A **bold chunk** in the middle.

To make text italic, wrap it with one asterisk (*):

<&| .markdown-and-output &> An *italic chunk* in the middle.

You can also mix these italics and bold:

<&| .markdown-and-output &> A *ridiculously **strong piece of text***!

Lists

You can create bullet lists and numbered lists by prefixing each line with either a bullet (*) or a number (1., 2.).

<&| .markdown-and-output &> * Bullet 1 * Bullet 2 <&| .markdown-and-output &> 1. Number 1 2. Number 2

You can also nest lists using indentation:

<&| .markdown-and-output &> * 1-A * 1-B * 2-B * 3-B * 1-C * 2-C * three * 1-D

Tables

Silki extends Markdown to add table support. A table can have an optional set of header rows, a body, and an optional caption. Here's a basic table:

<&| .markdown-and-output, fixed => 1 &> +-------------+------------------------------+--------+ | name | description | price | +-------------+------------------------------+--------+ | gizmo | Takes care of the doohickies | 1.99 | | doodad | Collects *gizmos* | 23.80 | | dojigger | Foo | 102.98 | | thingamabob | Self-explanatory, no? | 0.99 | +-------------+------------------------------+--------+

The header rows are marked off by a line consisting only of "+---+". You can have multiple header rows:

<&| .markdown-and-output, fixed => 1 &> +-------------+-------+--------+---------+ | Location || Services || +-------------+-------+--------+---------+ | City | State | Sales? | Repair? | +-------------+-------+--------+---------+ | Minneapolis | MN | Yes | Yes | | Chicago | IL | Yes | No | | Columbus | OH | No | No | +-------------+-------+--------+---------+

This example also demonstrates column grouping. By putting two column separators next to each other ("||"), we can group cells together.

Header rows are not required, nor are the markers at the beginning and end of the table:

<&| .markdown-and-output, fixed => 1 &> [Locations and Services] | Minneapolis | MN | Yes | Yes | | Chicago | IL | Yes | No | | Columbus | OH | No | No |

The text in brackets ("[...]") is the table's caption.

By default, text in a cell is left-aligned. By adding appropriate whitespace, you can cause the cell to be centered or right-aligned:

<&| .markdown-and-output, fixed => 1 &> | Left | Center | Right | | Longer text | For contrast | And cell width |

Blockquotes

Use a blockquote for extended quotes of material from somewhere else. A blockquote is created by prefixing each line with an greater-than (>):

<&| .markdown-and-output, keep_paras => 1 &> > This is our hope. This is the faith that I go > back to the South with. With this faith we will > be able to hew out of the mountain of despair > a stone of hope. With this faith we will be > able to transform the jangling discords of > our nation into a beautiful symphony of > brotherhood. With this faith we will be able > to work together, to pray together, to > struggle together, to go to jail together, > to stand up for freedom together, knowing > that we will be free one day. > > -- Martin Luther King, Jr.

Horizontal Rule

You can insert a horizontal rule into a page by inserting four or more dashes (-) surrounded by blank lines

<&| .markdown-and-output &> Content ... ---- More content ...

Monospace / Code

If you want to insert code (monospaced text) inside some text, you can surround it by backticks (`). If you want a standalone pre-formatted monospace block, simply indent each line by four spaces:

<&| .markdown-and-output &> To set the variable `$foo`, write `$foo = $value`. <&| .markdown-and-output, fixed => 1, &> while ( $x > 1 ) { .... }

More Info

We have purposely only documented a part of the full Markdown specification here, in order to keep things simple. However, we do support the full Markdown language.

<%once> my $simple = Markdent::Simple::Fragment->new(); <%def .markdown-and-output>
<% $markdown %>
<% $formatted | n %>
<%args> $fixed => 0 $keep_paras => 0 <%init> my $markdown = $m->content(); my $formatted = $simple->markdown_to_html( markdown => $markdown, dialect => 'Theory' ); $formatted =~ s{

|

}{}g unless $keep_paras;