Skip to content

Commit aad9959

Browse files
author
Robert Maier
committed
doc(All): Add support for building a documentation
1 parent c290a2f commit aad9959

File tree

6 files changed

+199
-6
lines changed

6 files changed

+199
-6
lines changed

.gitignore

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
### Custom
66
Code/BayesianSafety/[Rr]eports
77
Code/BayesianSafety/[Vv]env
8-
[Dd]ocu/
8+
[Dd]ocumentation/
99
[Pp]lots/
1010
*.png
1111
*.jpeg
@@ -514,7 +514,7 @@ instance/
514514
.scrapy
515515

516516
# Sphinx documentation
517-
docs/_build/
517+
_build/
518518

519519
# PyBuilder
520520
.pybuilder/
@@ -1049,9 +1049,6 @@ vignettes/*.pdf
10491049
# R Environment Variables
10501050
.Renviron
10511051

1052-
# pkgdown site
1053-
docs/
1054-
10551052
# translation temp files
10561053
po/*~
10571054

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,14 @@ pip install -U Sphinx
3535
pip install sphinx-rtd-theme
3636
```
3737

38-
Then go to the "docs" directory and simply build the documentation via
38+
Then go to the "docs" directory and build the documentation via
3939

4040
```
4141
make html
4242
```
4343

44+
Go to ./docs/documentation/html and open index.html in a browser of your choice.
45+
4446
## Citation:
4547
If you are using bayesiansafety in your work, please cite as:
4648
(Details will be available September 2022)

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = .
9+
BUILDDIR = documentation
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/conf.py

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# This file only contains a selection of the most common options. For a full
4+
# list see the documentation:
5+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6+
7+
# -- Path setup --------------------------------------------------------------
8+
9+
# If extensions (or modules to document with autodoc) are in another directory,
10+
# add these directories to sys.path here. If the directory is relative to the
11+
# documentation root, use os.path.abspath to make it absolute, like shown here.
12+
#
13+
import os
14+
import sys
15+
sys.path.insert(0, os.path.abspath('../bayesiansafety'))
16+
17+
18+
# -- Project information -----------------------------------------------------
19+
20+
project = 'BayesianSafety'
21+
copyright = '2022, Robert Maier'
22+
author = 'Robert Maier'
23+
24+
# The full version, including alpha/beta/rc tags
25+
release = '0.0.1'
26+
27+
28+
# -- General configuration ---------------------------------------------------
29+
30+
# Add any Sphinx extension module names here, as strings. They can be
31+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
32+
# ones.
33+
extensions = ['sphinx.ext.autodoc',
34+
'sphinx.ext.coverage',
35+
'sphinx.ext.napoleon',
36+
"sphinx.ext.doctest",
37+
"sphinx.ext.intersphinx",
38+
'sphinx.ext.inheritance_diagram' ]
39+
40+
41+
# Add any paths that contain templates here, relative to this directory.
42+
templates_path = ['_templates']
43+
44+
# List of patterns, relative to source directory, that match files and
45+
# directories to ignore when looking for source files.
46+
# This pattern also affects html_static_path and html_extra_path.
47+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
48+
49+
pygments_style = "sphinx"
50+
51+
52+
# -- Options for HTML output -------------------------------------------------
53+
54+
# The theme to use for HTML and HTML Help pages. See the documentation for
55+
# a list of builtin themes.
56+
#
57+
58+
59+
html_theme = 'sphinx_rtd_theme'
60+
61+
# Add any paths that contain custom static files (such as style sheets) here,
62+
# relative to this directory. They are copied after the builtin static files,
63+
# so a file named "default.css" will overwrite the builtin "default.css".
64+
html_static_path = ['_static']

docs/index.rst

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
.. BayesianSafety documentation master file, created by
2+
sphinx-quickstart on Wed Jul 6 16:47:26 2022.
3+
You can adapt this file completely to your liking, but it should at least
4+
contain the root `toctree` directive.
5+
6+
Welcome to BayesianSafety's documentation!
7+
==========================================
8+
9+
``Core``
10+
*******************
11+
.. automodule:: core
12+
:members:
13+
:show-inheritance:
14+
15+
``Inference``
16+
*******************
17+
.. automodule:: core.inference
18+
:members:
19+
:show-inheritance:
20+
21+
``EventTree``
22+
************************
23+
.. automodule:: eventtree
24+
:members:
25+
:show-inheritance:
26+
27+
``FaultTree``
28+
************************
29+
.. automodule:: faulttree
30+
:members:
31+
:show-inheritance:
32+
33+
``BowTie``
34+
*********************
35+
.. automodule:: bowtie
36+
:members:
37+
:show-inheritance:
38+
39+
40+
``Synthesis``
41+
************************
42+
.. automodule:: synthesis
43+
:members:
44+
:show-inheritance:
45+
46+
``Functional synthesis``
47+
************************
48+
.. automodule:: synthesis.functional
49+
:members:
50+
:show-inheritance:
51+
52+
``Hybrid synthesis``
53+
************************
54+
.. automodule:: synthesis.functional
55+
:members:
56+
:show-inheritance:
57+
58+
``Utils``
59+
********************
60+
.. automodule:: utils.utils
61+
:members:
62+
:show-inheritance:
63+
64+
.. toctree::
65+
:maxdepth: 3
66+
:caption: Contents:
67+
68+
69+
70+
Indices and tables
71+
==================
72+
73+
* :ref:`genindex`
74+
* :ref:`modindex`
75+
* :ref:`search`

docs/make.bat

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=.
11+
set BUILDDIR=documentation
12+
13+
%SPHINXBUILD% >NUL 2>NUL
14+
if errorlevel 9009 (
15+
echo.
16+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
17+
echo.installed, then set the SPHINXBUILD environment variable to point
18+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
19+
echo.may add the Sphinx directory to PATH.
20+
echo.
21+
echo.If you don't have Sphinx installed, grab it from
22+
echo.https://www.sphinx-doc.org/
23+
exit /b 1
24+
)
25+
26+
if "%1" == "" goto help
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

0 commit comments

Comments
 (0)