-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: simplify documentation generation and build 0.27.1 documentation
- Loading branch information
1 parent
e3af2d1
commit 3a374c4
Showing
15 changed files
with
10,648 additions
and
15,111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +1,17 @@ | ||
GITBOOK = node_modules/.bin/gitbook | ||
JSDOC = node_modules/.bin/jsdoc | ||
LESS = node_modules/.bin/lessc | ||
|
||
JSDOC_FILES := $(shell find jsdoc -type f | sort) | ||
LESS_FILES := $(shell find less -name '*.less' | sort) | ||
|
||
|
||
.PHONY: all | ||
all: \ | ||
check-version \ | ||
$(VERSION)/tmp/README.md \ | ||
$(VERSION)/tmp/package.json \ | ||
$(VERSION)/docs/dist/ramda.js \ | ||
$(VERSION)/docs/index.html \ | ||
$(VERSION)/docs/main.js \ | ||
$(VERSION)/index.html \ | ||
$(VERSION)/fonts/glyphicons-halflings-regular.eot \ | ||
$(VERSION)/fonts/glyphicons-halflings-regular.svg \ | ||
$(VERSION)/fonts/glyphicons-halflings-regular.ttf \ | ||
$(VERSION)/fonts/glyphicons-halflings-regular.woff \ | ||
$(VERSION)/fonts/glyphicons-halflings-regular.woff2 \ | ||
$(VERSION)/style.css \ | ||
gitbook \ | ||
docs/dist/ramda.js \ | ||
docs/index.html \ | ||
docs/main.js \ | ||
index.html \ | ||
style.css \ | ||
|
||
$(VERSION)/tmp/%: | ||
mkdir -p '$(@D)' | ||
curl --silent 'https://raw.githubusercontent.com/ramda/ramda/v$(VERSION)/$(@F)' >'$@' | ||
|
||
$(VERSION)/docs/dist/ramda.js: | ||
mkdir -p '$(@D)' | ||
curl --silent 'https://raw.githubusercontent.com/ramda/ramda/v$(VERSION)/dist/ramda.js' >'$@' | ||
|
||
$(VERSION)/docs/index.html $(VERSION)/index.html: $(JSDOC_FILES) | ||
VERSION='$(VERSION)' $(JSDOC) \ | ||
--destination '$(VERSION)' \ | ||
--template '$(<D)' \ | ||
'$(VERSION)/docs/dist/ramda.js' | ||
|
||
$(VERSION)/fonts/%: node_modules/bootstrap/fonts/% | ||
mkdir -p '$(@D)' | ||
cp '$<' '$@' | ||
|
||
$(VERSION)/style.css: $(LESS_FILES) | ||
mkdir -p '$(@D)' | ||
$(LESS) less/ramda.less --autoprefix --clean-css >'$@' | ||
|
||
docs/%: $(VERSION)/docs/% | ||
mkdir -p '$(@D)' | ||
cp '$<' '$@' | ||
|
||
.PHONY: index.html | ||
index.html: check-version | ||
echo '<!DOCTYPE html><html><head><link rel="canonical" href="http://ramdajs.com/$(VERSION)/index.html" /><script>window.location = "$(VERSION)/index.html" + window.location.hash;</script></head><body></body></html>' >'$@' | ||
|
||
%: $(VERSION)/% | ||
cp '$<' '$@' | ||
|
||
all: docs/dist/ramda.js docs/index.html repl/index.html style.css index.html | ||
|
||
.PHONY: check-version | ||
check-version: | ||
ifeq ($(origin VERSION),undefined) | ||
$(error VERSION not set) | ||
endif | ||
docs/dist/ramda.js: node_modules/ramda/dist/ramda.js | ||
cp -f $< $@ | ||
|
||
docs/index.html: publish.js docs/index.html.handlebars | ||
npx jsdoc -c .jsdoc.config.json --destination ./$(@D) --template . node_modules/ramda/src | ||
|
||
.PHONY: gitbook | ||
gitbook: check-version | ||
$(GITBOOK) build manual './manual' | ||
find './manual' -name '*.html' -print0 \ | ||
| xargs -0 perl -p -i -e 's/ data-revision="[^"]*"//g' | ||
index.html: make_index_html.js index.pug layout.pug | ||
node $< >$@ | ||
|
||
repl/index.html: make_repl_index_html.js repl/index.pug | ||
node $< >$@ | ||
|
||
.PHONY: setup | ||
setup: | ||
npm install | ||
style.css: $(shell find less -name "*.less") | ||
npx lessc --autoprefix --clean-css ./less/ramda.less >$@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.