Skip to content

Commit

Permalink
feat: new major version
Browse files Browse the repository at this point in the history
  • Loading branch information
adrienbrignon committed Dec 2, 2023
1 parent a5c5f50 commit 7f7b033
Show file tree
Hide file tree
Showing 24 changed files with 1,411 additions and 311 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ RUN apt-get update \

FROM base as builder

ENV POETRY_VERSION=1.5.0 \
ENV POETRY_VERSION=1.7.1 \
PIP_NO_CACHE_DIR=1 \
PIP_DEFAULT_TIMEOUT=100 \
PIP_DISABLE_PIP_VERSION_CHECK=1
Expand All @@ -42,6 +42,6 @@ RUN . .venv/bin/activate \
&& make build


FROM nginx:1.25.1
FROM nginx:1.25.3

COPY --from=builder /usr/src/app/dist /usr/share/nginx/html
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ A highly-configurable plugin for [*MkDocs*](https://github.com/mkdocs/mkdocs) th

## Prerequisites

- Python `>= 3.7`
- Python `>= 3.8`
- MkDocs `>= 1.4`

## Installation
Expand Down
1 change: 1 addition & 0 deletions docs/.pages
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
nav:
- getting-started.md
- setup
- samples
Binary file added docs/assets/images/samples/01.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/samples/02.webp
Binary file not shown.
10 changes: 10 additions & 0 deletions docs/assets/scripts/katex.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
document$.subscribe(({ body }) => {
renderMathInElement(body, {
delimiters: [
{ left: '$$', right: '$$', display: true },
{ left: '$', right: '$', display: false },
{ left: '\\(', right: '\\)', display: false },
{ left: '\\[', right: '\\]', display: true }
],
});
});
16 changes: 16 additions & 0 deletions docs/assets/scripts/mathjax.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
window.MathJax = {
tex: {
inlineMath: [['\\(', '\\)']],
displayMath: [['\\[', '\\]']],
processEscapes: true,
processEnvironments: true
},
options: {
ignoreHtmlClass: '.*|',
processHtmlClass: 'arithmatex'
}
};

document$.subscribe(() => {
MathJax.typesetPromise();
});
40 changes: 40 additions & 0 deletions docs/assets/scripts/mkdocs-exporter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/**
* An interface with the MkDocs Exporter plugin.
*/
window.MkDocsExporter = {

/**
* Render the page...
*/
render: async () => {
if (window.MathJax) {
if (typeof window.MathJax.typesetPromise === 'function') {
await window.MathJax.typesetPromise();
}
}

if (window.mermaid) {
if (typeof window.mermaid.run === 'function') {
for (const element of document.querySelectorAll('.mermaid > code')) {
const container = document.createElement('div');

container.className = 'mermaid';

await mermaid.run({ nodes: [element] });

element.parentElement.appendChild(container);
container.appendChild(element.children[0]);
element.remove();
}
}
}
}

};


window.PagedConfig = {
before: async () => {
//
}
}
5 changes: 5 additions & 0 deletions docs/assets/stylesheets/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,8 @@
display: none;
page-break-after: always;
}

.md-image {
border-radius: 0.50em;
border: 1px solid #ddd;
}
2 changes: 1 addition & 1 deletion docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ hide:

## Prerequisites

