Skip to content

Commit

Permalink
Merge pull request #45 from shawnbot/merge-docs
Browse files Browse the repository at this point in the history
Static docs and VERSION file

This collection of commits moves the modestmaps-js version number from src/start.js to a standalone VERSION fo;e, the contents of which is inserted into modestmaps.js (and modestmaps.min.js) by the Makefile. To update the modestmaps-js version from now on, edit the VERSION file and run `make clean all`.

These commits also include static documentation in the doc/ directory. You'll need to `npm install marked` to build them. Also not that the docs are *not* built automatically by the project-level Makefile; you'll need to `cd doc && make clean all` to rebuild the docs with the current version number. And don't forget to update the corresponding entries in doc/api.md if you make changes to the public API!
  • Loading branch information
Shawn Allen committed Aug 6, 2012
2 parents 0edb04b + e65d6a0 commit 2de854c
Show file tree
Hide file tree
Showing 15 changed files with 2,884 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
node_modules
.swp
.*.swp
13 changes: 9 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,21 @@ JS_FILES = \
src/convenience.js \
src/end.js

all: modestmaps.js modestmaps.min.js
VERSION = `cat VERSION`

all: modestmaps.js modestmaps.min.js update-version

modestmaps.min.js: modestmaps.js
rm -f modestmaps.min.js
java -jar tools/yuicompressor-2.4.2.jar modestmaps.js > modestmaps.min.js

modestmaps.js: $(JS_FILES) Makefile
rm -f modestmaps.js
cat $(JS_FILES) >> modestmaps.js
cat $(JS_FILES) | perl -pi -e "s/{VERSION}/$(VERSION)/g" > modestmaps.js

update-version:
perl -pi -e "s/\"version\": \"[^\"]+/\"version\": \"$(VERSION)/g" package.json

clean:
rm modestmaps.js
rm modestmaps.min.js
rm -f modestmaps.js
rm -f modestmaps.min.js
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.3.4
2 changes: 2 additions & 0 deletions doc/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
api.html
toc.html
15 changes: 15 additions & 0 deletions doc/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# to install marked: `npm install marked`
MARKED ?= ../node_modules/marked/bin/marked --gfm
VERSION = `cat ../VERSION`

all: index.html

index.html: toc.html api.html
cat start.html toc.html middle.html api.html end.html \
| perl -pi -e "s/{VERSION}/$(VERSION)/g" > $@

%.html: %.md
$(MARKED) $< > $@

clean:
rm -f index.html toc.html api.html
Loading

0 comments on commit 2de854c

Please sign in to comment.