How to install Metanorma

To be able to build Metanorma documents of any flavor, you need to have the metanorma-cli Ruby gem installed. To simplify installation of the gem and its dependencies, following installation methods are currently supported.

Tip
Full manual

Assuming you know what you’re doing, you can install Metanorma CLI gem by hand. You will have to take care of dependencies: an appropriate Ruby version, plus other software depending on the end documents you’re building.

Refer to Metanorma CLI installation docs for more.

Docker setup

This setup method works for all platforms that support the Docker container framework.

Tip

This method is the recommended way of getting Metanorma installed, although for certain reasons (such as performance) that you may wish to setup the components directly on your machine.

  1. Pull the container:

    docker pull ribose/metanorma
  2. Specify the :local-cache-only: AsciiDoc attribute in document header to speed up rendering (optional)

  3. To render the document into HTML, Word and XML, execute from within the directory containing the Metanorma document (replacing {my-document-file} with your actual document’s filename):

    docker run -v "$(pwd)":/metanorma/ -w /metanorma ribose/metanorma "metanorma -t iso -x html,doc,xml {my-document-file}"
Tip

See metanorma-docker for more information.

macOS

Using Homebrew

brew tap riboseinc/metanorma
brew install metanorma

This uses Metanorma’s Homebrew formula. To install using the HEAD development version of the formula, run:

brew install --HEAD https://raw.githubusercontent.com/riboseinc/homebrew-metanorma/master/metanorma.rb

All-in-one script

Run the following for an automatic install that would prepare a fresh system to work with Metanorma.

Note
This installs not just the Metanorma components, but also prerequisites such as Homebrew and basic tools like Sublime Text.

This should take less than 15 minutes depending on your machine and Internet connection:

bash <(curl -s https://raw.githubusercontent.com/riboseinc/metanorma-macos-setup/master/metanorma-setup)

Linux

Linux setup uses all-in-one script. You need to have curl installed beforehand.

Tip
See more in metanorma-linux-setup repository.

Ubuntu

sudo bash -c "curl -L https://raw.githubusercontent.com/riboseinc/metanorma-linux-setup/master/ubuntu.sh | bash"
curl -L https://raw.githubusercontent.com/riboseinc/metanorma-linux-setup/master/install-gems.sh | bash

CentOS

sudo bash -c "curl -L https://raw.githubusercontent.com/riboseinc/metanorma-linux-setup/master/centos.sh | bash"
curl -L https://raw.githubusercontent.com/riboseinc/metanorma-linux-setup/master/install-gems.sh | bash

Windows

Using Chocolatey

Execute the following:

Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
refreshenv
cinst msys2 --params "/NoUpdate" -y # install msys2 without system update
cinst metanorma -y
refreshenv
Tip

Windows encoding in cmd.exe usually not UTF-8, so to make it UTF-8 please run chcp 65001. This workaround critical when you need work with LaTeXML

Docker installation shortcut

Run this command in your cmd.exe or PowerShell to install the Metanorma Docker container and all prerequisites (see Docker setup):

bitsadmin /transfer get https://raw.githubusercontent.com/riboseinc/metanorma-windows-setup/master/install.bat %cd%\install.bat & .\install.bat

Installing gems separately

See Metanorma CLI docs on how to install that gem on its own, be sure to note the dependencies.