No description, website, or topics provided.
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
internal
rimu
rimugo
.editorconfig
.gitignore
LICENSE
Makefile
README.md
go.mod
go.sum

README.md

Rimu Markup for Go

go-rimu is a port of the Rimu Markup language written in the Go language.

Features

Functionally identical to the JavaScript implementation version 11.1.0 with the following exceptions:

  • Does not support deprecated Expression macro values.
  • Does not support deprecated Imported Layouts.
  • Because the Go regexp package uses RE2 regular expressions there are some limitations on the regular expressions used in Replacements definitions and Inclusion/Exclusion macro invocations.

Installation

NOTE: Requires Go 1.11 or better.

Download, build, test and install:

git clone https://github.com/srackham/go-rimu.git
cd go-rimu
make

Using the go-rimu library

Example usage:

package main

import (
    "fmt"

    "github.com/srackham/go-rimu/v11/rimu"
)

func main() {
    // Prints "<p><em>Hello Rimu</em>!</p>"
    fmt.Println(rimu.Render("*Hello Rimu*!", rimu.RenderOptions{}))
}

To compile and run this simple application:

  1. Copy the code above to a file named hello-rimu.go and put it in an empty directory.

  2. Change to the directory and run the following Go commands:

    go mod init example.com/hello-rimu
    go run hello-rimu.go
    

NOTE: Requires Go 1.11 or better.

See also Rimu API documentation.

Rimu compiler command

The executable is named rimugo and is functionally identical to the JavaScript rimuc command.

Learn more

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

See the Rimu Change Log for the latest changes.

Implementation

  • The largely one-to-one correspondence between the canonical TypeScript code and the Go code eased porting and debugging. This will also make it easier to cross-port new features and bug-fixes.

  • All Rimu implementations share the same JSON driven test suites comprising over 300 compatibility checks.