Skip to content

Commit

Permalink
Merge branch 'update.documentation.scripts' into 'master.dev'
Browse files Browse the repository at this point in the history
Added prerequisites checks for the HTML and PDF building scripts + info where...

See merge request piclas/piclas!875
  • Loading branch information
pnizenkov committed Nov 13, 2023
2 parents 13b8def + de3ace3 commit 06d69b3
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 8 deletions.
17 changes: 15 additions & 2 deletions docs/documentation/buildHTML.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,15 @@
# Compile html files
python3 -m sphinx -T -E -b html -d _build/doctrees -D language=en . _build/html
#!/bin/bash

# Check prerequisites
python3 -c "import sphinx"

# $? Stores the exit value of the last command that was executed.
if [[ $? -eq 0 ]]; then
# Compile html files
python3 -m sphinx -T -E -b html -d _build/doctrees -D language=en . _build/html

# Output info where the html file is
echo -e "\nThe HTML files have been created. Run, e.g., 'firefox _build/html/index.html &' to view the documentation."
else
echo -e "\nError: Could not build the documentation due to import errors in python! Fix them and run the script again."
fi
25 changes: 19 additions & 6 deletions docs/documentation/buildPDF.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
# Compile latex files
python3 -m sphinx -b latex -D language=en -d _build/doctrees . _build/latex
#!/bin/bash

# Switch to latex source files
cd _build/latex
# Check prerequisites
python3 -c "import sphinx"

# Compile pdf file(s)
latexmk -r latexmkrc -pdf -f -dvi- -ps- -jobname=piclas -interaction=nonstopmode
# $? Stores the exit value of the last command that was executed.
if [[ $? -eq 0 ]]; then
# Compile latex files
python3 -m sphinx -b latex -D language=en -d _build/doctrees . _build/latex

# Switch to latex source files
cd _build/latex

# Compile pdf file(s)
latexmk -r latexmkrc -pdf -f -dvi- -ps- -jobname=piclas -interaction=nonstopmode

# Output info where the pdf file is
echo -e "\n The PDF has been created under ./_build/latex/piclas.pdf"
else
echo -e "\nError: Could not build the documentation due to import errors in python! Fix them and run the script again."
fi

0 comments on commit 06d69b3

Please sign in to comment.