From 37ac9e8f8dc4fe1da5f7bf9b1b242f410d0fc4d0 Mon Sep 17 00:00:00 2001 From: Kirigaya <1193466151@qq.com> Date: Thu, 16 May 2024 13:16:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A0=B7=E5=BC=8F=EF=BC=8C?= =?UTF-8?q?=E4=BD=BF=E5=BE=97=20diagram=20=E6=9B=B4=E5=8A=A0=E7=B4=A7?= =?UTF-8?q?=E5=87=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- css/documentation.css | 10 +++++----- src/function/hdlDoc/common.ts | 10 +++++----- src/function/hdlDoc/html.ts | 6 ++++-- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/css/documentation.css b/css/documentation.css index 193539f..eb1f52a 100644 --- a/css/documentation.css +++ b/css/documentation.css @@ -566,21 +566,21 @@ img { .diagram-container .digrame-port-item { display: flex; justify-content: space-between; - height: 60px; + height: 40px; } .diagram-container .i-port-name { - font-size: 20px; + font-size: 16px; padding: 3px 8px; } .diagram-container .o-port-name { - font-size: 20px; + font-size: 16px; padding: 3px 8px; } .diagram-container .io-port-name { - font-size: 20px; + font-size: 16px; padding: 3px 8px; } @@ -600,7 +600,7 @@ img { } .diagram-container .arrow-wrapper { - height: 60px; + height: 40px; } .diagram-container .port-width-left-caption { diff --git a/src/function/hdlDoc/common.ts b/src/function/hdlDoc/common.ts index ac499dd..5f26f0f 100644 --- a/src/function/hdlDoc/common.ts +++ b/src/function/hdlDoc/common.ts @@ -175,7 +175,7 @@ abstract class RenderString { this.type = type; } - abstract render(): string; + abstract render(userStyle?: ThemeType): string; } interface MarkdownStringValue { @@ -262,8 +262,8 @@ class WavedromString extends RenderString { add(text: string) { this.value += text; } - render(): string { - const style = getThemeColorKind(); + render(userStyle?: ThemeType): string { + const style = userStyle ? userStyle : getThemeColorKind(); return makeWaveDromSVG(this.value, style); } }; @@ -328,8 +328,8 @@ async function getWavedromsFromFile(path: string): Promise { +async function makeShowHTML(usage: 'webview' | 'pdf' | 'html' | 'markdown'): Promise { const renderList = await getCurrentRenderList(); if (!renderList || renderList.length === 0) { return ''; @@ -110,9 +111,10 @@ async function makeShowHTML(usage: string): Promise { // start to render the real html let body = ''; + const userStyle = (usage === 'webview' || usage === 'markdown') ? undefined : ThemeType.Light; for (const r of renderList) { - const renderResult = r.render(); + const renderResult = r.render(userStyle); if (renderResult) { if (r instanceof MarkdownString) { body += makeCommonElement(renderResult);