Skip to content

Commit cf08b5c

Browse files
Merge pull request #15 from PythonBiellaGroup/develop
add mdkocs tutorial content
2 parents b0d3c04 + f41f79b commit cf08b5c

File tree

16 files changed

+261
-7
lines changed

16 files changed

+261
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ In the PBG website you can find:
6868
- [x] Quick feedback
6969
- [x] Cookies request form
7070
- [x] Migrate contents from old site
71-
- [ ] Template folder for contents
71+
- [x] Template folder for contents
7272
- [ ] New home page
7373
- [ ] New 404 page
7474
- [ ] New CSS to improve design

docs/blog/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
---
22
exclude_from_blog: true
3+
hide:
4+
- toc
5+
- feedback
36
---
47

58
# Blog

docs/blog/posts/new_brand_identity.en.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ timetoread: true
66
tags:
77
- brand identity
88
- design
9+
hide:
10+
- toc
11+
- feedback
912
---
1013

1114
# Our new brand identity

docs/blog/posts/new_brand_identity.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ timetoread: true
66
tags:
77
- brand identity
88
- design
9+
hide:
10+
- toc
11+
- feedback
912
---
1013

1114
# La nostra nuova brand identity

docs/learning/mkdocs_tutorial/extra_functions.en.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,74 @@ extra_css:
138138

139139
## Writing scientific equations
140140

141+
With MkDocs Material, it's possible to include complex mathematical expressions using **MathJax** and **KaTeX**.
142+
143+
https://squidfunk.github.io/mkdocs-material/reference/math/
144+
145+
```markdown
146+
$\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}$
147+
148+
Inline Equation: \(E=mc^2\)
149+
150+
Exponents: \(x^2\)
151+
152+
Square Root: \(\sqrt{x}\)
153+
154+
Summation: \(\sum_{i=1}^{n} x_i\)
155+
156+
Integrals: \(\int_{a}^{b} f(x) dx\)
157+
158+
Greek Letters: \(\alpha, \beta, \gamma\)
159+
160+
Matrices:
161+
\[
162+
\begin{bmatrix}
163+
1 & 2 \\
164+
3 & 4
165+
\end{bmatrix}
166+
\]
167+
168+
Limits: \(\lim_{x \to \infty} f(x)\)
169+
170+
Vector: \(\vec{v} = \langle v_1, v_2, v_3 \rangle\)
171+
172+
Piecewise function:
173+
\[f(x) =
174+
\begin{cases}
175+
x, & \text{if } x \geq 0 \\
176+
-x, & \text{if } x < 0
177+
\end{cases}
178+
\]
179+
180+
Probability: \(P(A \cup B) = P(A) + P(B) - P(A \cap B)\)
181+
182+
Derivatives: \(\frac{d}{dx} (x^2 + 2x + 1)\)
183+
184+
Binomial Coefficients: \(\binom{n}{k}\)
185+
186+
Trigonometric Functions: \(\sin(\theta)\), \(\cos(\theta)\), \(\tan(\theta)\)
187+
```
188+
141189
## Using tags
142190

191+
To facilitate content search within your site, we recommend inserting a tag inside your Markdown files.
192+
With MkDocs Material, it's sufficient to add the following to your mkdocs.yml file:
193+
194+
```markdown
195+
plugins:
196+
- tags
197+
```
198+
199+
Within the Markdown file where you want to add a tag, simply include this element in the metadata:
200+
201+
```markdown
202+
---
203+
title: My title
204+
tags:
205+
- mkdocs
206+
---
207+
```
208+
143209
## Neuteroi components
144210

