-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'update.documentation.scripts' into 'master.dev'
Added prerequisites checks for the HTML and PDF building scripts + info where... See merge request piclas/piclas!875
- Loading branch information
Showing
2 changed files
with
34 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |