Rho — semantic markup language

Welcome to Rho, easy-to-{read,write,understand} semantic markup language written in Node, available both for server and browser runtime.

← Try it right here!

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.

Features

Installation & usage

Node

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);

Browser version

Full-featured Rho processor is available for browser.

  1. Download the latest version.
  2. Include it on your page:

    <script type="text/javascipt" src="/js/rho.min.js">
    </script>
  3. Profit!

    var html = rho.toHtml(text);

Be sure to check out the README to learn more about using Rho.

Syntax cheat-sheet

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

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

Headings start with one or more #. The amount of hashes determine the heading level (1 to 6):

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6

Code blocks

Code blocks start and end with ```.

<a href="#">Learn more</a>

Unordered lists

Unordered lists start with * , each list item should start with the same marker and maintain the same indentation:

  • List item 1
  • List item 2
  • List item 3

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 1
      • Sub-sub list, item 2
      • Sub-sub list, item 3

        Even code inside sub-sub list!

Ordered lists

Ordered lists start with 1., every subsequent list item should start with a number followed by a period — and maintain the same indentation:

  1. List item 1

    Paragraph inside list item 1

  2. List item 2

    1. Sub-list inside list item 2

      1. Sub-sub list, item 1
      2. Sub-sub list, item 2
      3. Sub-sub list, item 3

        Even code inside sub-sub list!

Simple tables

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

Learn more

Please check out the Rho Syntax Reference to learn more about the syntax.