-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not fail if javascript lib is online and no Internet (#101)
- Fixed behavior of the `url_exists()` function - Added log levels (Warning) - Documented the change
- Loading branch information
Laurent Franceschetti
committed
Sep 5, 2024
1 parent
502a3e8
commit 2fb1038
Showing
7 changed files
with
1,784 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Mermaid test (simple) | ||
|
||
## Mermaid usual | ||
This is a test of Mermaid: | ||
|
||
```mermaid | ||
graph TD | ||
hello --> world | ||
world --> world2 | ||
``` | ||
|
||
> If you don't see a graph here, it's broken. | ||
## Git Graph | ||
This is a test of Git Graph: | ||
|
||
```mermaid | ||
gitGraph | ||
commit | ||
commit | ||
branch develop | ||
checkout develop | ||
commit | ||
commit | ||
checkout main | ||
merge develop | ||
commit | ||
commit | ||
``` | ||
|
||
|
||
## Normal fences | ||
This is usual fenced code (with no highlighting) | ||
|
||
```python | ||
for page in pages: | ||
page.read() | ||
``` | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Second page | ||
Testing special cases | ||
|
||
## Wrong diagram | ||
|
||
```mermaid | ||
graph FG | ||
A[Client] | ||
``` | ||
|
||
## Correct | ||
|
||
```mermaid | ||
graph TD | ||
A[Client] --> B[Load Balancer] | ||
``` | ||
|
||
## Other | ||
|
||
```mermaid | ||
graph TD | ||
A[Client] --> B[Load Balancer] | ||
B --> C[Server01] | ||
B --> D[Server02] | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
site_name: Mermaid test (simple, with local specified library) | ||
site_description: Test for mermaid | ||
docs_dir: docs # indispensable or readthedocs will fail | ||
theme: readthedocs # you may want to try windmill? | ||
|
||
|
||
nav: | ||
- Main: index.md | ||
- Second: second.md | ||
|
||
plugins: | ||
- search | ||
- mermaid2: | ||
javascript: https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,6 +66,7 @@ changing the version number to determine the version you want | |
https://cdn.jsdelivr.net/npm/[email protected]/dist/mermaid.min.js | ||
``` | ||
|
||
|
||
!!! Note | ||
No explicit call to `mermaid.initialize()` is required, since it is | ||
automatically inserted by the plugin. | ||
|
@@ -80,6 +81,14 @@ https://cdn.jsdelivr.net/npm/[email protected]/dist/mermaid.min.js | |
on its ownlwill definitely **not** work, since there will be broken | ||
links. | ||
|
||
!!! Warning "Behavior in case of incorrect URL/no Internet access" | ||
1. An incorrect URL will cause an error that aborts MkDocs. | ||
2. If the address starts with http(s) and no Internet access | ||
is available at time of compile, MkDocs-Mermaid will continue and issue | ||
a WARNING. That behavior is for containers that do not | ||
have necessarily have Internet access at compile time | ||
(however, if you want to abort | ||
in that case use the strict mode: `mkdocs build --strict`. | ||
|
||
## Using `extra_javascript` | ||
|
||
|