Skip to content
Slate docs powered by node
CSS JavaScript HTML
Branch: master
Clone or download

Latest commit

JC Denton JC Denton
JC Denton and JC Denton Update marked version
Latest commit 4fb7c5c Nov 2, 2019

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
source sure why not Nov 18, 2018
.gitignore enhanced node modules handling May 11, 2016
LICENSE Update LICENSE Aug 15, 2015
README.md sure why not Nov 18, 2018
package.json Update marked version Nov 2, 2019

README.md

Slate with node.js

A port of the documentation generator Slate to node.js, that can optionally be built in the browser. See it in action!

The major difference is the use of marked for parsing the .md, highlight for syntax highlighting, and Handlebars for templating.

Building

Node.js

This outputs to the build directory. Replace source/slate.md with your own markdown to use that instead

git clone https://github.com/jmanek/slate_node.git
npm install 
npm run build
# Docs are now viewable at build/index.html

Browser

Alternatively, you can directly serve the source directory from a webhost and the documentation will be built at runtime.

git clone https://github.com/jmanek/slate_node.git
npm install serve # included in npm install
./node_modules/.bin/serve source
# Docs are now viewable at localhost:5000

Any changes to source/slate.md will be incorporated into source/index.html when it is reloaded. There is now no need to have node.js installed on the machine. This way you don't have to worry about incorpoting Slate into your current build process or creating an entirely new toolchain for it (python3 -m http.server). It is a "static" version of Slate. This is inherently slower than the node.js pre-built version, but it is completely independent of operating system or platform. You will not be able to view the documentation until deploying it to a server.

Code Highlighting

Numerous themes for highlight.js are available in source/stylesheets/highlight. You can switch between them by changing this line in source/index.html

<link href="stylesheets/highlight/solarized-dark.css" rel="stylesheet" type="text/css" />

Includes

Includes are handled as described in the Slate Wiki. The filename must have an underscore prepended to it, which is not included in the markdown file description.

Todo/Bugs

  • Package it in a more modular way (Grunt?)
  • marked seems to be handling tables a bit differently, if there's too many em-dashes it's failing
  • highlight.js might have some differences in language detection than Rouge; at the very least 'shell' becomes 'bash'. Ideally this repo should be compatible with any markdown made for Ruby Slate.
  • Cleanup how marked parses the top-level settings. Right now they are manually being parsed.
  • Actually build the scss/js
You can’t perform that action at this time.