-
Notifications
You must be signed in to change notification settings - Fork 1
/
mkDocs.sh
executable file
·65 lines (52 loc) · 2.31 KB
/
mkDocs.sh
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
#!/bin/bash -e
## CREATE TARGET DIRECTORY ##
rm -rf target
mkdir target
mkdir target/generated-docs
npm install
npm run build-release
## GENERATE THE DOCUMENTATION ##
docker run -a STDERR --rm -i -v `pwd`:/docs gisaia/typedocgen:0.0.8 generatedoc --entryPoints projects/arlas-toolkit/src/public-api.ts --tsconfig projects/arlas-toolkit/tsconfig.lib.json
## MOVE ALL THE DOCUMENTATION TO THE 'generated-docs' FOLDER ##
mv typedoc_docs/* target/generated-docs
cp CHANGELOG.md target/generated-docs/CHANGELOG_ARLAS-wui-toolkit.md
if [ -d ./docs ] ; then
cp -r docs/* target/generated-docs
fi
mkdir -p target/generated-docs/schemas-doc/
mkdir -p target/generated-docs/schemas/
## COPY CONTRIBUTOR SCHEMA
cp node_modules/arlas-web-contributors/jsonSchemas/* target/generated-docs/schemas/
## COPY ARLAS SCHEMA
cp projects/arlas-toolkit/src/lib/services/startup/*.json target/generated-docs/schemas/
## COPY COMPONENT SCHEMA
for f in $(find node_modules/arlas-web-components -name '*.schema.json'); do
cp $f target/generated-docs/schemas/;
done
function parseFilePath {
filename=$(basename $1)
echo '### '${filename} >> target/generated-docs/schemas-doc/schemas.md
echo ' ' >> target/generated-docs/schemas-doc/schemas.md
echo ' [source](../schemas/'${1}')'>> target/generated-docs/schemas-doc/schemas.md
echo ' ' >> target/generated-docs/schemas-doc/schemas.md
echo '```json' >> target/generated-docs/schemas-doc/schemas.md
cat ${1} >> target/generated-docs/schemas-doc/schemas.md
echo ' ' >> target/generated-docs/schemas-doc/schemas.md
echo '```' >> target/generated-docs/schemas-doc/schemas.md
}
## GENERATE ARLAS SCHEMA MD
echo '# List of json schemas' > target/generated-docs/schemas-doc/schemas.md
echo '## ARLAS' >> target/generated-docs/schemas-doc/schemas.md
for filepath in projects/arlas-toolkit/src/lib/services/startup/*.json; do
parseFilePath ${filepath}
done
## GENERATE CONTRIBUTOR SCHEMA MD
echo '## Contributors' >> target/generated-docs/schemas-doc/schemas.md
for filepath in node_modules/arlas-web-contributors/jsonSchemas/*.json; do
parseFilePath ${filepath}
done
## GENERATE COMPONENT SCHEMA MD
echo '## Components' >> target/generated-docs/schemas-doc/schemas.md
for filepath in $(find node_modules/arlas-web-components -name '*.schema.json'); do
parseFilePath ${filepath}
done