Welcome to Rho, easy-to-{read,write,understand} semantic markup language written in Node, available both for server and browser runtime.
The text you see is written in Rho. Click on the source text on the left to edit it.
Heads up! Don't worry, your changes won't be saved. We've set up this static page as a playground for learning the simple rules of Rho syntax.
id
and class
attributes on blocks.
To use Rho with Node, simply install it using npm:
npm install rho
Then require it and you're all set:
var html = require("rho").toHtml(text);
Full-featured Rho processor is available for browser.
Include it on your page:
<script type="text/javascipt" src="/js/rho.min.js">
</script>
Profit!
var html = rho.toHtml(text);
Be sure to check out the README to learn more about using Rho.
The text consists of blocks. Blocks are separated from each other with at least one blank line. Paragraph is the most generic block.
Whitespace inside blocks is condensed.
Selectors let you define id
and class
attributes on blocks.
Just include selector expression on the first line of your block:
Paragraph with id. {#para}
Paragraph with classes. {.class1.class2}
{#another.class1.class2}
Another paragraph, both with id and classes.
Headings start with one or more #
. The amount of hashes
determine the heading level (1 to 6):
Code blocks start and end with ```
.
<a href="#">Learn more</a>
Unordered lists start with *
, each list item should start with the
same marker and maintain the same indentation:
Blocks indented beyond the marker are included into the list item. The amount of nesting is unconstrained — just make sure to maintain proper indentation:
List item 1
Paragraph inside list item 1
List item 2
Sub-list inside list item 2
Sub-sub list, item 3
Even code inside sub-sub list!
Ordered lists start with 1.
, every subsequent list item should start
with a number followed by a period — and maintain the same indentation:
List item 1
Paragraph inside list item 1
List item 2
Sub-list inside list item 2
Sub-sub list, item 3
Even code inside sub-sub list!
Rho allows you to compose simple tables — without even knowing about HTML nightmares. The syntax is rather sparse and can forgive many of your common mistakes.
Just like with any other block, you can enhance your tables with selectors.
A | B | A ^ B |
---|---|---|
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 0 |
Columns alignment can be controlled using colons :
in the separator line (below heading).
Right-align | Centered | Left-align |
---|---|---|
0 | 0 | 0 |
10 | 10 | 10 |
100 | 100 | 100 |
1000 | 1000 | 1000 |
Tables can go without any heading, it just needs to be started with a couple of minus signs. Furthermore, each table row can have its very own selector!
Strawberry | 6 boxes |
Bananas | 500 kg |
Oranges | 20 boxes |
Kiwi | 100 packs |
Please check out the Rho Syntax Reference to learn more about the syntax.