Skip to content

Commit 0ab18e6

Browse files
authored
Merge pull request #492 from Blueprints-org/374-documentation-issue-change-doc-engine-sphinx-to-mkdocs
374 documentation issue change doc engine sphinx to mkdocs
2 parents cc7b17e + fd8df81 commit 0ab18e6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+423
-501
lines changed

.readthedocs.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ build:
1111
tools:
1212
python: "3.12"
1313

14-
# Build documentation in the "docs/" directory with Sphinx
15-
sphinx:
16-
configuration: docs/source/conf.py
14+
# Build documentation in the "docs/" directory with mkdocs
15+
mkdocs:
16+
configuration: mkdocs.yml
1717

1818
# Optionally build your docs in additional formats such as PDF and ePub
1919
formats:

README.md

Lines changed: 39 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Our mission is to reduce the cost and time associated with civil engineering cal
7676
* Steel checks (NEN-EN 1993)
7777
- *To Be Determined*
7878

79-
* Geotechnical checks (NEN-EN 9997-1
79+
* Geotechnical checks (NEN-EN 9997-1)
8080
- *To Be Determined*
8181

8282
* Common calculations
@@ -88,12 +88,32 @@ Our mission is to reduce the cost and time associated with civil engineering cal
8888

8989
<summary> Progress definitions </summary>
9090

91-
| Icon | Definition |
92-
| --- | --------- |
93-
| ![](https://img.shields.io/badge/20%25-grey?style=plastic&labelColor=orange) | Just started |
94-
| ![](https://img.shields.io/badge/50-%25-grey?style=plastic&labelColor=yellow) | Making progress |
95-
| ![](https://img.shields.io/badge/80%25--grey?style=plastic&labelColor=yellowgreen) | In Review |
96-
| ✔️ | Done |
91+
<table border="1">
92+
<thead>
93+
<tr>
94+
<th>Icon</th>
95+
<th>Definition</th>
96+
</tr>
97+
</thead>
98+
<tbody>
99+
<tr>
100+
<td><img src="https://img.shields.io/badge/20%25-grey?style=plastic&labelColor=orange" alt="20% Icon"></td>
101+
<td>Just started</td>
102+
</tr>
103+
<tr>
104+
<td><img src="https://img.shields.io/badge/50-%25-grey?style=plastic&labelColor=yellow" alt="50% Icon"></td>
105+
<td>Making progress</td>
106+
</tr>
107+
<tr>
108+
<td><img src="https://img.shields.io/badge/80%25--grey?style=plastic&labelColor=yellowgreen" alt="80% Icon"></td>
109+
<td>In Review</td>
110+
</tr>
111+
<tr>
112+
<td>✔️</td>
113+
<td>Done</td>
114+
</tr>
115+
</tbody>
116+
</table>
97117

98118
</details>
99119

@@ -137,39 +157,39 @@ figures for streamlined access and reference.
137157
Eurocode 2: Design of concrete structures – Part 1-1: General rules and rules for buildings
138158
(<a href="blueprints/codes/eurocode/nen_en_1992_1_1_c2_2011">code</a>)
139159
</td>
140-
<td><a href="docs/source/codes/eurocode/ec2_1992_1_1_2011/formulas.md">304</a></td>
141-
<td><a href="docs/source/codes/eurocode/ec2_1992_1_1_2011/tables.md">38</a></td>
142-
<td><a href="docs/source/codes/eurocode/ec2_1992_1_1_2011/figures.md">104</a></td>
160+
<td><a href="docs/objects_overview/eurocode/ec2_1992_1_1_2011/formulas.md">304</a></td>
161+
<td><a href="docs/objects_overview/eurocode/ec2_1992_1_1_2011/tables.md">38</a></td>
162+
<td><a href="docs/objects_overview/eurocode/ec2_1992_1_1_2011/figures.md">104</a></td>
143163
</tr>
144164
<tr>
145165
<td>NEN-EN 1993-1-1+C2+A1:2016</td>
146166
<td>
147167
NEN-EN 1993-1-1+C2+A1:2016 | Eurocode 3: Design of steel structures – Part 1-1: General rules and rules for buildings
148168
(<a href="blueprints/codes/eurocode/nen_en_1993_1_1_c2_a1_2016">code</a>)
149169
</td>
150-
<td><a href="docs/source/codes/eurocode/ec3_1993_1_1_2016/formulas.md">108</a></td>
151-
<td><a href="docs/source/codes/eurocode/ec3_1993_1_1_2016/tables.md">20</a></td>
152-
<td><a href="docs/source/codes/eurocode/ec3_1993_1_1_2016/figures.md">28</a></td>
170+
<td><a href="docs/objects_overview/eurocode/ec3_1993_1_1_2016/formulas.md">108</a></td>
171+
<td><a href="docs/objects_overview/eurocode/ec3_1993_1_1_2016/tables.md">20</a></td>
172+
<td><a href="docs/objects_overview/eurocode/ec3_1993_1_1_2016/figures.md">28</a></td>
153173
</tr>
154174
<tr>
155175
<td>NEN-EN 1993-5:2008</td>
156176
<td>
157177
Eurocode 3: Design of steel structures – Part 5: Piling
158178
(<a href="blueprints/codes/eurocode/nen_en_1993_5_2008">code</a>)
159179
</td>
160-
<td><a href="docs/source/codes/eurocode/nen_en_1993_5_2008/formulas.md">63</a></td>
161-
<td><a href="docs/source/codes/eurocode/nen_en_1993_5_2008/tables.md">0</a></td>
162-
<td><a href="docs/source/codes/eurocode/nen_en_1993_5_2008/figures.md">0</a></td>
180+
<td><a href="docs/objects_overview/eurocode/nen_en_1993_5_2008/formulas.md">63</a></td>
181+
<td><a href="docs/objects_overview/eurocode/nen_en_1993_5_2008/tables.md">0</a></td>
182+
<td><a href="docs/objects_overview/eurocode/nen_en_1993_5_2008/figures.md">0</a></td>
163183
</tr>
164184
<tr>
165185
<td>NEN 9997-1+C2:2017</td>
166186
<td>
167187
Eurocode 7: Geotechnical design of structures - Part 1: General rules
168188
(<a href="blueprints/codes/eurocode/nen_9997_1_c2_2017">code</a>)
169189
</td>
170-
<td><a href="docs/source/codes/eurocode/nen_9997_1_c2_2017/formulas.md">88</a></td>
171-
<td><a href="docs/source/codes/eurocode/nen_9997_1_c2_2017/tables.md">11</a></td>
172-
<td><a href="docs/source/codes/eurocode/nen_9997_1_c2_2017/figures.md">25</a></td>
190+
<td><a href="docs/objects_overview/eurocode/nen_9997_1_c2_2017/formulas.md">88</a></td>
191+
<td><a href="docs/objects_overview/eurocode/nen_9997_1_c2_2017/tables.md">11</a></td>
192+
<td><a href="docs/objects_overview/eurocode/nen_9997_1_c2_2017/figures.md">25</a></td>
173193
</tr>
174194
</tbody>
175195
</table>

docs/DOCS_README.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

docs/Makefile

Lines changed: 0 additions & 20 deletions
This file was deleted.

docs/__init__.py

Lines changed: 0 additions & 1 deletion
This file was deleted.
23.2 KB
Binary file not shown.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// this javascript file has to be added according to the mkdocs materials documentation: https://squidfunk.github.io/mkdocs-material/reference/math/#katex
2+
document$.subscribe(({ body }) => {
3+
renderMathInElement(body, {
4+
delimiters: [
5+
{ left: "$$", right: "$$", display: false },
6+
{ left: "$", right: "$", display: false },
7+
{ left: "\\(", right: "\\)", display: false },
8+
{ left: "\\[", right: "\\]", display: false}
9+
],
10+
})
11+
})
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Use CustomEvent to generate the version selector
2+
document.addEventListener(
3+
"readthedocs-addons-data-ready",
4+
function (event) {
5+
const config = event.detail.data();
6+
const versioning = `
7+
<div class="md-version">
8+
<button class="md-version__current" aria-label="Select version">
9+
${config.versions.current.slug}
10+
</button>
11+
12+
<ul class="md-version__list">
13+
${ config.versions.active.map(
14+
(version) => `
15+
<li class="md-version__item">
16+
<a href="${ version.urls.documentation }" class="md-version__link">
17+
${ version.slug }
18+
</a>
19+
</li>`).join("\n")}
20+
</ul>
21+
</div>`;
22+
23+
document.querySelector(".md-header__topic").insertAdjacentHTML("beforeend", versioning);
24+
});
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/* settings for logo in dark and light mode */
2+
#logo_light_mode {
3+
display: var(--md-footer-logo-light-mode);
4+
}
5+
6+
#logo_dark_mode {
7+
display: var(--md-footer-logo-dark-mode);
8+
}
9+
10+
[data-md-color-scheme="default"] {
11+
--md-footer-logo-dark-mode: none;
12+
--md-footer-logo-light-mode: block;
13+
}
14+
15+
[data-md-color-scheme="slate"] {
16+
--md-footer-logo-dark-mode: block;
17+
--md-footer-logo-light-mode: none;
18+
}
19+
20+
/* hide site_name in header */
21+
.md-header__topic {
22+
display: none;
23+
}
24+
25+
/* make logo slightly bigger */
26+
.md-header__button.md-logo {
27+
margin-top: 0;
28+
margin-bottom: 0;
29+
padding-top: 5;
30+
padding-bottom: 0;
31+
}
32+
33+
.md-header__button.md-logo img,
34+
.md-header__button.md-logo svg {
35+
height: 50%;
36+
width: 50%;
37+
}
38+
39+
/* the module name can be too long, set break settings to prevent overlapping the TOC */
40+
.doc.doc-heading {
41+
width: 100%;
42+
white-space: nowrap;
43+
overflow: hidden;
44+
text-overflow: ellipsis;
45+
}
46+
47+
.doc.doc-heading:hover {
48+
overflow: visible; /* Reveal the full content */
49+
width: 80%;
50+
white-space: normal; /* Allow text to wrap */
51+
z-index: 10; /* Ensure it overlays nearby elements */
52+
max-width: fit-content; /* Expand to content width */
53+
word-break: break-word; /* Enable word breaks */
54+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
:root {
2+
/* Reduce Read the Docs' flyout font a little bit */
3+
--readthedocs-flyout-font-size: 0.7rem;
4+
5+
/* Reduce Read the Docs' notification font a little bit */
6+
--readthedocs-notification-font-size: 0.8rem;
7+
8+
/* This customization is not yet perfect because we can't change the `line-height` yet. */
9+
/* See https://github.com/readthedocs/addons/issues/197 */
10+
--readthedocs-search-font-size: 0.7rem;
11+
}

docs/_overrides/partials/logo.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<img id="logo_light_mode" src="{{ config.theme.logo_light_mode | url }}" alt="logo">
2+
<img id="logo_dark_mode" src="{{ config.theme.logo_dark_mode | url }}" alt="logo">

docs/_overrides/partials/main.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{% extends "base.html" %}
2+
3+
{% block site_meta %}
4+
{{ super() }}
5+
<meta name="readthedocs-addons-api-version" content="1" />
6+
{% endblock %}

docs/_scripts/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Module with scripts for generating documentation."""
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
"""Generate the code reference pages."""
2+
3+
from pathlib import Path
4+
5+
import mkdocs_gen_files
6+
7+
nav = mkdocs_gen_files.Nav()
8+
mod_symbol = '<code class="doc-symbol doc-symbol-nav doc-symbol-module"></code>'
9+
10+
root = Path(__file__).parents[2]
11+
src = root / "blueprints"
12+
13+
for path in sorted(src.rglob("*.py")):
14+
module_path = path.relative_to(src).with_suffix("")
15+
doc_path = path.relative_to(src).with_suffix(".md")
16+
full_doc_path = Path("API reference", doc_path)
17+
18+
parts = tuple(module_path.parts)
19+
20+
if parts[-1] == "__init__" and len(parts) > 1:
21+
parts = parts[:-1]
22+
doc_path = doc_path.with_name("index.md")
23+
full_doc_path = full_doc_path.with_name("index.md")
24+
elif parts[-1].startswith("_"):
25+
continue
26+
27+
nav_parts = [f"{mod_symbol} {part}" for part in parts]
28+
nav[tuple(nav_parts)] = doc_path.as_posix()
29+
30+
with mkdocs_gen_files.open(full_doc_path, "w") as fd:
31+
ident = ".".join(parts)
32+
title = parts[-1]
33+
34+
fd.write(f"#{title}\n\n::: {ident}")
35+
36+
mkdocs_gen_files.set_edit_path(full_doc_path, ".." / path.relative_to(root))
37+
38+
with mkdocs_gen_files.open("API reference/Overview.md", "w") as nav_file:
39+
nav_file.writelines(nav.build_literate_nav())
File renamed without changes.

docs/examples/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Examples
2+
3+
Here are some examples of how to use the 'Blueprints'.
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Nominal Concrete Cover
2+
3+
Calculating the nominal concrete cover is an important step in the design of reinforced concrete structures.
4+
The nominal concrete cover is the minimum thickness of concrete that separates the reinforcing steel from the environment.
5+
This thickness is necessary to protect the steel from corrosion and to ensure the durability of the structure.
6+
7+
`Blueprints` provides a simple way to calculate the nominal concrete cover using NEN-EN 1992-1-1:2011.
8+
This example can be followed step by step by first importing the necessary classes and functions, (or [go to the full code example](#full-code-example)):
9+
10+
```python
11+
--8<-- "examples/_code/nominal_concrete_cover.py:4:8"
12+
```
13+
14+
Define the concrete material properties to be used in the calculation:
15+
16+
```python
17+
--8<-- "examples/_code/nominal_concrete_cover.py:11"
18+
```
19+
20+
Calculate the structural class by its exposure classes, design working life and other parameters:
21+
22+
```python
23+
--8<-- "examples/_code/nominal_concrete_cover.py:14:20"
24+
```
25+
26+
Start the nominal concrete cover calculation:
27+
28+
```python
29+
--8<-- "examples/_code/nominal_concrete_cover.py:23:34"
30+
```
31+
32+
Then just print the results:
33+
34+
```python
35+
--8<-- "examples/_code/nominal_concrete_cover.py:37:47"
36+
```
37+
38+
The output will be:
39+
40+
```python
41+
Structural class: S5
42+
43+
C,min,dur: 20.0 mm
44+
C,min,b: 32.0 mm
45+
C,min,total: 32.0 mm
46+
Cover increase due to uneven surface: 0 mm
47+
Cover increase due to abrasion: 0 mm
48+
49+
Nominal concrete cover: 60.0 mm
50+
C,nom: 42.0 mm
51+
Minimum cover with regard to casting surface: 60.0 mm
52+
```
53+
54+
You could also use the `NominalConcreteCover` to get a latex representation of the calculation by using:
55+
56+
```python
57+
--8<-- "examples/_code/nominal_concrete_cover.py:51"
58+
```
59+
60+
The output will be:
61+
62+
```latex
63+
Nominal~concrete~cover~according~to~art.~4.4.1~from~NEN-EN~1992-1-1+C2:2011:\newline~\max~\left\{Nominal~concrete~cover~according~to~art.~4.4.1~(c_{nom});~Minimum~cover~with~regard~to~casting~surface~according~to~art.~4.4.1.3~(4)\right\}\newline~=~\max~\left\{42.0;~60.0\right\}~=~60.0~mm\newline~\newline~Where:\newline~\hspace{4ex}c_{nom}~=~c_{min,total}+\Delta~c_{dev}~=~32.0+10~=~42.0~mm\newline~\hspace{4ex}\Delta~c_{dev}~is~determined~according~to~art.~4.4.1.3~(1)\newline~\hspace{4ex}c_{min,total}~=~c_{min}~+~\Delta~c_{uneven~surface}~~+~\Delta~c_{abrasion~class}~=~32.0~+~0~+~0~=~32.0~mm\newline~\hspace{4ex}\Delta~c_{uneven~surface}~and~\Delta~c_{abrasion~class}~are~determined~according~to~art.~4.4.1.2~(11)~and~(13)\newline~\hspace{4ex}c_{min}~=~\max~\left\{c_{min,b};~c_{min,dur}+\Delta~c_{dur,\gamma}-\Delta~c_{dur,st}-\Delta~c_{dur,add};~10~\text{mm}\right\}~=~\max~\left\{32.0;~20.0+10-0-0;~10\right\}~=~32.0~mm\newline~\hspace{4ex}\Delta~c_{dur,\gamma}~,~\Delta~c_{dur,st}~and~\Delta~c_{dur,add}~are~determined~according~to~art.~4.4.1.2~(6),~(7)~and~(8)\newline~\hspace{4ex}c_{min,b}~is~determined~according~to~table~4.2~based~on~(equivalent)~rebar~diameter~=~32~=~32~mm\newline~\hspace{4ex}c_{min,dur}~is~determined~according~to~table~4.4~based~on~structural~class~S5~\&~exposure~classes~(XC1)~=~20~mm
64+
```
65+
66+
You could use an external service like [lagrida](https://latexeditor.lagrida.com/) to render the latex code or use this output inside a latex or word document of your choice.
67+
68+
<a name="full-code-example">
69+
The full code example:
70+
71+
```python
72+
--8<-- "examples/_code/nominal_concrete_cover.py"
73+
```
74+
</a>

0 commit comments

Comments
 (0)