-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgen-docs.sh
More file actions
executable file
·65 lines (50 loc) · 2.42 KB
/
gen-docs.sh
File metadata and controls
executable file
·65 lines (50 loc) · 2.42 KB
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
#!/bin/bash
set -e
cd ${0%/*}
rm -rf ./docs
rm -rf ./docs-xml
ceramic clay setup web
ceramic clay hxml web > docs.hxml
$(ceramic haxe) docs.hxml --xml ../../../docs/clay-web.xml -D doc-gen -D documentation -D dox_events --no-output -D no-compilation
if [ "$(uname)" == "Darwin" ]; then
ceramic clay setup mac
ceramic clay hxml mac > docs.hxml
$(ceramic haxe) docs.hxml --xml ../../../docs/clay-native.xml -D doc-gen -D documentation -D dox_events --no-output -D no-compilation
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
ceramic clay setup linux
ceramic clay hxml linux > docs.hxml
$(ceramic haxe) docs.hxml --xml ../../../docs/clay-native.xml -D doc-gen -D documentation -D dox_events --no-output -D no-compilation
fi
ceramic headless setup node
ceramic headless hxml node > docs.hxml
$(ceramic haxe) docs.hxml --xml ../../../docs/headless.xml -D doc-gen -D documentation -D no_backend_docs -D dox_events --no-output -D no-compilation
ceramic unity setup unity
ceramic unity hxml unity > docs.hxml
$(ceramic haxe) docs.hxml --xml ../../../docs/unity.xml -D doc-gen -D documentation -D no_backend_docs -D dox_events --no-output -D no-compilation
mkdir docs-xml
cp -f docs/*.xml docs-xml
# Build gen-docs tool
cd gen-docs
haxe build.hxml
cd ..
# Generate markdown documentation from XML files
rm -rf ./docs-md
mkdir -p docs-md
# Generate markdown for each XML file
for xml_file in docs-xml/*.xml; do
base_name=$(basename "$xml_file" .xml)
echo "Generating markdown for $base_name..."
node gen-docs/bin/gen-docs.js markdown "$xml_file" "docs-md/$base_name"
# Generate table of contents
echo "Generating table of contents for $base_name..."
node gen-docs/bin/gen-docs.js toc "$xml_file" "docs-md/$base_name/toc.json"
# Generate index
echo "Generating index for $base_name..."
node gen-docs/bin/gen-docs.js index "docs-md/$base_name/toc.json" "docs-md/$base_name/index.md" "$base_name"
done
# Generate root index
echo "Generating root index..."
node gen-docs/bin/gen-docs.js root-index "docs-md"
# Old dox command (commented out since we're using our own generator now)
# $(ceramic haxelib) run dox -i ./docs --output-path docs --keep-field-order --exclude 'zpp_nape|microsoft|unityengine|fuzzaldrin|gif|timestamp|stb|sys|spec|sdl|polyline|poly2tri|opengl|openal|ogg|js|hsluv|hscript|glew|format|earcut|cs|cpp|com|assets|ceramic.scriptable|ceramic.macros' --title 'Ceramic API'
# node transform-docs.js