Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add new entry in Release_Notes.
[simgrid.git] / docs / Build.sh
1 #! /bin/bash
2 #
3 # Copyright (c) 2018-2023. The SimGrid Team. All rights reserved.
4
5 # This program is free software; you can redistribute it and/or modify it
6 # under the terms of the license (GNU LGPL) which comes with this package.
7
8 # Simplistic script to rebuild our documentation with sphinx-build
9
10 # If you are missing some dependencies, try: pip3 install --requirement docs/requirements.txt
11
12 # Python needs to find simgrid on my machine, but not ctest -- sorry for the hack
13 if [ -e /opt/simgrid ] ; then chmod +x /opt/simgrid; fi
14
15 set -e
16 set -o pipefail
17
18 if [ "x$1" != 'xdoxy' ] && [ -e build/xml ] ; then
19   echo "Doxygen not rerun: 'doxy' was not provided as an argument"
20 else
21   set -x
22   rm -rf build/xml source/api/
23   (cd source; doxygen 2>&1; cd ..) | (grep -v "is not documented." || true) # XXXXX Reduce the verbosity for now
24   set +x
25 fi
26
27 if [ "x$1" != 'xlogs' ] && [ -e build/log_categories.rst ] ; then
28   echo "Log categories not extracted: 'logs' was not provided as an argument"
29 else
30   set -x
31   perl ./bin/extract_logs_hierarchy.pl ../ > build/log_categories.rst
32   set +x
33 fi
34
35 PYTHONPATH=../lib sphinx-build -M html source build ${SPHINXOPTS} 2>&1
36
37 set +x
38
39 perl -pe 's/(xlink:href="(?:http|.*\.html))/target="_top" $1/' \
40      source/img/graphical-toc.svg > build/html/graphical-toc.svg
41
42 echo
43 echo "Undocumented examples:"
44 for ex in $( (cd .. ; \
45               find examples/cpp/   -name '*.cpp'; \
46               find examples/c/     -name '*.c'; \
47               find examples/python -name '*.py'; \
48              ) | sort )
49 do
50     if grep -q "example-tab:: $ex" ../examples/README.rst ; then :
51 #        echo "found example-tab:: $ex"
52     elif grep -q "showfile:: $ex" ../examples/README.rst ; then :
53     else
54         echo $ex
55     fi
56 done
57
58 set +e # Don't fail
59 if [ -e /usr/bin/linkchecker ] ; then
60     linkchecker --no-status -o csv --ignore-url='.*\.css$' --ignore-url=build/html/_modules build/html \
61      | grep -v '^#' \
62      | grep -v 'urlname;parentname;baseref;result;warningstring'
63   echo "done."
64 else
65   echo "Install linkchecker to have it executed when you build the doc."
66 fi
67
68 echo "Undocumented symbols:"
69 ./find-missing.py 2>&1