Skip to content

Commit 844f317

Browse files
fix: update VSCode settings for color theme and enhance documentation with Mermaid.js support
1 parent 49732e8 commit 844f317

3 files changed

Lines changed: 20 additions & 3 deletions

File tree

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"/root/.vscode-remote/extensions/benpaddlejones.pico-bridge-2.0.2/emulator/mock/micropython"
2828
],
2929
"micropico.syncFolder": "project",
30-
"workbench.colorTheme": "Default Dark+",
30+
"workbench.colorTheme": "Dark+",
3131
"workbench.iconTheme": "icons",
3232
"github.copilot.enable": {
3333
"python": false,

app/docs.html

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,11 @@
378378
<script src="https://cdn.jsdelivr.net/npm/marked@11.1.1/marked.min.js"></script>
379379
<!-- DOMPurify for sanitization -->
380380
<script src="https://cdn.jsdelivr.net/npm/dompurify@3.0.8/dist/purify.min.js"></script>
381+
<!-- Mermaid.js for diagrams -->
382+
<script src="https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.min.js"></script>
383+
<script>
384+
mermaid.initialize({ startOnLoad: false, theme: "dark" });
385+
</script>
381386

382387
<script>
383388
// GitHub raw content base URL
@@ -487,14 +492,26 @@
487492
// Sanitize HTML
488493
html = DOMPurify.sanitize(html, {
489494
ADD_TAGS: ["img"],
490-
ADD_ATTR: ["src", "alt", "title"],
495+
ADD_ATTR: ["src", "alt", "title", "class"],
491496
});
492497

493498
// Display content
494499
content.innerHTML = html;
495500
content.style.display = "block";
496501
spinner.style.display = "none";
497502

503+
// Render Mermaid diagrams
504+
content
505+
.querySelectorAll("code.language-mermaid")
506+
.forEach((codeEl) => {
507+
const pre = codeEl.parentElement;
508+
const div = document.createElement("div");
509+
div.className = "mermaid";
510+
div.textContent = codeEl.textContent;
511+
pre.replaceWith(div);
512+
});
513+
await mermaid.run({ nodes: content.querySelectorAll(".mermaid") });
514+
498515
// Update page title
499516
const docTitle = docName.replace(/_/g, " ");
500517
document.title = `${docTitle} - AIDriver`;

micropython

Submodule micropython updated 455 files

0 commit comments

Comments
 (0)