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"
17 rm -rf build/xml source/api/
18 (cd source; doxygen 2>&1; cd ..) | grep -v "is not documented." # XXXXX Reduce the verbosity for now
22 if [ "x$1" != 'xlogs' ] && [ -e build/log_categories.rst ] ; then
23 echo "Log categories not extracted: 'logs' was not provided as an argument"
26 perl ./bin/extract_logs_hierarchy.pl ../ > build/log_categories.rst
30 if [ "x$1" != 'xjava' ] && [ -e source/java ] ; then
31 echo "javasphinx not rerun: 'java' was not provided as an argument"
36 # Use that script without installing javasphinx: javasphinx-apidoc --force -o source/java/ ../src/bindings/java/org/simgrid/msg
37 PYTHONPATH=${PYTHONPATH}:source/_ext/javasphinx python3 - --force -o source/java/ ../src/bindings/java/org/simgrid/msg <<EOF
40 from javasphinx.apidoc import main
41 if __name__ == '__main__':
42 sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
46 rm -f source/java/packages.rst # api_generated/source_java_packages.rst
47 rm -f source/java/org/simgrid/msg/package-index.rst # api_generated/source_java_org_simgrid_msg_package-index.rst
48 for f in source/java/org/simgrid/msg/* ; do
49 # Add the package name to the page titles
50 (printf "class org.simgrid.msg."; cat $f )>tmp
52 sed -i 's/==/========================/' $f # That's the right length knowing that I add 'class org.simgrid.msg.'
54 # sed -i 's/^.. java:type:: public class /.. java:type:: public class org.simgrid.msg/' source/java/org/simgrid/msg/*
55 echo "javasphinx relaunched"
58 PYTHONPATH=../lib:source/_ext/javasphinx sphinx-build -M html source build ${SPHINXOPTS} 2>&1
62 perl -pe 's/(xlink:href="(?:http|.*\.html))/target="_top" $1/' \
63 source/img/graphical-toc.svg > build/html/graphical-toc.svg
66 echo "Undocumented examples:"
67 for ex in $( (cd .. ; \
68 find examples/cpp/ -name '*.cpp'; \
69 find examples/c/ -name '*.c'; \
70 find examples/python -name '*.py'; \
73 if grep -q "example-tab:: $ex" ../examples/README.rst ; then :
74 # echo "found example-tab:: $ex"
75 elif grep -q "showfile:: $ex" ../examples/README.rst ; then :
82 if [ -e /usr/bin/linkchecker ] ; then
83 linkchecker --no-status -o csv --ignore-url='.*\.css$' --ignore-url=build/html/_modules --ignore-url=public/java/org build/html \
85 | grep -v 'urlname;parentname;baseref;result;warningstring'
88 echo "Install linkchecker to have it executed when you build the doc."