forked from owncloud/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
130 lines (118 loc) · 3.63 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#
# Core configuration, can be overridden via env variables.
#
SHELL ?= bash
BUILD_DIR ?= public
FONTS_DIR ?= fonts
STYLES_DIR ?= resources/themes
CACHE_DIR ?= cache
STYLE ?= owncloud
VERSION ?= 10.0.10
REDIRECTS ?= static
PLAYBOOK ?= site.yml
#
# Print a basic help about the available targets.
#
.PHONY: help
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " install to install the Antora command-line tools locally via Yarn and NodeJS."
@echo " clean to clean the build directory of any leftover artifacts from the previous build."
@echo " validate to validate all xref links of all manuals defined within configuration."
@echo " html to generate the HTML versions of all manuals defined within configuration."
@echo " pdf to generate the PDF versions of the administration, developer, and user manuals."
@echo " check-prose to lint English prose to support developers"
#
# Installs the Antora command-line tools locally.
#
.PHONY: install
install:
@echo "Installing Antora's command-line tools locally."
yarn install
#
# Remove build artifacts from previous builds.
#
.PHONY: clean
clean:
@echo "Cleaning up any artifacts from the previous build."
@-rm -rf $(BUILD_DIR)
@echo
#
# Validate xref links of all manuals.
#
.PHONY: validate
validate:
@echo "Validating xref links of all manuals defined within configuration"
-antora generate --pull --cache-dir $(CACHE_DIR) --redirect-facility $(REDIRECTS) --stacktrace --generator ./generators/xref-validator.js $(PLAYBOOK)
@echo
#
# Generate HTML versions of all manuals.
#
.PHONY: html
html:
@echo "Building HTML versions of all manuals defined within configuration"
-antora generate --pull --cache-dir $(CACHE_DIR) --redirect-facility $(REDIRECTS) --stacktrace --generator ./generators/search.js $(PLAYBOOK)
@echo
#
# Generate PDF versions of the core manuals.
#
.PHONY: pdf
pdf: pdf-admin pdf-developer pdf-user
#
# Generate PDF version of the administration manual.
#
.PHONY: pdf-admin
pdf-admin:
@echo "Building PDF version of the admin manual"
asciidoctor-pdf \
-a pdf-stylesdir=$(STYLES_DIR)/ \
-a pdf-style=$(STYLE) \
-a pdf-fontsdir=$(FONTS_DIR) \
-a examplesdir=modules/administration_manual/examples \
-a imagesdir=modules/administration_manual/assets/images \
-a appversion=$(VERSION) \
--base-dir $(CURDIR) \
--out-file server/administration_manual/ownCloud_Administration_Manual.pdf \
--destination-dir $(BUILD_DIR) \
books/admin.adoc
#
# Generate PDF version of the developer manual.
#
.PHONY: pdf-developer
pdf-developer:
@echo "Building PDF version of the developer manual"
asciidoctor-pdf \
-a pdf-stylesdir=$(STYLES_DIR)/ \
-a pdf-style=$(STYLE) \
-a pdf-fontsdir=$(FONTS_DIR) \
-a examplesdir=modules/developer_manual/examples \
-a imagesdir=modules/developer_manual/assets/images \
-a appversion=$(VERSION) \
--base-dir $(CURDIR) \
--out-file server/developer_manual/ownCloud_Developer_Manual.pdf \
--destination-dir $(BUILD_DIR) \
books/developer.adoc
#
# Generate PDF version of the user manual.
#
.PHONY: pdf-user
pdf-user:
@echo "Building PDF version of the user manual"
asciidoctor-pdf \
-a pdf-stylesdir=$(STYLES_DIR)/ \
-a pdf-style=$(STYLE) \
-a pdf-fontsdir=$(FONTS_DIR) \
-a examplesdir=modules/user_manual/examples \
-a imagesdir=modules/user_manual/assets/images \
-a appversion=$(VERSION) \
--base-dir $(CURDIR) \
--out-file server/user_manual/ownCloud_User_Manual.pdf \
--destination-dir $(BUILD_DIR) \
books/user.adoc
#
# Check the quality of the prose in all files.
#
.PHONY: check-prose
check-prose:
@echo "Checking quality of the prose in all files"
@yarn prose