Skip to content

Commit

Permalink
API documentation improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
cpettitt committed Aug 26, 2013
1 parent 6ab6c73 commit 49f6bcf
Show file tree
Hide file tree
Showing 12 changed files with 1,703 additions and 325 deletions.
19 changes: 13 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,21 @@ MOCHA?=node_modules/mocha/bin/mocha
MOCHA_OPTS?=
JS_COMPILER=node_modules/uglify-js/bin/uglifyjs
JS_COMPILER_OPTS?=--no-seqs
GENDOCS=node_modules/gendocs/bin/gendocs
DOCGEN=node_modules/dox-foundation/bin/dox-foundation

MAIN_JS=graphlib.js
MAIN_MIN_JS=graphlib.min.js

DOC?=doc

# There does not appear to be an easy way to define recursive expansion, so
# we do our own expansion a few levels deep.
JS_SRC:=$(wilcard lib/*.js lib/*/*.js lib/*/*/*.js)
JS_SRC:=$(wildcard lib/*.js lib/*/*.js lib/*/*/*.js)
JS_TEST:=$(wildcard test/*.js test/*/*.js test/*/*/*.js)

all: $(MAIN_JS) $(MAIN_MIN_JS) test
all: $(MAIN_JS) $(MAIN_MIN_JS) $(DOC) test

$(MAIN_JS): Makefile browser.js lib/version.js node_modules $(JS_SRC) api_docs
$(MAIN_JS): Makefile browser.js lib/version.js node_modules $(JS_SRC)
@rm -f $@
$(NODE) $(BROWSERIFY) browser.js > $@
@chmod a-w $@
Expand All @@ -33,12 +35,17 @@ lib/version.js: src/version.js package.json
node_modules: package.json
$(NPM) install

api_docs:
$(GENDOCS) ./lib/Graph.js > api.md
$(DOC): $(JS_SRC)
@rm -rf $@
$(NODE) $(DOCGEN) --ignore lib/version.js --source lib --target $@

.PHONY: test
test: $(MAIN_JS) $(JS_TEST)
$(NODE) $(MOCHA) $(MOCHA_OPTS) $(JS_TEST)

clean:
rm -f $(MAIN_JS) $(MAIN_MIN_JS)
rm -rf $(DOC)

fullclean: clean
rm -rf node_modules
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ functions.

# API

[API documentation](./api.md)
[API documentation](./doc)

##

Expand Down
134 changes: 0 additions & 134 deletions api.md

This file was deleted.

Loading

0 comments on commit 49f6bcf

Please sign in to comment.