-
Notifications
You must be signed in to change notification settings - Fork 132
/
Makefile
61 lines (45 loc) · 2.3 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
PAGES:=$(shell find pages -name "*.html") $(shell find pages -name "*.md")
EXAMPLES:=basic markdown dino codemirror lint track collab footnote schema upload menu tooltip fold
ROOT:=$(shell if [ -d node_modules/prosemirror-model ]; then echo node_modules/; else echo ../node_modules/; fi)
UGLIFY:=
ifdef UGLIFY
UGLIFY=-g [ uglifyify -m -c ]
endif
all: $(subst .md,.html,$(PAGES:pages/%=public/%)) \
$(foreach EX,$(EXAMPLES), public/examples/$(EX)/example.js) \
public/examples/prosemirror.js \
public/css/editor.css
public/docs/ref/index.html: pages/docs/ref/index.html $(ROOT)prosemirror-*/src/*.ts $(ROOT)prosemirror-*/src/README.md templates/* src/build/*.js
mkdir -p $(dir $@)
node src/build/build.js $<
markdown/CHANGELOG.md: $(ROOT)prosemirror-*/CHANGELOG.md src/build/changelog.js
node src/build/changelog.js > $@
public/docs/changelog/index.html: markdown/CHANGELOG.md
public/docs/guide/index.html: pages/docs/guide/index.html templates/* src/build/*.js markdown/guide/*.md
public/%.html: pages/%.* templates/* src/build/*.js
mkdir -p $(dir $@)
node src/build/build.js $<
CORE:=prosemirror-model prosemirror-transform prosemirror-state prosemirror-view \
prosemirror-keymap prosemirror-inputrules prosemirror-history prosemirror-commands \
prosemirror-schema-basic prosemirror-schema-list \
prosemirror-dropcursor prosemirror-menu prosemirror-example-setup
public/examples/prosemirror.js: bin/library.js $(foreach LIB,$(CORE),$(wildcard $(ROOT)$(LIB)/dist/*.js))
mkdir -p $(dir $@)
node bin/build-library.js > $@
public/examples/%/example.js: example/%/index.js
mkdir -p $(dir $@)
node bin/build-example.js $< > $@
public/css/editor.css: $(ROOT)prosemirror-view/style/prosemirror.css \
$(ROOT)prosemirror-menu/style/menu.css \
$(ROOT)prosemirror-gapcursor/style/gapcursor.css \
$(ROOT)prosemirror-example-setup/style/style.css \
public/css/editor-base.css
cat $^ > $@
clean:
rm -rf public/**/*.html public/examples/*/example.js public/examples/*/index.html public/examples/prosemirror.js public/css/editor.css CHANGELOG.md example/build/
pre-update:
npm upgrade
rm -f markdown/CHANGELOG.md
touch $(ROOT)prosemirror-model/dist/index.js
touch pages/docs/ref/index.html
update: pre-update all