Skip to content

Commit 54c584f

Browse files
committed
Fix Mermaid SVG CSS
1 parent a722ab3 commit 54c584f

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

developers/transforms/dynamicppl/index.qmd

+7
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,8 @@ The following diagram shows how `assume` first checks whether the variable is tr
238238

239239
<!-- 'wrappingWidth' setting required because of https://github.com/mermaid-js/mermaid-cli/issues/112#issuecomment-2352670995 -->
240240
```{mermaid}
241+
%%| echo: false
242+
241243
%%{ init: { 'themeVariables': { 'lineColor': '#000000' } } }%%
242244
%%{ init: { 'flowchart': { 'curve': 'linear', 'wrappingWidth': -1 } } }%%
243245
graph TD
@@ -276,6 +278,9 @@ Could we not, for example, store the required transformation inside the `VarInfo
276278
That is, why can't we just do
277279

278280
```{mermaid}
281+
%%| echo: false
282+
%%| fig-width: 5
283+
279284
%%{ init: { 'flowchart': { 'curve': 'linear', 'wrappingWidth': -1 } } }%%
280285
%%{ init: { 'themeVariables': { 'lineColor': '#000000' } } }%%
281286
graph TD
@@ -397,3 +402,5 @@ and if we apply this to the internal representation of `x`:
397402
```{julia}
398403
new_f_inv(DynamicPPL.getindex_internal(vi_linked, vn_x))
399404
```
405+
406+
which is the same value as we got above in `retval`.

theming/styles.css

+10-17
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
1-
/* css styles */
2-
/* .cell-output {
3-
background-color: #f1f3f5;
4-
} */
5-
6-
/* .cell-output img {
7-
max-width: 100%;
8-
height: auto;
9-
} */
10-
11-
/* .cell-output-display pre {
12-
word-break: break-wor !important;
13-
white-space: pre-wrap !important;
14-
}
15-
*/
16-
171
.navbar a:hover {
182
text-decoration: none;
193
}
@@ -31,10 +15,19 @@
3115
white-space: pre-wrap !important;
3216
}
3317

18+
.cell-output-display svg {
19+
height: fit-content;
20+
width: fit-content;
21+
}
3422

3523
.cell-output-display svg {
3624
height: fit-content;
3725
width: fit-content;
26+
27+
&.mermaid-js {
28+
/* fit-content for mermaid diagrams makes them really small */
29+
width: 100%;
30+
}
3831
}
3932

4033
.cell-output-display img {
@@ -54,4 +47,4 @@
5447
border-radius: 5px;
5548
max-height: 250px;
5649
overflow: scroll;
57-
}
50+
}

0 commit comments

Comments
 (0)