You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+23Lines changed: 23 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -107,6 +107,29 @@ document$.subscribe(({ body }) => {
107
107
})
108
108
```
109
109
110
+
## Using Tabs (pymdownx.tabbed)
111
+
112
+
If you want to use drawio diagrams inside of tabs you need to make sure that the diagrams are processed after the tabs are rendered. You can achieve this by adding the following javascript to your `mkdocs.yml`:
113
+
114
+
```yaml
115
+
extra_javascript:
116
+
- javascripts/drawio-tabs.js
117
+
```
118
+
119
+
Add `docs/javascripts/drawio-tabs.js` to your project:
120
+
121
+
```js
122
+
document.addEventListener('change', (event) => {
123
+
// Check if the target is a pymdownx tab input
124
+
if (event.target.matches('.tabbed-set > input')) {
125
+
GraphViewer.processElements()
126
+
}
127
+
});
128
+
```
129
+
130
+
Its a bit of a workaround as it listens for all events on the page and retriggers the drawio processing if any tab is clicked.
0 commit comments