Skip to content
Ole Petter Bang edited this page Oct 25, 2016 · 6 revisions

Building

Prerequisites

Building remark requires you to have the following software installed:

  • git
  • node (and npm, which is included in recent node versions)

Downloading source and installing dependencies

In addition to cloning the remark repository, it's git sub modules and node package dependencies must be installed as well:

git clone https://github.com/gnab/remark.git
cd remark
git submodule update --init --recursive
npm install

Building remark

To build remark, there's one final command to execute:

node make

This will trigger the all target in the Makefile-like make.js file producing out/remark.js and the minified out/remark.min.js.

The all target comprises the targets lint, test, bundle and minify, any of which can be run individually by issuing node make <target>.

Building remark highlighter

In addition to building remark itself, there's an additional highlighter target that will bundle Highlight.js into the src/remark/highlighter.js file.

node make highlighter

This will bundle Highlight.js itself, its styles (with a few exceptions), and the languages specified in the package.json file:

{
  ...
  "config": {
    "highlighter": {
       "languages": [
         "javascript",
         "ruby",
         ...
       ]
    }
  }
}

Excluding highlighter from build

By setting the config.highlighter property to false, an empty highlighter skeleton will be inserted instead of Highlight.js when triggering the highlighter target, effectively causing Highlight.js to be excluded from the build:

{
  ...
  "config": {
    "highlighter": false
  }
}

If you will be using remark without any code that needs to be syntax highlighted, this lets you build a light-weight version (remark.min.js ~62 kB).