Skip to content

Commit

Permalink
1.9 docs: Remove Mermaid and Playwright build dependency (#7066)
Browse files Browse the repository at this point in the history
  • Loading branch information
NigelBreslaw authored Dec 11, 2024
1 parent 626bc98 commit c794f87
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 1,056 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build_docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ jobs:
working-directory: docs/astro
run: pnpm spellcheck
# Test docs
- name: Install Playwright
working-directory: docs/astro
run: pnpm exec playwright install --with-deps
- name: Run Playwright tests
working-directory: docs/astro
run: pnpm exec playwright test
Expand Down
4 changes: 0 additions & 4 deletions docs/astro/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import { defineConfig } from "astro/config";
import starlight from "@astrojs/starlight";
import starlightLinksValidator from "starlight-links-validator";
import rehypeMermaid from "rehype-mermaid";
import addMermaidClass from "./src/utils/add-mermaid-classnames";
import rehypeExternalLinks from "rehype-external-links";
import starlightSidebarTopics from "starlight-sidebar-topics";

Expand All @@ -28,8 +26,6 @@ export default defineConfig({
rel: ["noopener"],
},
],
addMermaidClass,
rehypeMermaid,
],
},
integrations: [
Expand Down
2 changes: 0 additions & 2 deletions docs/astro/ec.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ function sideBorder() {
) {
return;
}
const content = context.codeBlock.code;

const side = h("div.sideBar");

const ast = context.renderData.blockAst;
Expand Down
1 change: 0 additions & 1 deletion docs/astro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"playwright": "1.49.0",
"playwright-ctrf-json-reporter": "0.0.18",
"rehype-external-links": "3.0.0",
"rehype-mermaid": "3.0.0",
"sharp": "0.33.5",
"starlight-links-validator": "0.13.4",
"starlight-sidebar-topics": "0.2.1",
Expand Down
2 changes: 1 addition & 1 deletion docs/astro/src/components/ThemeSelect.astro
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { Icon } from "@astrojs/starlight/components";
disconnectedCallback() {
this.removeEventListener('click', this.handleMouseDown);
}
private handleMouseDown(e: MouseEvent) {
private handleMouseDown() {
const theme = document.documentElement.dataset.theme === 'light' ? 'dark' : 'light';
document.documentElement.dataset.theme = theme;
localStorage.setItem('starlight-theme', theme);
Expand Down
2 changes: 1 addition & 1 deletion docs/astro/src/components/VersionSelector.astro
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const versions = await getVersions();
const currentUrl = Astro.url.href;
const processedVersions = versions.map((version) => ({
const processedVersions = versions.map((version: Version) => ({
...version,
selected:
currentUrl.includes(version.version) ||
Expand Down
11 changes: 5 additions & 6 deletions docs/astro/src/components/editor/codemirror.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import {
highlightActiveLineGutter,
highlightSpecialChars,
drawSelection,
dropCursor,
rectangularSelection,
crosshairCursor,
highlightActiveLine,
Expand Down Expand Up @@ -118,7 +117,7 @@ function statusPanel(view) {

return {
dom,
update(update) {
update(_update) {
// You can update the panel content based on editor state changes if needed
},
};
Expand Down Expand Up @@ -159,8 +158,8 @@ async function updateWasmPreview(previewContainer, content) {
// Wrap updateWasmPreview in a debounce function (500ms delay)
const debouncedUpdateWasmPreview = debounce(updateWasmPreview, 500);

async function initializePreviewContainers(previewContainer, content) {
const canvas_id = "canvas_" + Math.random().toString(36).substr(2, 9);
async function initializePreviewContainers(previewContainer, _content) {
const canvas_id = "canvas_" + Math.random().toString(36).substring(2, 9);
const canvas = document.createElement("canvas");
canvas.id = canvas_id;
previewContainer.appendChild(canvas);
Expand All @@ -170,7 +169,7 @@ async function initializePreviewContainers(previewContainer, content) {
previewContainer.parentNode.appendChild(error_div);
}

async function loadSlintWasmInterpreter(editor) {
async function loadSlintWasmInterpreter(_editor) {
try {
if (slint_wasm_module) {
return;
Expand Down Expand Up @@ -198,7 +197,7 @@ async function loadSlintWasmInterpreter(editor) {

// Initialize CodeMirror based on the language passed as a data attribute
window.initCodeMirror = function (editorDiv, language, content) {
const editorDiv_id = editorDiv.getAttribute("id");
// const editorDiv_id = editorDiv.getAttribute("id");

const extensions = [
lineNumbers(),
Expand Down
36 changes: 0 additions & 36 deletions docs/astro/src/utils/add-mermaid-classnames.ts

This file was deleted.

2 changes: 1 addition & 1 deletion docs/astro/tests/link-test.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { linkMap } from "../src/utils/utils";
test("Test all links", async ({ page }) => {
const baseUrl = "http://localhost:4321/master/docs/slint";

for (const [key, value] of Object.entries(linkMap)) {
for (const [_key, value] of Object.entries(linkMap)) {
const fullUrl = `${baseUrl}${value.href}`;

try {
Expand Down
Loading

0 comments on commit c794f87

Please sign in to comment.