Rimu Markup
Rimu is a readable-text to HTML markup language inspired by AsciiDoc and Markdown.
At its core Rimu is a simple readable-text markup similar in scope to Markdown, but with two additional areas of functionality (both built into the Rimu markup syntax):
- Markup generation can be customized and extended.
- Rimu includes a simple, flexible macro language.
- A subset of Rimu syntax is Markdown compatible.
- The generated HTML is compatible with all modern browsers.
- A number of Rimu implementations are available for various languages and runtime environments.
Learn more
Read the documentation and experiment with Rimu in the Rimu
Playground or open the
rimuplayground.html
file locally in your browser.
See the Rimu Change Log for the latest changes.
NOTE: The remainder of this document is specific to the TypeScript implementation for Node.js, Deno and browser platforms.
Quick start
Try the Rimu library in the npm Runkit page:
- Open the Rimu npm Runkit page in your browser.
- Paste in this code then press the Run button.This will output
const rimu = require("rimu") const html = rimu.render('Hello *Rimu*!')
"<p>Hello <em>Rimu</em>!</p>"
.
Installing and using Rimu
Node.js
Use npm
to install the Node.js Rimu library module and the rimuc
CLI:
npm install -g rimu
Run a test from the command prompt to check the rimuc
CLI command is
working:
echo "Hello *Rimu*!" | rimuc
This should print:
<p>Hello <em>Rimu</em>!</p>
Deno
Deno modules don't need explicit installation just import the module URL, for example:
import * as rimu from "https://deno.land/x/rimu@11.1.2/mod.ts";
console.log(rimu.render("Hello *Rimu*!"));
Use the Deno install
command to install the Rimu CLI executable.
The following example creates the CLI executable named rimudeno
in $HOME/.deno/bin/rimudeno
:
deno install -A --name rimudeno https://deno.land/x/rimu@11.1.2/src/deno/rimuc.ts
Browser
Rimu builds JavaScript ES module files in the ./lib/esm
directory along with a
bundled version ./lib/web/rimu.esm.js
. The rimu.esm.js
ES module file was
bundled by Deno and minimized with
terser (see the build-web
task in the
Rimu Drakefile).
Example usage:
<script type="module">
import * as rimu from "./rimu.esm.js";
alert(rimu.render("Hello *Rimu*!"));
</script>
Building Rimu and the Rimu documentation
To build Rimu you need to have Deno and Node.js installed.
Install the Git repository from Github.
git clone https://github.com/srackham/rimu.git
Install dependencies:
cd rimu npm install
Use the Drake task runner module to build Rimu library modules and CLIs for Deno and Node.js platforms:
deno run -A Drakefile.ts build
NOTE: If a one-off rimuc.ts
build error occurs rerun the build command
(the error is benign and seems to be related to circular compilation
references).