burke / ndoc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ndoc

ndoc generates HTML articles from markdown. I use it for https://github.com/burke/notes (which generates http://notes.burke.libbey.me) and https://github.com/Shopify/galaxy-docs.

ndoc uses Pandoc with a few custom filters to support:

All artifacts generated by these filters are embedded directly in the document.

ndoc reads Markdown on standard in and writes HTML to standard out.

Usage

  1. Run dev up (or inspect dev.yml and figure out what it means)
  2. Run ndoc --help
  3. Run ndoc < in.md > out.html

Bonus

Here's a useful Makefile to use with ndoc:

SOURCES ?= $(shell find src -type f | grep -v index.md)
TARGETS ?= $(patsubst %.md,%/index.html,$(patsubst src/%,docs/%,$(SOURCES)))

INDEX ?= docs/index.html

all: $(TARGETS) $(INDEX)

docs/%/index.html: src/%.md
	@mkdir -p $(@D)
	ndoc/bin/ndoc < $< > $@

$(INDEX): src/index.md
	@mkdir -p $(@D)
	ndoc/bin/ndoc < $< > $@

clean:
	rm -rf docs

.PHONY: all clean

About

License:MIT License


Languages

Language:Ruby 51.2%Language:HTML 44.8%Language:JavaScript 4.0%