Skip to content

A port of the Rimu Markup language to the Deno runtime.

Notifications You must be signed in to change notification settings

srackham/rimu-deno

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Rimu Markup for Deno


NOTE: This project has merged with the Rimu TypeScript codebase and is no longer active. Please visit https://github.com/srackham/rimu for the latest version of Rimu for Deno.


A port of the Rimu Markup language to the Deno runtime.

NOTE: This is a development release. A production release will follow once Deno has reached 1.0. If you experience compilation errors try forcing a cache reload with the Deno fetch command e.g. deno fetch Drakefile.ts --reload

Tested with Deno 0.38.0 running on Ubuntu 18.04.

Features

Functionally identical to the Rimu JavaScript implementation version 11.1 with the following exceptions:

  • Does not support deprecated Expression macro values.
  • Does not support deprecated Imported Layouts.

API

Example usage:

import * as rimu from "https://raw.github.com/srackham/rimu-deno/master/mod.ts";

console.log(rimu.render("Hello *Rimu*!"));

Save the above code as file minimal-example.ts then run it using:

deno --reload minimal-example.ts

The --reload option forces the latest version of the Rimu library to be downloaded.

See also the Rimu API documentation.

CLI command

The Rimu CLI command is implemented by rimuc.ts.

Use the Deno install command to install an executable CLI wrapper. The following example creates the executable $HOME/.deno/bin/rimudeno:

deno install --force rimudeno --allow-env --allow-read --allow-write https://raw.github.com/srackham/rimu-deno/master/src/rimuc.ts

Run it with e.g.

rimudeno --version

Building

No explicit build setup is required, just import or run the TypeScript URL.

Learn more about Rimu

Read the documentation and experiment with Rimu in the Rimu Playground.

Implementation

The Deno Rimu port is built using the TypeScript source code from the canonical Rimu implementation with the following minor modifications:

  1. An explicit .ts extension was added to all TypeScript import and export statements (see the Makefile update task).
  2. rimuc.ts was ported from the Node.js API to the Deno API.