Skip to content

Commit b3efdb9

Browse files
committed
Update docs
1 parent 90f6b12 commit b3efdb9

9 files changed

Lines changed: 156 additions & 4 deletions

File tree

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,12 @@ See [Examples](./examples)
129129

130130
## Documentation
131131

132+
### Python library
133+
134+
See [Carbonfly GitHub Pages](https://rwth-e3d.github.io/carbonfly/)
135+
136+
### Grasshopper Toolbox
137+
132138
See [Documentation](./documentation)
133139

134140
## Instructions for Developers & FAQs
Lines changed: 48 additions & 0 deletions
Loading

docs/source/_static/custom.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/* Navigation */
2+
.wy-side-nav-search{
3+
background-color: rgb(237,240,240);
4+
}
5+
6+
/* logo */
7+
.wy-side-nav-search>a img.logo {
8+
width: 160px;
9+
height: auto;
10+
}

docs/source/api.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
API Documentation
2+
=================
3+
4+
.. toctree::
5+
:maxdepth: 4
6+
:hidden:
7+
8+
carbonfly

docs/source/carbonfly.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Subpackages
1111

1212
.. toctree::
1313
:maxdepth: 4
14+
:hidden:
1415

1516
carbonfly.pythermalcomfort
1617

@@ -19,6 +20,7 @@ Submodules
1920

2021
.. toctree::
2122
:maxdepth: 4
23+
:hidden:
2224

2325
carbonfly.blockmesh_writer
2426
carbonfly.boundary

docs/source/conf.py

Lines changed: 63 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@
2222
# -- General configuration ---------------------------------------------------
2323
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
2424

25-
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.napoleon']
25+
extensions = [
26+
'sphinx.ext.autodoc',
27+
'sphinx.ext.napoleon',
28+
'sphinx.ext.linkcode'
29+
]
2630

2731
templates_path = ['_templates']
2832
exclude_patterns = []
@@ -35,6 +39,63 @@
3539
html_theme = 'sphinx_rtd_theme'
3640
html_theme_options = {
3741
"collapse_navigation": False,
38-
"navigation_depth": 4
42+
"navigation_depth": 4,
43+
"logo_only": True,
3944
}
4045
html_static_path = ['_static']
46+
47+
html_context = {
48+
"display_github": True,
49+
"github_user": "RWTH-E3D",
50+
"github_repo": "carbonfly",
51+
"github_version": "master",
52+
"conf_py_path": "/docs/source/",
53+
}
54+
55+
html_css_files = [
56+
'custom.css',
57+
]
58+
59+
html_logo = "_static/carbonfly_logo.svg"
60+
61+
62+
# Prevent import errors from halting the building process
63+
# when some external dependencies cannot be imported at build time
64+
autodoc_mock_imports = [
65+
"Rhino"
66+
]
67+
68+
69+
# link code
70+
import inspect
71+
72+
def linkcode_resolve(domain, info):
73+
if domain != 'py':
74+
return None
75+
76+
module_name = info['module']
77+
fullname = info['fullname']
78+
79+
try:
80+
mod = sys.modules.get(module_name)
81+
if mod is None:
82+
__import__(module_name)
83+
mod = sys.modules[module_name]
84+
85+
obj = mod
86+
for part in fullname.split('.'):
87+
obj = getattr(obj, part)
88+
89+
# source code location
90+
fn = inspect.getsourcefile(obj)
91+
if not fn:
92+
return None
93+
fn = os.path.relpath(fn, start=os.path.dirname(carbonfly.__file__))
94+
95+
source, lineno = inspect.getsourcelines(obj)
96+
linespec = f"#L{lineno}-L{lineno + len(source) - 1}"
97+
98+
return f"https://github.com/RWTH-E3D/carbonfly/blob/master/carbonfly/{fn}{linespec}"
99+
100+
except Exception:
101+
return None

docs/source/index.rst

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,21 @@
66
Carbonfly documentation
77
=======================
88

9+
**Version:** |release|
10+
911
.. include:: introduction.rst
1012

1113
.. toctree::
1214
:maxdepth: 4
13-
:caption: Contents:
15+
:caption: GETTING STARTED:
16+
17+
tutorials
18+
19+
.. toctree::
20+
:maxdepth: 4
21+
:caption: DOCUMENTATION:
1422

15-
modules
23+
api
1624

1725
Indices and tables
1826
==================

docs/source/modules.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ carbonfly
33

44
.. toctree::
55
:maxdepth: 4
6+
:hidden:
67

78
carbonfly

docs/source/tutorials.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Tutorials
2+
=========
3+
4+
Carbonfly Tutorial Series on YouTube:
5+
6+
- `How to Install <https://youtu.be/2cnaCHx_9OI>`_
7+
- `How to Visualize Results in ParaView <https://youtu.be/AmVhmxK9TTk>`_
8+
- `Build a simple rooom from scratch <https://youtu.be/XfnMbLuyKls>`_

0 commit comments

Comments
 (0)