145211
**Neuteroi** is a library of add-ons for **mkdocs** that we loved and also used for our PythonBiellaGroup site.
@@ -181,6 +247,23 @@ Here is an example with the timeline:
181247
::/timeline::
182248
```
183249
250+
Here is an example with the cards:
251+
252+
```markdown
253+
254+
::cards::
255+
256+
- title: Bards
257+
content: Lorem ipsum dolor sit amet.
258+
image: https://upload.wikimedia.org/wikipedia/commons/f/f0/Google_Bard_logo.svg
259+
260+
- title: ChatGPT
261+
content: Lorem ipsum dolor sit amet.
262+
image: https://upload.wikimedia.org/wikipedia/commons/thumb/0/04/ChatGPT_logo.svg/1024px-ChatGPT_logo.svg.png
263+
264+
::/cards::
265+
```
266+
184267
Of course we refer to the [official site](https://www.neoteroi.dev/mkdocs-plugins/timeline/) to see examples and different configurations
185268
186269
## Problems encountered

docs/learning/mkdocs_tutorial/extra_functions.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,75 @@ extra_css:
139139

140140
## Scrivere equazioni scientifiche
141141

142+
Con mkdocs material é possibile includere espressioni matematiche complesse tramite **MathJax** e **KaTex**
143+
144+
https://squidfunk.github.io/mkdocs-material/reference/math/
145+
146+
```markdown
147+
$\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}$
148+
149+
Inline Equation: \(E=mc^2\)
150+
151+
Exponents: \(x^2\)
152+
153+
Square Root: \(\sqrt{x}\)
154+
155+
Summation: \(\sum_{i=1}^{n} x_i\)
156+
157+
Integrals: \(\int_{a}^{b} f(x) dx\)
158+
159+
Greek Letters: \(\alpha, \beta, \gamma\)
160+
161+
Matrices:
162+
\[
163+
\begin{bmatrix}
164+
1 & 2 \\
165+
3 & 4
166+
\end{bmatrix}
167+
\]
168+
169+
Limits: \(\lim_{x \to \infty} f(x)\)
170+
171+
Vector: \(\vec{v} = \langle v_1, v_2, v_3 \rangle\)
172+
173+
Piecewise function:
174+
\[f(x) =
175+
\begin{cases}
176+
x, & \text{if } x \geq 0 \\
177+
-x, & \text{if } x < 0
178+
\end{cases}
179+
\]
180+
181+
Probability: \(P(A \cup B) = P(A) + P(B) - P(A \cap B)\)
182+
183+
Derivatives: \(\frac{d}{dx} (x^2 + 2x + 1)\)
184+
185+
Binomial Coefficients: \(\binom{n}{k}\)
186+
187+
Trigonometric Functions: \(\sin(\theta)\), \(\cos(\theta)\), \(\tan(\theta)\)
188+
```
189+
142190
## Utilizzare i tags
143191

192+
Per favorire la ricerca di contenuti all'interno del vostro sito vi consigliamo di inserire un tag all'interno dei vostri file markdown.
193+
Con mkdocs material é sufficiente inserire nel file mkdocs.yml:
194+
195+
196+
```markdown
197+
plugins:
198+
- tags
199+
```
200+
201+
All'interno del markdown per cui volete aggiungere un tag basterà inserire questo elemento nei metadati:
202+
203+
```markdown
204+
---
205+
title: My title
206+
tags:
207+
- mdkocs
208+
---
209+
```
210+
144211
## Componenti neuteroi
145212

146213
**Neuteroi** è una libreria di componenti aggiuntivi per **mkdocs** che a noi ci è piaciuta tantissimo e che abbiamo utilizzato anche per il nostro sito di PythonBiellaGroup.
@@ -182,6 +249,22 @@ Qui un esempio con la timeline:
182249
::/timeline::
183250
```
184251
252+
Qui un esempio con le cards:
253+
254+
```markdown
255+
::cards::
256+
257+
- title: Bards
258+
content: Lorem ipsum dolor sit amet.
259+
image: https://upload.wikimedia.org/wikipedia/commons/f/f0/Google_Bard_logo.svg
260+
261+
- title: ChatGPT
262+
content: Lorem ipsum dolor sit amet.
263+
image: https://upload.wikimedia.org/wikipedia/commons/thumb/0/04/ChatGPT_logo.svg/1024px-ChatGPT_logo.svg.png
264+
265+
::/cards::
266+
```
267+
185268
Ovviamente rimandiamo al [sito ufficiale](https://www.neoteroi.dev/mkdocs-plugins/timeline/) per vedere esempi e differenti configurazioni
186269
187270
## Problemi riscontrati
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
title: MkDocs vs Sphinx
3+
disquis: PythonBiellaGroup
4+
timetoread: true
5+
tags:
6+
- mdkocs
7+
- sphinx
8+
---
9+
10+
In the landscape of libraries for generating automatic documentation and static sites, we cannot fail to mention [Sphinx](https://sphinx-rtd-theme.readthedocs.io/en/stable/), which perhaps represented the Python standard until a few years ago.
11+
12+
You can already find a reference to **Sphinx** and its features within this [article](../../learning/document_code/index.md).
13+
14+
In this section, instead, we will schematically compare the characteristics of Sphinx and MkDocs to highlight the strengths of both.
15+
16+
| | MkDocs | Sphinx |
17+
| --------------- | ------------------------------------------ | --------------------------------------------------------------------- |
18+
| `Supported Formats` | **Markdown** | **reStructuredText (rST)** but with the myst-parser extension supports Markdown |
19+
| `Startup` | Easy with the command `poetry run mkdocs .` | Simple with the command `sphinx-quickstart` |
20+
| `Configuration`| Utilizes a YAML file **mkdocs.yml** | Utilizes a Python file **conf.py** |
21+
| `Layout` | Elegant and appealing, also navigable | Somewhat dated. The Read the Docs theme is iconic |
22+
| `Build` | Provides a local server to fully test the site. Convenient command `poetry run mkdocs serve` | Generates the site build but the user must then test it in their browser. This is done with `make html` |
23+
| `Extensions` | There are many but not all are maintained | There are many extensions but the community is less active compared to MkDocs |
24+
| `Customization` | Infinite possibilities thanks to CSS integration and available themes | Decidedly less customizable |
25+
| `Third-party Integration` | Integration with Confluence with this [extension](https://github.com/pawelsikora/mkdocs-with-confluence) | Integration with Confluence with this [extension](https://sphinxcontrib-confluencebuilder.readthedocs.io/en/stable/) |

docs/meetup/archive/mkdocs/tutorial_1.en.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ In this first meeting, we will explore the fundamental aspects of MkDocs with pa
2121
| Wiki | [PBG Learning](https://pythonbiellagroup.it/learning/mkdocs_tutorial/)|
2222
| Mkdocs material | https://squidfunk.github.io/mkdocs-material/|
2323
| Github pages | https://pages.github.com/|
24-
| Github actions | https://docs.github.com/en/actions|
24+
| Github actions | https://docs.github.com/en/actions |
2525

2626
## Meetup video
2727

docs/meetup/archive/mkdocs/tutorial_1.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ In questo primo incontro vedremo gli aspetti fondamentali di mkdocs con particol
2121
| Wiki | [PBG Learning](https://pythonbiellagroup.it/learning/mkdocs_tutorial/)|
2222
| Mkdocs material | https://squidfunk.github.io/mkdocs-material/|
2323
| Github pages | https://pages.github.com/|
24-
| Github actions | https://docs.github.com/en/actions|
24+
| Github actions | https://docs.github.com/en/actions |
2525

2626
## Video del meetup
2727

docs/meetup/archive/mkdocs/tutorial_2.en.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Main topics:
2323
| Wiki | [PBG Learning](https://pythonbiellagroup.it/learning/mkdocs_tutorial/)|
2424
| Mkdocs material | https://squidfunk.github.io/mkdocs-material/|
2525
| Github pages | https://pages.github.com/|
26-
| Github actions | https://docs.github.com/en/actions|
26+
| Github actions | https://docs.github.com/en/actions |
2727

2828
## Meetup video
2929

0 commit comments

Comments
 (0)