+# HTML BUILDER
+sphinx-build -v -c . -a -b html -E \
+ -D release=$1 -D version="$1 report - $DATE" \
+ ${DIR[RST]} ${DIR[BUILD]}/
+
+# Patch the CSS for tables layout
+cat - > ${DIR[CSS_PATCH_FILE]} <<"_EOF"
+/* override table width restrictions */
+@media screen and (min-width: 767px) {
+ .wy-table-responsive table td, .wy-table-responsive table th {
+ white-space: normal !important;
+ }
+
+ .wy-table-responsive {
+ font-size: small;
+ margin-bottom: 24px;
+ max-width: 100%;
+ overflow: visible !important;
+ }
+}
+_EOF
+
+# LATEX BUILDER
+if [[ ${LATEX} -eq 1 ]] ;
+then
+ # Convert PyPLOT graphs in HTML format to PDF.
+ for f in ${DIR[STATIC,VPP]}/*; do
+ wkhtmltopdf ${f} ${f%.html}.pdf
+ done
+ for f in ${DIR[STATIC,DPDK]}/*; do
+ wkhtmltopdf ${f} ${f%.html}.pdf
+ done
+ rsvg-convert -z 10 -f pdf -o fdio.pdf fdio.svg
+
+ # Generate the LaTeX documentation
+ sphinx-build -v -c . -a -b latex -E \
+ -D release=$1 -D version="$1 report - $DATE" \
+ ${DIR[RST]} ${DIR[BUILD,LATEX]}
+ cd ${DIR[BUILD,LATEX]}
+ pdflatex -shell-escape -interaction nonstopmode csit.tex || true
+ pdflatex -interaction nonstopmode csit.tex || true
+ cp csit.pdf ../${DIR[STATIC,ARCH]}/csit_$1.pdf
+ cd ${SCRIPT_DIR}
+ rm -f fdio.pdf
+fi
+