3 # Simplistic script to rebuild our documentation with sphinx-build
5 # If you are missing some dependencies, try: pip3 install --requirement docs/requirements.txt
7 # Python needs to find simgrid on my machine, but not ctest -- sorry for the hack
8 if [ -e /opt/simgrid ] ; then chmod +x /opt/simgrid; fi
13 if [ "x$1" != 'xdoxy' ] && [ -e build/xml ] ; then
14 echo "Doxygen not rerun: 'doxy' was not provided as an argument"
16 rm -rf build/xml source/api/
17 (cd source; doxygen 2>&1; cd ..) | grep -v "is not documented." # XXXXX Reduce the verbosity for now
20 if [ "x$1" != 'xjava' ] && [ -e source/java ] ; then
21 echo "javasphinx not rerun: 'java' was not provided as an argument"
25 # Use that script without installing javasphinx: javasphinx-apidoc --force -o source/java/ ../src/bindings/java/org/simgrid/msg
26 PYTHONPATH=${PYTHONPATH}:source/_ext/javasphinx python3 - --force -o source/java/ ../src/bindings/java/org/simgrid/msg <<EOF
29 from javasphinx.apidoc import main
30 if __name__ == '__main__':
31 sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
35 rm -f source/java/packages.rst # api_generated/source_java_packages.rst
36 rm -f source/java/org/simgrid/msg/package-index.rst # api_generated/source_java_org_simgrid_msg_package-index.rst
37 for f in source/java/org/simgrid/msg/* ; do
38 # Add the package name to the page titles
39 (printf "class org.simgrid.msg."; cat $f )>tmp
41 sed -i 's/==/========================/' $f # That's the right length knowing that I add 'class org.simgrid.msg.'
43 # sed -i 's/^.. java:type:: public class /.. java:type:: public class org.simgrid.msg/' source/java/org/simgrid/msg/*
44 echo "javasphinx relaunched"
47 PYTHONPATH=../lib:source/_ext/javasphinx sphinx-build -M html source build ${SPHINXOPTS} 2>&1
51 perl -pe 's/(xlink:href="(?:http|.*\.html))/target="_top" $1/' \
52 source/img/graphical-toc.svg > build/html/graphical-toc.svg
55 echo "Undocumented examples:"
56 for ex in $( (cd .. ; \
57 find examples/s4u/ -name '*.cpp'; \
58 find examples/c/ -name '*.c'; \
59 find examples/python -name '*.py'; \
62 if grep -q "example-tab:: $ex" ../examples/README.rst ; then :
63 # echo "found example-tab:: $ex"
64 elif grep -q "showfile:: $ex" ../examples/README.rst ; then :
71 if [ -e /usr/bin/linkchecker ] ; then
72 linkchecker --no-status -o csv --ignore-url='.*\.css$' --ignore-url=build/html/_modules --ignore-url=public/java/org build/html \
74 | grep -v 'urlname;parentname;baseref;result;warningstring'
77 echo "Install linkchecker to have it executed when you build the doc."