-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
rebuild_docs
executable file
·38 lines (35 loc) · 1.12 KB
/
rebuild_docs
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
#!/bin/bash
# Reformats our documentation into geminidoc
HAIKU_SOURCES=$HOME/Code/haiku
cd content
for i in develop user api; do
WORKPATH=$HAIKU_SOURCES/docs/$i
echo "Scanning $WORKPATH..."
if [ -f "$WORKPATH/Doxyfile" ]; then
# XXX: Working.. but looks horrible
echo "Detected Doxygen at $WORKPATH"
## Install moxygen (doxygen to markdown)
#npm install -g --prefix $HOME/.node moxygen
#cd $WORKPATH
#( cat Doxyfile ; \
# echo "GENERATE_HTML=NO" ; \
# echo "GENERATE_XML=YES" ; \
# echo "OUTPUT_DIRECTORY=output" ) | doxygen -
#cd - && rm -rf $i && mkdir -p $i && cd $i
#echo "Doxygen to markdown..."
#$HOME/.node/bin/moxygen -g $WORKPATH/output/xml/
#echo "Markdown to gemini..."
#for i in *.md*; do echo "Processing $i..."; md2gmn -f "$i" > "$i.gmi"; rm -f "$i"; done
elif [ -f "$WORKPATH/conf.py" ]; then
# XXX: Working, looks okish with errors
echo "Detected Sphinx at $WORKPATH"
pip install --upgrade --break-system-packages sphinx_gemini_builder
echo "Cleaning up old docs..."
rm -rf docs/$i
cd $WORKPATH
make gemini
cd -
mkdir -p docs/$i
mv $WORKPATH/generated/gemini/* docs/$i
fi
done