View Tutorial Metadata Edit Content Revision History Add to Watchlist Add New Tutorial How to understand the Tutorialpedia Tutorial Syntax

How to understand the Tutorialpedia Syntax

Important note:

As of October 1st, the syntax described in this documentation will no longer be supported. Until then, you can still use it. After October 1st, all documents will be automatically converted to the new version.

Tutorialpedia Tutorial Syntax

When you edit a tutorial on Tutorialpedia, the text you enter is interpreted then transformed in HTML mark-up. There are only a few simple rules you should understand.

Indentation

If you’re familiar with languages like Python or Haskell, then you already know about nested indentation. When the Tutorialpedia parser reads a document, lines of text with more indentation are considered a sub-block. For example, this is a valid indentation:

Main block
    sub-block 1
    sub-block 2
        sub-block 2.1
        sub-block 2.2
    sub-block 3

The following indentation is invalid and will cause an error, because the third sub-block does not match any previous existing indentation:

Main block
    sub-block
        sub-block
      sub-block

Functions

Functions are special components of the tutorial, accepting a set of parameters and returning a text which depends on those parameters. For function calls, the general format is ‘`function(prop1:'val1’ prop2:'val2') `.

There is a number of functions you can use (we are still working on the final specification).

  • `section() Function is used to create a section, displaying a heading with the value "Title". You can nest sections one into another

  • `code() Function is used to display code. This tag must have a sub-block with the code contents, otherwise it will display an error

  • `command() Function similar to `code(), but used to display one or more lines of instructions to be typed in a Command Line Interface.

  • `ul() Function is used to display lists. Each new line of the sub-block will generate a unique list item

  • `a() Function - it’s a function you can use to output a link to an external URL on the web.

  • `tutorial() Function will display a reference to another tutorial (you have to provide its identifier)

  • `quote() Function will display a specific content in a quote. However, this function can be also with a sub-block. In this case, the sub-block content will be the quote.

  • `talk() Function can be used to display a dialog bubble to the left of the article, where comments can be added.

Escaping

Sometimes we need to include content that spans across multiple lines (for example pasted source code), or include characters that interfere with the document syntax. There are several ways to work around this.

Escaping inside text

You can escape large portions of text, including new lines, using the

{` Escaped content goes here! `}

construct. See also Escaping in Tutorialpedia syntax .

To escape a function call, use a \ before the `, like this:

This is an escaped \`function() call.

Escaping inside function parameters

Inside the function parameters (which must be written inside quotes), you can use the \' and \\ to escape characters. For example:

`quote(contents:'I do most of my work sitting down; that\'s where I shine.')

Only plain text supported.

Optional

Required - will be kept private

Optional

 
 

Rating: (1+, 0-) In: Tutorialpedia