# ZippyDoc format documentation { Some output goes here. ^ Code block ! This block cannot have child elements! The code block is used in an example to show example code. It is prefixed with a dollar sign ($), and all text following it will be show on the HTML page verbatim, without any further markup processing being done. It even allows you to display ZippyDoc formatting characters without having them interpreted, as is done on this page! @ Using a code block $ ^ my_function(**argument**, **another_argument**) $$ Some kind of text describing the function goes here. $$ argument:: This is the first argument to this example function. $$ another_argument:: This is the second argument to this example function. As you can see, it's possible to split the explanation over multiple lines as well. $$ @ Using this function $$ $ my_function(42, "The answer to everything") $$ > Some output goes here. It is also possible to have a code block spanning multiple paragraphs, without each paragraph being broken up into a separate code block (as would normally happen if you just used the dollar sign). To do this, you can use two dollar signs at the start of the block. Note that after these two dollar signs, whitespace (except for spaces) is **not** eaten, meaning you can use tabs to indent further blocks of your code! @ Using a multi-paragraph code block $ ^ my_function(**argument**, **another_argument**) $$ Some kind of text describing the function goes here. $$ argument:: This is the first argument to this example function. $$ another_argument:: This is the second argument to this example function. As you can see, it's possible to split the explanation over multiple lines as well. $$ @ Using this function $$ $ if some_variable == True: $$ $$ my_function(42, "The answer to everything") $$ > Some output goes here. ^ Output block ! This block cannot have child elements! The output block is used to display sample output in an example. Just like the code block, it is shown exactly as it originally was, without any further formatting applied. It is prefixed by a >, and like the code block it has a continuation character - in this case, that is >>. @ Using an output block $ ^ my_function(**argument**, **another_argument**) $$ Some kind of text describing the function goes here. $$ argument:: This is the first argument to this example function. $$ another_argument:: This is the second argument to this example function. As you can see, it's possible to split the explanation over multiple lines as well. $$ @ Using this function $$ $ my_function(42, "The answer to everything") $$ > The answer to everything is 42! @ Using a multi-paragraph output block $ ^ my_function(**argument**, **another_argument**) $$ Some kind of text describing the function goes here. $$ argument:: This is the first argument to this example function. $$ another_argument:: This is the second argument to this example function. As you can see, it's possible to split the explanation over multiple lines as well. $$ @ Using this function $$ $ my_function(42, "The answer to everything") $$ > The answer to everything is 42! $$ >> Did you know The answer to everything is 42? ^ Exclamation block The exclamation block allows you to mark a block of text as "important". In the standard HTML layout, it will have a yellow-ish background, and will be prefixed with "__Important!__". It is prefixed with an exclamation mark (!). Inline markup is applied. @ Using an exclamation block $ ^ my_function(**argument**, **another_argument**) $$ Some kind of text describing the function goes here. $$ ! Only ever use this function with the number '42'! $$ argument:: This is the first argument to this example function. $$ another_argument:: This is the second argument to this example function. As you can see, it's possible to split the explanation over multiple lines as well. $$ @ Using this function $$ $ my_function(42, "The answer to everything") $$ > The answer to everything is 42! ^ Header block ! This block cannot have child elements! A header block is a generic header to indicate the start of a new section. It is treated as a separate element, not as a "container". The header blocks in ZippyDoc work similarly to those in Markdown: they are prefixed by a hash (#), and the amount of hash characters defines what level of header it is. @ Using header blocks $ # This is a level 1 (largest) header. $$ ## This is a level 2 header. $$ ... $$ ####### This is a level 7 (smallest) header. ^ List block ! This block cannot have child elements! A list block is a list containing items. In HTML, it's rendered as a bulletpoint list. Each item is prefixed with an asterisk. Items can consist of multiple lines. @ Using list blocks * This is item one. * This is item three. * This is item two. We can even make it continue onto the next lines. * This is item four. ^ Text block ! This block cannot have child elements! A text block is any block that is not prefixed by a special character. It is shown as defined, with inline markup applied. ## Inline markup There are also various forms of inline markup that you can use in your documentation. ^ Emphasized text Emphasized text is typically displayed as italic. You can emphasize text by enclosing it in two asterisks on each side. @ Emphasizing text $ This is just some text, and **this part is emphasized**. ^ Strong text Strong text is typically displayed as bold. You can make text strong by enclosing it in two underscores on each side. @ Making text strong $ This is just some text, __and this part is strong__. ^ Internal references (hyperlinks) Internal references are hyperlinks that point to other documents in the same documentation set. Depending on the export format (currently only HTML is supported), the appropriate extension is automatically appended. The paths should resemble the directory structure you are storing the ZippyDoc source files in. The target of the reference is enclosed in curly braces and prefixed with a >. If you wish to give the reference a friendly description, you can do so by appending it, enclosed in parentheses. @ Referencing another documentation page $ You can also view the API documentation at {>api/index}. @ Referencing another documentation page with a friendly description $ You can also view the {>api/index}(API documentation). ^ External references (hyperlinks) External references are hyperlinks just like the internal references, but they refer to an external resources. The syntax is identical to that of internal references, except for the > disappearing. Note that external references are only picked up when the text enclosed in the braces is an actual URI of some sort. You can also force an external reference to be created by prefixing the URI with <. This is useful when you want to for example link to a download relative to the current page. @ Referencing Google $ You could also search {http://www.google.com/}. @ Referencing Google with a friendly description $ You could also search {http://www.google.com/}(Google). @ Referencing a relative file that is not a ZippyDoc document $ You can download it by {example}(view a full example here) of a ZippyDoc source file and its result.