修改样式,使得 diagram 更加紧凑
This commit is contained in:
parent
bdede235e7
commit
37ac9e8f8d
@ -566,21 +566,21 @@ img {
|
|||||||
.diagram-container .digrame-port-item {
|
.diagram-container .digrame-port-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
height: 60px;
|
height: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.diagram-container .i-port-name {
|
.diagram-container .i-port-name {
|
||||||
font-size: 20px;
|
font-size: 16px;
|
||||||
padding: 3px 8px;
|
padding: 3px 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.diagram-container .o-port-name {
|
.diagram-container .o-port-name {
|
||||||
font-size: 20px;
|
font-size: 16px;
|
||||||
padding: 3px 8px;
|
padding: 3px 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.diagram-container .io-port-name {
|
.diagram-container .io-port-name {
|
||||||
font-size: 20px;
|
font-size: 16px;
|
||||||
padding: 3px 8px;
|
padding: 3px 8px;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -600,7 +600,7 @@ img {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.diagram-container .arrow-wrapper {
|
.diagram-container .arrow-wrapper {
|
||||||
height: 60px;
|
height: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.diagram-container .port-width-left-caption {
|
.diagram-container .port-width-left-caption {
|
||||||
|
@ -175,7 +175,7 @@ abstract class RenderString {
|
|||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract render(): string;
|
abstract render(userStyle?: ThemeType): string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface MarkdownStringValue {
|
interface MarkdownStringValue {
|
||||||
@ -262,8 +262,8 @@ class WavedromString extends RenderString {
|
|||||||
add(text: string) {
|
add(text: string) {
|
||||||
this.value += text;
|
this.value += text;
|
||||||
}
|
}
|
||||||
render(): string {
|
render(userStyle?: ThemeType): string {
|
||||||
const style = getThemeColorKind();
|
const style = userStyle ? userStyle : getThemeColorKind();
|
||||||
return makeWaveDromSVG(this.value, style);
|
return makeWaveDromSVG(this.value, style);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -328,8 +328,8 @@ async function getWavedromsFromFile(path: string): Promise<WavedromString[] | un
|
|||||||
|
|
||||||
const fileStream = fs.createReadStream(path, 'utf-8');
|
const fileStream = fs.createReadStream(path, 'utf-8');
|
||||||
const rl = readline.createInterface({
|
const rl = readline.createInterface({
|
||||||
input: fileStream,
|
input: fileStream,
|
||||||
crlfDelay: Infinity
|
crlfDelay: Infinity
|
||||||
});
|
});
|
||||||
|
|
||||||
for await (const line of rl) {
|
for await (const line of rl) {
|
||||||
|
@ -7,6 +7,7 @@ import { opeParam, MainOutput, AbsPath } from '../../global';
|
|||||||
import { Count, MarkdownString, WavedromString } from './common';
|
import { Count, MarkdownString, WavedromString } from './common';
|
||||||
import { getRenderList, getCurrentRenderList } from './markdown';
|
import { getRenderList, getCurrentRenderList } from './markdown';
|
||||||
import { hdlPath, hdlIcon, hdlFile } from '../../hdlFs';
|
import { hdlPath, hdlIcon, hdlFile } from '../../hdlFs';
|
||||||
|
import { ThemeType } from '../../global/enum';
|
||||||
|
|
||||||
const _cache = {
|
const _cache = {
|
||||||
css : ''
|
css : ''
|
||||||
@ -102,7 +103,7 @@ function makeWavedromRenderErrorHTML() {
|
|||||||
* @description make the html string of a finial display style
|
* @description make the html string of a finial display style
|
||||||
* @param usage in whick module is used
|
* @param usage in whick module is used
|
||||||
*/
|
*/
|
||||||
async function makeShowHTML(usage: string): Promise<string> {
|
async function makeShowHTML(usage: 'webview' | 'pdf' | 'html' | 'markdown'): Promise<string> {
|
||||||
const renderList = await getCurrentRenderList();
|
const renderList = await getCurrentRenderList();
|
||||||
if (!renderList || renderList.length === 0) {
|
if (!renderList || renderList.length === 0) {
|
||||||
return '';
|
return '';
|
||||||
@ -110,9 +111,10 @@ async function makeShowHTML(usage: string): Promise<string> {
|
|||||||
|
|
||||||
// start to render the real html
|
// start to render the real html
|
||||||
let body = '';
|
let body = '';
|
||||||
|
const userStyle = (usage === 'webview' || usage === 'markdown') ? undefined : ThemeType.Light;
|
||||||
|
|
||||||
for (const r of renderList) {
|
for (const r of renderList) {
|
||||||
const renderResult = r.render();
|
const renderResult = r.render(userStyle);
|
||||||
if (renderResult) {
|
if (renderResult) {
|
||||||
if (r instanceof MarkdownString) {
|
if (r instanceof MarkdownString) {
|
||||||
body += makeCommonElement(renderResult);
|
body += makeCommonElement(renderResult);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user