How to understand the Tutorialpedia Tutorial Syntax
How to understand the Tutorialpedia Syntax – Edit content (add a revision)
`section(title:'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. `section(title:'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. `section(title:'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: `code() {` 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: `code() {` Main block sub-block sub-block sub-block`} `section(title:'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 `code(content:'`function(prop1:\'val1\' prop2:\'val2\')'). There is a number of functions you can use (we are still working on the final specification). `ul() `tutorial(name:'Tutorialpedia Section Function') is used to create a section, displaying a heading with the value "Title". You can nest sections one into another `tutorial(name:'Tutorialpedia Code Function') is used to display code. This tag must have a sub-block with the code contents, otherwise it will display an error `tutorial(name:'Tutorialpedia Command Function') similar to \`code(), but used to display one or more lines of instructions to be typed in a Command Line Interface. `tutorial(name:'Tutorialpedia List Function') is used to display lists. Each new line of the sub-block will generate a unique list item `tutorial(name:'Tutorialpedia Link Function') - it's a function you can use to output a link to an external URL on the web. `tutorial(name:'Tutorialpedia Tutorial Link Function') will display a reference to another tutorial (you have to provide its identifier) `tutorial(name:'Tutorialpedia 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. `tutorial(name:'Tutorialpedia Talk Function') can be used to display a dialog bubble to the left of the article, where comments can be added. `section(title:'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. `section(title:'Escaping inside text') You can escape large portions of text, including new lines, using the `code(language:'codepax') {` {` Escaped content goes here! \`} `} construct. See also `tutorial(name:'Tutorialpedia Text Escape'). To escape a function call, use a \\ before the \`, like this: `code(language:'codepax') This is an escaped \\\`function() call. `section(title:'Escaping inside function parameters') Inside the function parameters (which must be written inside quotes), you can use the {`\' and \\ `} to escape characters. For example: `code(language:'codepax') \`quote(contents:'I do most of my work sitting down; that\\'s where I shine.')
Save as new Revision
Syntax docs