metanorma-cli 1.3.3 → 1.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/dependent_repos.env +3 -0
- data/.github/workflows/macos.yml +38 -0
- data/.github/workflows/ubuntu.yml +72 -0
- data/.github/workflows/windows.yml +40 -0
- data/.gitignore +21 -0
- data/.hound.yml +3 -0
- data/.rspec +2 -0
- data/.rubocop.yml +515 -0
- data/docs/installation.adoc +61 -0
- data/docs/navigation.adoc +7 -0
- data/docs/usage.adoc +74 -0
- data/lib/metanorma/cli/command.rb +25 -1
- data/lib/metanorma/cli/setup.rb +9 -30
- data/lib/metanorma/cli/version.rb +1 -1
- data/metanorma-cli.gemspec +24 -19
- data/templates/base/.github/workflows/docker.yml +74 -0
- data/templates/base/.github/workflows/macos.yml +50 -0
- data/templates/base/.github/workflows/ubuntu.yml +55 -0
- data/templates/base/.github/workflows/windows.yml +42 -0
- data/templates/base/.gitlab-ci.yml +34 -4
- data/templates/base/Makefile +111 -59
- data/templates/base/Makefile.win +136 -36
- data/templates/base/metanorma.yml +1 -1
- metadata +49 -83
- data/05-020r26.rxl +0 -75
- data/05-020r26.xml.zip +0 -0
- data/Gemfile.lock +0 -336
- data/a +0 -3
- data/a.json +0 -33
- data/a.rb +0 -13
- data/a.rxl +0 -45
- data/b +0 -85
- data/csd-tofix 2.zip +0 -0
- data/csd-tofix.zip +0 -0
- data/exe/metanorma.old +0 -178
- data/extract/sourcecode/sourcecode-0000.txt +0 -5
- data/files.zip +0 -0
- data/relaton/cache/version +0 -1
- data/rice.rxl +0 -51
- data/sourcecode/0 +0 -5
- data/templates/base/.travis.yml +0 -30
- data/templates/base/appveyor.yml +0 -29
- data/test.rxl +0 -52
- data/tmp/my-custom-csd/Gemfile +0 -4
- data/tmp/my-custom-csd/Makefile +0 -144
- data/tmp/my-custom-csd/Makefile.win +0 -116
- data/tmp/my-custom-csd/appveyor.yml +0 -29
- data/tmp/my-custom-csd/metanorma.yml +0 -4
- data/tmp/my-document/Gemfile +0 -4
- data/tmp/my-document/Makefile +0 -144
- data/tmp/my-document/Makefile.win +0 -116
- data/tmp/my-document/appveyor.yml +0 -29
- data/tmp/my-document/metanorma.yml +0 -4
- data/tmp/my-local-document/Gemfile +0 -4
- data/tmp/my-local-document/Makefile +0 -144
- data/tmp/my-local-document/Makefile.win +0 -116
- data/tmp/my-local-document/appveyor.yml +0 -29
- data/tmp/my-local-document/metanorma.yml +0 -4
@@ -0,0 +1,42 @@
|
|
1
|
+
# Auto-generated by Cimas: Do not edit it manually!
|
2
|
+
# See https://github.com/metanorma/cimas
|
3
|
+
name: windows
|
4
|
+
|
5
|
+
on:
|
6
|
+
push:
|
7
|
+
branches: [ master ]
|
8
|
+
pull_request:
|
9
|
+
paths-ignore:
|
10
|
+
- .github/workflows/test.yml
|
11
|
+
- .github/workflows/macos.yml
|
12
|
+
- .github/workflows/ubuntu.yml
|
13
|
+
- .github/workflows/docker.yml
|
14
|
+
- Makefile
|
15
|
+
|
16
|
+
jobs:
|
17
|
+
test-windows:
|
18
|
+
name: Test on Windows
|
19
|
+
runs-on: windows-latest
|
20
|
+
steps:
|
21
|
+
- name: Checkout code
|
22
|
+
uses: actions/checkout@v2
|
23
|
+
with:
|
24
|
+
token: ${{ secrets.METANORMA_CI_PAT_TOKEN || github.token }}
|
25
|
+
submodules: true
|
26
|
+
- name: Cache xml2rfc
|
27
|
+
id: cache-xml2rfc
|
28
|
+
uses: actions/cache@v1
|
29
|
+
with:
|
30
|
+
path: ~/.cache/xml2rfc
|
31
|
+
key: xml2rfc
|
32
|
+
restore-key: xml2rfc
|
33
|
+
- name: Install Metanorma & yq
|
34
|
+
shell: pwsh
|
35
|
+
run: |
|
36
|
+
cinst --no-progress -y metanorma yq
|
37
|
+
- name: Install bundler
|
38
|
+
run: |
|
39
|
+
gem install bundler
|
40
|
+
- name: Metanorma compile
|
41
|
+
run: |
|
42
|
+
make -f Makefile.win clean all SHELL=cmd
|
@@ -1,15 +1,45 @@
|
|
1
|
+
# Auto-generated by Cimas: Do not edit it manually!
|
2
|
+
# See https://github.com/metanorma/cimas
|
1
3
|
image:
|
2
|
-
name:
|
4
|
+
name: metanorma/mn
|
3
5
|
entrypoint: [""]
|
4
6
|
|
5
7
|
cache:
|
6
8
|
paths:
|
7
9
|
|
10
|
+
stages:
|
11
|
+
- build
|
12
|
+
- deploy
|
13
|
+
|
14
|
+
|
8
15
|
build:
|
9
16
|
stage: build
|
10
17
|
script:
|
11
|
-
|
12
|
-
-
|
18
|
+
# We need to do this to install mscorefonts
|
19
|
+
- curl -Ls -o yq https://github.com/mikefarah/yq/releases/download/3.3.0/yq_linux_amd64
|
20
|
+
- chmod +x yq && mv yq /usr/bin
|
21
|
+
- yq
|
22
|
+
- apt-add-repository -y contrib && apt-get update
|
23
|
+
- echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections
|
24
|
+
- apt-get install -y ttf-mscorefonts-installer
|
25
|
+
- curl -Ls https://raw.githubusercontent.com/metanorma/vista-fonts-installer/master/vista-fonts-installer.sh | bash
|
26
|
+
- curl -L --retry 3 https://raw.githubusercontent.com/metanorma/metanorma-build-scripts/master/gemfile-to-bundle-add.sh | bash
|
27
|
+
- bundle install
|
28
|
+
- make clean all
|
29
|
+
- make published
|
30
|
+
- mv published public
|
31
|
+
artifacts:
|
32
|
+
paths:
|
33
|
+
- public
|
34
|
+
|
35
|
+
pages:
|
36
|
+
dependencies:
|
37
|
+
- build
|
38
|
+
stage: deploy
|
39
|
+
script:
|
40
|
+
- 'curl --location --output artifacts.zip --header "JOB-TOKEN: $CI_JOB_TOKEN" "https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/jobs/artifacts/master/download?job=build"'
|
13
41
|
artifacts:
|
14
42
|
paths:
|
15
|
-
-
|
43
|
+
- public
|
44
|
+
only:
|
45
|
+
- master
|
data/templates/base/Makefile
CHANGED
@@ -1,65 +1,104 @@
|
|
1
|
+
# Auto-generated by Cimas: Do not edit it manually!
|
2
|
+
# See https://github.com/metanorma/cimas
|
1
3
|
#!make
|
2
4
|
SHELL := /bin/bash
|
3
5
|
# Ensure the xml2rfc cache directory exists locally
|
4
6
|
IGNORE := $(shell mkdir -p $(HOME)/.cache/xml2rfc)
|
5
7
|
|
6
|
-
SRC := $(shell yq r metanorma.yml metanorma.source.files | cut -c 3-
|
8
|
+
SRC := $(shell yq r metanorma.yml metanorma.source.files | cut -c 3-)
|
9
|
+
|
10
|
+
ifeq ($(SRC),null)
|
11
|
+
SRC :=
|
12
|
+
endif
|
7
13
|
ifeq ($(SRC),ll)
|
8
|
-
SRC :=
|
14
|
+
SRC :=
|
15
|
+
endif
|
16
|
+
|
17
|
+
ifeq ($(SRC),)
|
18
|
+
BUILT := $(shell yq r metanorma.yml metanorma.source.built_targets | cut -d ':' -f 1 | tr -s '\n' ' ')
|
19
|
+
|
20
|
+
ifeq ($(BUILT),null)
|
21
|
+
SRC :=
|
22
|
+
endif
|
23
|
+
ifeq ($(BUILT),ll)
|
24
|
+
SRC :=
|
25
|
+
endif
|
26
|
+
|
27
|
+
ifeq ($(BUILT),)
|
28
|
+
SRC := $(filter-out README.adoc, $(wildcard sources/*.adoc))
|
29
|
+
else
|
30
|
+
XML := $(patsubst sources/%,documents/%,$(BUILT))
|
31
|
+
endif
|
9
32
|
endif
|
10
33
|
|
34
|
+
FORMATS := $(shell yq r metanorma.yml metanorma.formats | tr -d '[:space:]' | tr -s '-' ' ')
|
35
|
+
ifeq ($(FORMATS),)
|
11
36
|
FORMAT_MARKER := mn-output-
|
12
|
-
FORMATS := $(shell grep "$(FORMAT_MARKER)" $(SRC) | cut -f 2 -d
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
HTML := $(patsubst %.
|
17
|
-
DOC := $(patsubst %.adoc,%.doc,$(SRC))
|
18
|
-
PDF := $(patsubst %.adoc,%.pdf,$(SRC))
|
19
|
-
TXT := $(patsubst %.adoc,%.txt,$(SRC))
|
20
|
-
NITS := $(patsubst %.adoc,%.nits,$(wildcard draft-*.adoc))
|
21
|
-
WSD := $(wildcard models/*.wsd)
|
22
|
-
XMI := $(patsubst models/%,xmi/%,$(patsubst %.wsd,%.xmi,$(WSD)))
|
23
|
-
PNG := $(patsubst models/%,images/%,$(patsubst %.wsd,%.png,$(WSD)))
|
24
|
-
|
25
|
-
COMPILE_CMD_LOCAL := bundle exec metanorma $$FILENAME
|
26
|
-
COMPILE_CMD_DOCKER := docker run -v "$$(pwd)":/metanorma/ ribose/metanorma "metanorma $$FILENAME"
|
37
|
+
FORMATS := $(shell grep "$(FORMAT_MARKER)" $(SRC) | cut -f 2 -d " " | tr "," "\\n" | sort | uniq | tr "\\n" " ")
|
38
|
+
endif
|
39
|
+
|
40
|
+
XML ?= $(patsubst sources/%,documents/%,$(patsubst %.adoc,%.xml,$(SRC)))
|
41
|
+
HTML := $(patsubst %.xml,%.html,$(XML))
|
27
42
|
|
28
43
|
ifdef METANORMA_DOCKER
|
29
|
-
|
44
|
+
PREFIX_CMD := echo "Running via docker..."; docker run -v "$$(pwd)":/metanorma/ $(METANORMA_DOCKER)
|
30
45
|
else
|
31
|
-
|
46
|
+
ifdef SKIP_BUNDLE
|
47
|
+
PREFIX_CMD := echo "Running locally...";
|
48
|
+
else
|
49
|
+
PREFIX_CMD := echo "Running locally via bundle ..."; bundle exec
|
50
|
+
endif
|
32
51
|
endif
|
33
52
|
|
34
53
|
_OUT_FILES := $(foreach FORMAT,$(FORMATS),$(shell echo $(FORMAT) | tr '[:lower:]' '[:upper:]'))
|
35
54
|
OUT_FILES := $(foreach F,$(_OUT_FILES),$($F))
|
36
55
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
draft-%.nits: draft-%.txt
|
44
|
-
VERSIONED_NAME=`grep :name: draft-$*.adoc | cut -f 2 -d ' '`; \
|
45
|
-
cp $^ $${VERSIONED_NAME}.txt && \
|
46
|
-
idnits --verbose $${VERSIONED_NAME}.txt > $@ && \
|
47
|
-
cp $@ $${VERSIONED_NAME}.nits && \
|
48
|
-
cat $${VERSIONED_NAME}.nits
|
49
|
-
|
50
|
-
%.nits:
|
51
|
-
|
52
|
-
nits: $(NITS)
|
53
|
-
|
54
|
-
images: $(PNG)
|
55
|
-
|
56
|
-
images/%.png: models/%.wsd
|
57
|
-
plantuml -tpng -o ../images/ $<
|
58
|
-
|
59
|
-
xmi: $(XMI)
|
56
|
+
define print_vars
|
57
|
+
$(info "src $(SRC)")
|
58
|
+
$(info "xml $(XML)")
|
59
|
+
$(info "formats $(FORMATS)")
|
60
|
+
endef
|
60
61
|
|
61
|
-
|
62
|
-
|
62
|
+
all: documents.html
|
63
|
+
$(call print_vars)
|
64
|
+
|
65
|
+
documents:
|
66
|
+
mkdir -p $@
|
67
|
+
|
68
|
+
documents/%.html: documents/%.xml | documents
|
69
|
+
${PREFIX_CMD} metanorma $<
|
70
|
+
|
71
|
+
documents/%.xml: sources/%.xml | documents
|
72
|
+
mkdir -p $(dir $@)
|
73
|
+
mv $< $@
|
74
|
+
|
75
|
+
# Build canonical XML output
|
76
|
+
# If XML file is provided, copy it over
|
77
|
+
# Otherwise, build the xml using adoc
|
78
|
+
sources/%.xml: | bundle
|
79
|
+
BUILT_TARGET="$(shell yq r metanorma.yml metanorma.source.built_targets[$@])"; \
|
80
|
+
if [ "$$BUILT_TARGET" = "" ] || [ "$$BUILT_TARGET" = "null" ]; then \
|
81
|
+
BUILT_TARGET=$@; \
|
82
|
+
$(PREFIX_CMD) metanorma -x xml "$${BUILT_TARGET//xml/adoc}"; \
|
83
|
+
else \
|
84
|
+
if [ -f "$$BUILT_TARGET" ] && [ "$${BUILT_TARGET##*.}" == "xml" ]; then \
|
85
|
+
cp "$$BUILT_TARGET" $@; \
|
86
|
+
else \
|
87
|
+
$(PREFIX_CMD) metanorma -x xml $$BUILT_TARGET; \
|
88
|
+
cp "$${BUILT_TARGET//adoc/xml}" $@; \
|
89
|
+
fi \
|
90
|
+
fi
|
91
|
+
|
92
|
+
documents.rxl: $(XML) $(HTML)
|
93
|
+
${PREFIX_CMD} relaton concatenate \
|
94
|
+
-t "$(shell yq r metanorma.yml relaton.collection.name)" \
|
95
|
+
-g "$(shell yq r metanorma.yml relaton.collection.organization)" \
|
96
|
+
documents $@
|
97
|
+
|
98
|
+
documents.html: documents.rxl
|
99
|
+
$(PREFIX_CMD) relaton xml2html documents.rxl
|
100
|
+
|
101
|
+
%.adoc:
|
63
102
|
|
64
103
|
define FORMAT_TASKS
|
65
104
|
OUT_FILES-$(FORMAT) := $($(shell echo $(FORMAT) | tr '[:lower:]' '[:upper:]'))
|
@@ -81,10 +120,15 @@ $(foreach FORMAT,$(FORMATS),$(eval $(FORMAT_TASKS)))
|
|
81
120
|
open: open-html
|
82
121
|
|
83
122
|
clean:
|
84
|
-
rm -
|
123
|
+
rm -rf documents documents.{html,rxl} published *_images $(OUT_FILES)
|
85
124
|
|
86
125
|
bundle:
|
87
|
-
|
126
|
+
ifndef METANORMA_DOCKER
|
127
|
+
ifndef SKIP_BUNDLE
|
128
|
+
bundle install --jobs 4 --retry 3
|
129
|
+
endif
|
130
|
+
endif
|
131
|
+
$(call print_vars)
|
88
132
|
|
89
133
|
.PHONY: bundle all open clean
|
90
134
|
|
@@ -102,20 +146,20 @@ $(NODE_PACKAGE_PATHS): package.json
|
|
102
146
|
npm i
|
103
147
|
|
104
148
|
watch: $(NODE_BIN_DIR)/onchange
|
105
|
-
|
106
|
-
$< $(ALL_SRC) --
|
149
|
+
make all
|
150
|
+
$< $(ALL_SRC) -- make all
|
107
151
|
|
108
152
|
define WATCH_TASKS
|
109
153
|
watch-$(FORMAT): $(NODE_BIN_DIR)/onchange
|
110
|
-
|
111
|
-
$$< $$(SRC_$(FORMAT)) --
|
154
|
+
make $(FORMAT)
|
155
|
+
$$< $$(SRC_$(FORMAT)) -- make $(FORMAT)
|
112
156
|
|
113
157
|
.PHONY: watch-$(FORMAT)
|
114
158
|
endef
|
115
159
|
|
116
160
|
$(foreach FORMAT,$(FORMATS),$(eval $(WATCH_TASKS)))
|
117
161
|
|
118
|
-
serve: $(NODE_BIN_DIR)/live-server revealjs-css reveal.js
|
162
|
+
serve: $(NODE_BIN_DIR)/live-server revealjs-css reveal.js
|
119
163
|
export PORT=$${PORT:-8123} ; \
|
120
164
|
port=$${PORT} ; \
|
121
165
|
for html in $(HTML); do \
|
@@ -130,15 +174,23 @@ watch-serve: $(NODE_BIN_DIR)/run-p
|
|
130
174
|
# Deploy jobs
|
131
175
|
#
|
132
176
|
|
133
|
-
publish:
|
134
|
-
$(MAKE) published
|
177
|
+
publish: published
|
135
178
|
|
136
|
-
published:
|
179
|
+
published: documents.html
|
137
180
|
mkdir -p $@ && \
|
138
|
-
|
139
|
-
cp
|
140
|
-
|
141
|
-
|
181
|
+
cp -a documents $@/ && \
|
182
|
+
cp $< $@/index.html;
|
183
|
+
|
184
|
+
#
|
185
|
+
# PDF
|
186
|
+
#
|
187
|
+
|
188
|
+
PDFTEXT := $(patsubst %.pdf,%.txt,$(subst /pdfs,/text,$(wildcard reference-docs/pdfs/*.pdf)))
|
189
|
+
|
190
|
+
pdf2text: $(PDFTEXT)
|
142
191
|
|
143
|
-
|
192
|
+
reference-docs/text:
|
193
|
+
mkdir -p $@
|
144
194
|
|
195
|
+
reference-docs/text/%.txt: reference-docs/pdfs/%.pdf | reference-docs/text
|
196
|
+
ps2ascii "$<" "$@"
|
data/templates/base/Makefile.win
CHANGED
@@ -1,53 +1,126 @@
|
|
1
|
+
# Auto-generated by Cimas: Do not edit it manually!
|
2
|
+
# See https://github.com/metanorma/cimas
|
1
3
|
#!make
|
4
|
+
SHELL := cmd
|
5
|
+
# Ensure the xml2rfc cache directory exists locally
|
6
|
+
IGNORE := $(shell md $(USERPROFILE)\.cache\xml2rfc)
|
2
7
|
|
3
|
-
|
4
|
-
|
8
|
+
SRC := $(shell yq r metanorma.yml metanorma.source.files | cut -c 3-)
|
9
|
+
|
10
|
+
ifeq ($(SRC),null)
|
11
|
+
SRC :=
|
12
|
+
endif
|
13
|
+
ifeq ($(SRC),ll)
|
14
|
+
SRC :=
|
15
|
+
endif
|
16
|
+
|
17
|
+
ifeq ($(SRC),)
|
18
|
+
BUILT := $(subst ${ },${\n},$(shell yq r metanorma.yml metanorma.source.built_targets | cut -d ":" -f 1))
|
19
|
+
|
20
|
+
ifeq ($(BUILT),null)
|
21
|
+
BUILT :=
|
22
|
+
SRC :=
|
23
|
+
endif
|
24
|
+
ifeq ($(BUILT),ll)
|
25
|
+
BUILT :=
|
26
|
+
SRC :=
|
27
|
+
endif
|
28
|
+
ifeq ($(BUILT),)
|
29
|
+
SRC :=
|
30
|
+
endif
|
31
|
+
|
32
|
+
ifeq ($(BUILT),)
|
33
|
+
SRC := $(filter-out README.adoc, $(wildcard sources/*.adoc))
|
34
|
+
else
|
35
|
+
XML := $(patsubst sources/%,documents/%,$(BUILT))
|
36
|
+
endif
|
37
|
+
endif
|
5
38
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
39
|
+
FORMATS := $(subst -,${ },$(strip $(shell yq r metanorma.yml metanorma.formats)))
|
40
|
+
ifeq ($(FORMATS),null)
|
41
|
+
FORMATS :=
|
42
|
+
endif
|
43
|
+
ifeq ($(FORMATS),)
|
44
|
+
FORMAT_MARKER := mn-output-
|
45
|
+
FORMATS := $(subst ${\n},${ },$(shell grep "$(FORMAT_MARKER)" $(SRC) | cut -f 2 -d " " | tr "," "\n" | sort | uniq))
|
46
|
+
endif
|
14
47
|
|
15
|
-
|
16
|
-
|
17
|
-
COMPILE_CMD_DOCKER := docker run --rm -it -v $(CURDIR):/metanorma/ ribose/metanorma "metanorma $(SRC)"
|
48
|
+
XML ?= $(patsubst sources/%,documents/%,$(patsubst %.adoc,%.xml,$(SRC)))
|
49
|
+
HTML := $(patsubst %.xml,%.html,$(XML))
|
18
50
|
|
19
51
|
ifdef METANORMA_DOCKER
|
20
|
-
|
52
|
+
PREFIX_CMD := echo "Running via docker..." & docker run -v "$$(pwd)":/metanorma/ $(METANORMA_DOCKER)
|
21
53
|
else
|
22
|
-
|
54
|
+
ifdef SKIP_BUNDLE
|
55
|
+
PREFIX_CMD := echo "Running locally..." &
|
56
|
+
else
|
57
|
+
PREFIX_CMD := echo "Running locally via bundle ..." & bundle exec
|
58
|
+
endif
|
23
59
|
endif
|
24
60
|
|
25
61
|
_OUT_FILES := $(foreach FORMAT,$(FORMATS),$(shell echo $(FORMAT) | tr '[:lower:]' '[:upper:]'))
|
26
62
|
OUT_FILES := $(foreach F,$(_OUT_FILES),$($F))
|
27
63
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
$
|
64
|
+
define print_vars
|
65
|
+
$(info "src $(SRC)")
|
66
|
+
$(info "xml $(XML)")
|
67
|
+
$(info "formats $(FORMATS)")
|
68
|
+
endef
|
32
69
|
|
33
|
-
|
70
|
+
all: documents.html
|
71
|
+
$(call print_vars)
|
72
|
+
|
73
|
+
documents:
|
74
|
+
setlocal enableextensions & md $@ & endlocal
|
75
|
+
|
76
|
+
documents/%.html: documents/%.xml | documents
|
77
|
+
${PREFIX_CMD} metanorma $<
|
78
|
+
|
79
|
+
documents/%.xml: sources/%.xml | documents
|
80
|
+
if not exist "$(subst /,\,$(dir $@))" md "$(subst /,\,$(dir $@))"
|
81
|
+
move "$(subst /,\,$<)" "$(subst /,\,$@)"
|
82
|
+
|
83
|
+
# Build canonical XML output
|
84
|
+
# If XML file is provided, copy it over
|
85
|
+
# Otherwise, build the xml using adoc
|
86
|
+
sources/%.xml: | bundle
|
87
|
+
$(eval BUILT_TARGET := $(subst /,\,$(shell yq r metanorma.yml metanorma.source.built_targets[$@])))
|
88
|
+
$(eval BUILT_TARGET_EMPTY := $(if $(filter $(or $(BUILT_TARGET),null),null ll),true,false))
|
89
|
+
if "$(BUILT_TARGET_EMPTY)" == "true" ( \
|
90
|
+
$(PREFIX_CMD) metanorma -x xml "$(subst xml,adoc,$@)" \
|
91
|
+
) else ( \
|
92
|
+
if exist "$(BUILT_TARGET)" ( \
|
93
|
+
if "$(suffix $(BUILT_TARGET))" == ".xml" ( \
|
94
|
+
copy "$(BUILT_TARGET)" "$(subst /,\,$@)" \
|
95
|
+
) else ( \
|
96
|
+
$(PREFIX_CMD) metanorma $(BUILT_TARGET) & \
|
97
|
+
copy "$(subst adoc,xml,$(BUILT_TARGET))" "$(subst /,\,$@)" \
|
98
|
+
) \
|
99
|
+
) else ( \
|
100
|
+
$(PREFIX_CMD) metanorma $(BUILT_TARGET) & \
|
101
|
+
copy "$(subst adoc,xml,$(BUILT_TARGET))" "$(subst /,\,$@)" \
|
102
|
+
) \
|
103
|
+
)
|
34
104
|
|
35
|
-
|
36
|
-
|
105
|
+
documents.rxl: $(XML) $(HTML)
|
106
|
+
${PREFIX_CMD} relaton concatenate \
|
107
|
+
-t "$(shell yq r metanorma.yml relaton.collection.name)" \
|
108
|
+
-g "$(shell yq r metanorma.yml relaton.collection.organization)" \
|
109
|
+
documents $@
|
37
110
|
|
38
|
-
|
111
|
+
documents.html: documents.rxl
|
112
|
+
$(PREFIX_CMD) relaton xml2html documents.rxl
|
39
113
|
|
40
|
-
|
41
|
-
plantuml -xmi:star -o ../xmi/ $<
|
114
|
+
%.adoc:
|
42
115
|
|
43
116
|
define FORMAT_TASKS
|
44
117
|
OUT_FILES-$(FORMAT) := $($(shell echo $(FORMAT) | tr '[:lower:]' '[:upper:]'))
|
45
118
|
|
46
119
|
open-$(FORMAT):
|
47
|
-
$$(OUT_FILES-$(FORMAT))
|
120
|
+
"$$(OUT_FILES-$(FORMAT))"
|
48
121
|
|
49
122
|
clean-$(FORMAT):
|
50
|
-
|
123
|
+
del /q $$(OUT_FILES-$(FORMAT))
|
51
124
|
|
52
125
|
$(FORMAT): clean-$(FORMAT) $$(OUT_FILES-$(FORMAT))
|
53
126
|
|
@@ -61,9 +134,17 @@ open: open-html
|
|
61
134
|
|
62
135
|
clean:
|
63
136
|
rm -rf $(OUT_FILES)
|
137
|
+
del /q documents published
|
138
|
+
del /q *_images
|
139
|
+
del /q documents.*
|
64
140
|
|
65
141
|
bundle:
|
66
|
-
|
142
|
+
ifndef METANORMA_DOCKER
|
143
|
+
ifndef SKIP_BUNDLE
|
144
|
+
bundle install --jobs 4 --retry 3
|
145
|
+
endif
|
146
|
+
endif
|
147
|
+
$(call print_vars)
|
67
148
|
|
68
149
|
.PHONY: bundle all open clean
|
69
150
|
|
@@ -94,9 +175,12 @@ endef
|
|
94
175
|
|
95
176
|
$(foreach FORMAT,$(FORMATS),$(eval $(WATCH_TASKS)))
|
96
177
|
|
97
|
-
|
98
|
-
|
99
|
-
|
178
|
+
ifndef PORT
|
179
|
+
override PORT = 8123
|
180
|
+
endif
|
181
|
+
|
182
|
+
serve: $(NODE_BIN_DIR)/live-server revealjs-css reveal.js
|
183
|
+
set port=$(PORT) & \
|
100
184
|
for /r %%html in $(HTML) do ( \
|
101
185
|
$< --entry-file=%%html --port=%port% --ignore="*.html,*.xml,Makefile,Gemfile.*,package.*.json" --wait=1000 & \
|
102
186
|
set /A port=%port%+1 \
|
@@ -109,8 +193,24 @@ watch-serve: $(NODE_BIN_DIR)/run-p
|
|
109
193
|
# Deploy jobs
|
110
194
|
#
|
111
195
|
|
112
|
-
publish:
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
196
|
+
publish: published
|
197
|
+
|
198
|
+
published: documents.html
|
199
|
+
setlocal enableextensions & md $@ & endlocal
|
200
|
+
copy documents $@/
|
201
|
+
copy $< $@/index.html
|
202
|
+
if exist "source\images" xcopy /E source\images $@
|
203
|
+
|
204
|
+
#
|
205
|
+
# PDF
|
206
|
+
#
|
207
|
+
|
208
|
+
PDFTEXT := $(patsubst %.pdf,%.txt,$(subst /pdfs,/text,$(wildcard reference-docs/pdfs/*.pdf)))
|
209
|
+
|
210
|
+
pdf2text: $(PDFTEXT)
|
211
|
+
|
212
|
+
reference-docs/text:
|
213
|
+
md $@
|
214
|
+
|
215
|
+
reference-docs/text/%.txt: reference-docs/pdfs/%.pdf | reference-docs/text
|
216
|
+
ps2ascii "$<" "$@"
|