- Python `>= 3.7`
- Python `>= 3.8`
- MkDocs `>= 1.4`
- A compatible theme
- [`material`](https://github.com/squidfunk/mkdocs-material) (:material-star-shooting: *used by this documentation*)
Expand Down
116 changes: 116 additions & 0 deletions docs/samples/diagrams.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
---
buttons:
- title: Documentation
icon: material-book-outline
attributes:
class: md-content__button md-icon
href: https://squidfunk.github.io/mkdocs-material/reference/diagrams/
target: _blank
---

# Diagrams

## Mermaid

Check out [Mermaid's documentation](https://mermaid.js.org/intro/) for a reference of all supported diagrams.

### Flowchart

Pellentesque nec lacus est. Phasellus pulvinar volutpat nisl aliquet auctor.
Nunc tincidunt molestie mi, et porttitor lectus congue in. Aliquam eu tortor viverra libero imperdiet suscipit.

<center>
```mermaid
flowchart TD
A[Start] --> B{Is it?}
B -->|Yes| C[OK]
C --> D[Rethink]
D --> B
B ---->|No| E[End]
```
</center>

Phasellus auctor consectetur diam et ullamcorper. Ut vel lacus massa. Quisque magna magna, semper quis feugiat at, lobortis non leo. Quisque vitae sollicitudin ex. Nulla ut laoreet purus, ut porttitor dui. Suspendisse et ornare erat. Nam id ornare lorem.

Nam quam justo, commodo eu lobortis vestibulum, molestie sed dolor.

<div class="page-break"></div>

### Sequence diagram

Morbi justo enim, rhoncus nec dictum vitae, porttitor ac odio. Pellentesque ac malesuada neque, quis mollis purus.
Aliquam interdum, est a mattis vestibulum, nibh nisl pulvinar orci, a faucibus ante massa et diam.

Phasellus sed velit ex. Proin condimentum dolor ac felis pellentesque imperdiet. Nulla porta est lacus.
Cursus tincidunt cursus diam, sit amet condimentum risus convallis scelerisque.

<center>
```mermaid
sequenceDiagram
Alice->>John: Hello John, how are you?
John-->>Alice: Great!
Alice-)John: See you later!
```
</center>

<div class="page-break"></div>

### Class diagram

Integer iaculis in sem in porttitor. Duis tempus ullamcorper purus, ac efficitur massa aliquam sed. Nam et varius diam. Duis suscipit ultrices odio, non volutpat elit bibendum a. In sit amet ultrices metus. Pellentesque vitae malesuada libero. Phasellus tincidunt cursus diam, sit amet condimentum risus convallis scelerisque. Donec eu luctus tellus, ac porta ex. Nullam dictum eros a consectetur posuere. Donec sed ligula auctor diam faucibus pulvinar nec ut erat. Integer accumsan laoreet mollis. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aliquam pellentesque tempor pulvinar.

<center>
```mermaid
classDiagram
note "From Duck till Zebra"
Animal <|-- Duck
note for Duck "can fly\ncan swim\ncan dive\ncan help in debugging"
Animal <|-- Fish
Animal <|-- Zebra
Animal : +int age
Animal : +String gender
Animal: +isMammal()
Animal: +mate()
class Duck{
+String beakColor
+swim()
+quack()
}
class Fish{
-int sizeInFeet
-canEat()
}
class Zebra{
+bool is_wild
+run()
}
```
</center>

Nullam dictum eros a consectetur posuere. Donec sed ligula auctor diam faucibus pulvinar nec ut erat. Integer accumsan laoreet mollis.
Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aliquam pellentesque tempor pulvinar.

<div class="page-break"></div>

### Quadrant chart

Duis in consectetur metus, sed vestibulum orci. Quisque tincidunt, nunc eu tincidunt volutpat, risus mi ultricies elit, nec malesuada est ipsum eu lacus. Suspendisse vitae neque pulvinar, tristique lectus sit amet, aliquet arcu. Sed mollis tristique lacus non scelerisque. Suspendisse convallis consequat leo id placerat. Morbi sodales bibendum nibh, vitae interdum erat sagittis sed. Morbi consequat vulputate odio nec mollis. Fusce a neque lacus. Morbi lorem tortor, lobortis id magna imperdiet, malesuada euismod velit.

<center>
```mermaid
quadrantChart
title Reach and engagement of campaigns
x-axis Low Reach --> High Reach
y-axis Low Engagement --> High Engagement
quadrant-1 We should expand
quadrant-2 Need to promote
quadrant-3 Re-evaluate
quadrant-4 May be improved
Campaign A: [0.3, 0.6]
Campaign B: [0.45, 0.23]
Campaign C: [0.57, 0.69]
Campaign D: [0.78, 0.34]
Campaign E: [0.40, 0.34]
Campaign F: [0.35, 0.78]
```
</center>
66 changes: 66 additions & 0 deletions docs/samples/mathematics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
buttons:
- title: Documentation
icon: material-book-outline
attributes:
class: md-content__button md-icon
href: https://squidfunk.github.io/mkdocs-material/reference/math/
target: _blank
---

# Mathematics

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc quis augue massa. Vestibulum suscipit et nisi in imperdiet. Nunc et mattis arcu, feugiat venenatis elit. Praesent hendrerit lacus felis, vel volutpat massa tristique vitae.

Quisque quam urna, vulputate quis malesuada quis, iaculis sit amet lectus. Vivamus malesuada dignissim lectus in condimentum. Integer et efficitur sapien. Aenean aliquam pharetra porttitor. Morbi rutrum placerat lectus. Aenean imperdiet nisi lobortis sagittis ultricies.

---

The homomorphism $f$ is injective if and only if its kernel is only the
singleton set $e_G$, because otherwise $\exists a,b\in G$ with $a\neq b$ such
that $f(a)=f(b)$.

$$
\operatorname{ker} f=\{g\in G:f(g)=e_{H}\}{\mbox{.}}
$$

Mauris tincidunt, tortor eu convallis sollicitudin, ex risus blandit ligula, vel pulvinar lorem ante eget orci. Fusce pellentesque pulvinar velit, non molestie mi pellentesque sit amet. Sed convallis dolor vel sagittis rhoncus. Pellentesque at ullamcorper ex. Curabitur ut nisl quam. Vestibulum aliquet massa in odio tempor, quis maximus erat semper. Donec iaculis condimentum lacus, a tincidunt metus congue ut. Donec congue odio sit amet lacus semper, nec bibendum sapien accumsan.

> $$
> E(\mathbf{v}, \mathbf{h}) = -\sum_{i,j}w_{ij}v_i h_j - \sum_i b_i v_i - \sum_j c_j h_j
> $$
>
> Nullam ante felis, luctus et leo eget, rhoncus lacinia libero.
Curabitur in hendrerit metus, in ornare mauris. Fusce sodales odio at erat finibus, id congue nibh feugiat. Vestibulum lacinia, nulla et vestibulum ultricies, massa ex imperdiet tortor, eget mattis arcu dolor non risus. Curabitur vulputate diam vel nulla fermentum, non suscipit libero sodales. Praesent aliquet aliquam leo, at facilisis ante imperdiet ac. Nunc eleifend ligula nisi, vel aliquam sapien vehicula non. Mauris consectetur erat vel augue varius tempor.

Vivamus nec imperdiet sapien, at euismod urna. Proin tempor placerat mauris id aliquet. Phasellus lorem nunc, porta sed odio nec, aliquet aliquet velit. Nullam blandit tincidunt sollicitudin. Fusce non tincidunt felis. Integer laoreet dolor eget sodales tempor. Sed aliquet faucibus nulla et molestie. Nunc sit amet suscipit purus. Nunc turpis purus, pretium eleifend lobortis vel, vulputate ut sem. Vivamus consectetur ante id velit aliquet, ut vulputate augue feugiat. Maecenas consequat mi eget pretium maximus. Nam sed porta mi. Aliquam viverra sed libero sit amet eleifend.

$$
\begin{bmatrix}
& x & 0 \\
& 1 & -1
\end{bmatrix}\begin{bmatrix}
1  \\
y  \\
1
\end{bmatrix}
=\begin{bmatrix}
1+xy  \\
y-1
\end{bmatrix}.
$$

In tortor velit, tincidunt at massa vitae, consequat euismod leo.

In sit amet nunc consectetur, commodo lectus vitae, consequat lacus. Duis eu odio mattis, porttitor nunc in, placerat massa. Vestibulum rhoncus libero libero, laoreet aliquam diam facilisis convallis. Etiam quis vestibulum est, id interdum odio. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse posuere non leo ac varius. Integer hendrerit sed lacus nec hendrerit. Nunc porttitor porttitor aliquam.

$$
\begin{aligned}
F ={} & \{F_{x} \in  F_{c} : (|S| > |C|) \\
& \cap (\mathrm{minPixels}  < |S| < \mathrm{maxPixels}) \\
& \cap (|S_{\mathrm{conected}}| > |S| - \epsilon) \}
\end{aligned}
$$

In sit amet nunc consectetur, commodo lectus vitae, consequat lacus. Duis eu odio mattis, porttitor nunc in, placerat massa. Vestibulum rhoncus libero libero, laoreet aliquam diam facilisis convallis. Etiam quis vestibulum est, id interdum odio. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse posuere non leo ac varius. Integer hendrerit sed lacus nec hendrerit. Nunc porttitor porttitor aliquam.
31 changes: 31 additions & 0 deletions docs/samples/multimedia.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Multimedia

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

## Images

Duis faucibus ante non lorem sollicitudin, vel dictum neque interdum. Nunc vel urna ipsum. Nullam urna massa, finibus sed porttitor nec, vehicula nec nibh. Proin mattis porttitor lectus ac elementum. Suspendisse faucibus aliquam sapien quis euismod. Vivamus justo elit, placerat at arcu vel, pulvinar finibus lectus. Nunc rhoncus fringilla enim, non molestie metus consequat nec. Curabitur volutpat sollicitudin purus eget fringilla. Sed congue mauris id mi semper, sit amet consectetur erat fringilla.

### JPEG

<img class="md-image" src="../../assets/images/samples/01.jpg" width="410" align="left">
<div>Photo by <a href="https://unsplash.com/@henry_be">Henry Be</a> on <a href="https://unsplash.com/photos/library-shelf-near-black-wooden-ladder-lc7xcWebECc">Unsplash</a>.</div>

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa.

Vivamus ut convallis diam. Morbi laoreet fermentum auctor. Nulla nec iaculis nisi. Ut ultrices dolor id lacus vulputate, ac ultrices libero eleifend. Praesent nisi urna, lacinia non lectus et, egestas euismod sapien. Morbi eu nibh ut libero feugiat dignissim. Quisque bibendum, est vel iaculis interdum, lorem sem efficitur justo, vitae facilisis leo est in turpis. Etiam justo libero, commodo quis dolor in, feugiat pharetra sem. Nunc mauris magna, fermentum eu tristique ut, porttitor sit amet diam. Vivamus in hendrerit mauris. Sed facilisis semper enim, et consectetur justo ultricies ac. Aliquam ut felis nec eros blandit condimentum nec in mauris. Duis a viverra enim. Aliquam erat volutpat. Nam vitae diam egestas, hendrerit nulla et, viverra augue.

Aliquam vitae velit sit amet felis dapibus interdum vitae ac purus. Morbi vitae orci risus.
Donec condimentum nibh id ex consectetur veleris.

Mauris vulputate lorem vitae mauris cursus porta.
Curabitur efficitur interdum massa id porttitor. Nunc tincidunt sem metus, at vulputate nunc facilisis eu. Nulla nec massa eu nulla ornare cursus sed a est. Duis sit amet leo felis.

### WebP

<img class="md-image" src="../../assets/images/samples/02.webp" width="300" align="right">
<div>Photo by <a href="https://developers.google.com/speed/webp/gallery1#credits1">Kjetil Birkeland Moe</a>.</div>

In hac habitasse platea dictumst. Nullam porttitor a leo sit amet dictum. Ut a diam a turpis cursus iaculis. Sed tempus nisl quis hendrerit finibus. Duis vel mattis turpis. Suspendisse commodo, ante id luctus vestibulum, sem nunc mattis neque, at rutrum justo metus nec risus. Phasellus tincidunt tempor lacus vel dictum. Vivamus ac rutrum magna. Sed sit amet fermentum turpis. Donec molestie augue felis, sed blandit nisl vehicula at.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut a gravida turpis, at mattis nisi.
5 changes: 3 additions & 2 deletions docs/setup/setting-up-documents.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ Under-the-hood, this library depends on a web browser controlled by *Playwright*

At the time of writing, *Playwright* supports the following operating systems:

- Python 3.8 or higher
- Windows 10+, Windows Server 2016+ or Windows Subsystem for Linux (WSL)
- macOS 12 Monterey or MacOS 13 Ventura
- Debian 11, Ubuntu 20.04 or Ubuntu 22.04
- Debian 11, Debian 12, Ubuntu 20.04 or Ubuntu 22.04

???+ tip "If your operating system is not supported"
???+ tip "Your operating system is not supported?"

You can still use *Docker* to build your documentation from any operating system.
Feel free to check out the [Dockerfile](https://github.com/adrienbrignon/mkdocs-exporter/blob/master/Dockerfile) used by this documentation.
Expand Down
25 changes: 22 additions & 3 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ plugins:
covers:
front: resources/templates/covers/front.html.j2
back: resources/templates/covers/back.html.j2
browser:
debug: false
headless: true
- mkdocs/exporter/extras:
buttons:
- title: Download as PDF
Expand All @@ -72,15 +75,31 @@ markdown_extensions:
- admonition
- attr_list
- pymdownx.details
- pymdownx.superfences
- pymdownx.superfences:
custom_fences:
- name: mermaid
class: mermaid
format: !!python/name:pymdownx.superfences.fence_code_format
- pymdownx.tabbed:
alternate_style: true
- mdx_truly_sane_lists:
truly_sane: true
nested_indent: 2
- pymdownx.emoji:
emoji_index: !!python/name:materialx.emoji.twemoji
emoji_generator: !!python/name:materialx.emoji.to_svg
emoji_index: !!python/name:material.extensions.emoji.twemoji
emoji_generator: !!python/name:material.extensions.emoji.to_svg
- pymdownx.arithmatex:
generic: true

extra_css:
- assets/stylesheets/custom.css
- https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.7/katex.min.css

extra_javascript:
- assets/scripts/katex.js
- assets/scripts/mathjax.js
- assets/scripts/mkdocs-exporter.js
- https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.7/katex.min.js
- https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.7/contrib/auto-render.min.js
- https://cdnjs.cloudflare.com/ajax/libs/mathjax/3.2.2/es5/tex-mml-chtml.min.js
- https://cdnjs.cloudflare.com/ajax/libs/mermaid/10.6.1/mermaid.min.js
Loading

0 comments on commit 7f7b033

Please sign in to comment.