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
- Run
dev up
(or inspectdev.yml
and figure out what it means) - Run
ndoc --help
- 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