完成 codedoc 中端重构
This commit is contained in:
parent
2f90a87a1c
commit
bae22883de
6
.vscode/settings.json
vendored
6
.vscode/settings.json
vendored
@ -1,12 +1,10 @@
|
|||||||
// Place your settings in this file to overwrite default and user settings.
|
|
||||||
{
|
{
|
||||||
"files.exclude": {
|
"files.exclude": {
|
||||||
"out": false // set this to true to hide the "out" folder with the compiled JS files
|
"out": false
|
||||||
},
|
},
|
||||||
"search.exclude": {
|
"search.exclude": {
|
||||||
"out": true // set this to false to include "out" folder in search results
|
"out": true
|
||||||
},
|
},
|
||||||
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
|
|
||||||
"typescript.tsc.autoDetect": "off",
|
"typescript.tsc.autoDetect": "off",
|
||||||
"i18n-haru.root": "l10n",
|
"i18n-haru.root": "l10n",
|
||||||
"i18n-haru.main": "zh-cn",
|
"i18n-haru.main": "zh-cn",
|
||||||
|
@ -126,5 +126,10 @@
|
|||||||
"info.pdf.exporting": "PDF wird nach {0} exportiert",
|
"info.pdf.exporting": "PDF wird nach {0} exportiert",
|
||||||
"info.generate-pdf-to": "PDF wurde unter {0} generiert",
|
"info.generate-pdf-to": "PDF wurde unter {0} generiert",
|
||||||
"info.vivado-gui.started": "Vivado GUI wird gestartet, bitte warten Sie einen Moment",
|
"info.vivado-gui.started": "Vivado GUI wird gestartet, bitte warten Sie einen Moment",
|
||||||
"ok": "Gut"
|
"ok": "Gut",
|
||||||
|
"netlist.save-as-markdown": "Als Markdown speichern",
|
||||||
|
"markdown-file": "Markdown-Datei",
|
||||||
|
"toolbar.save-as-html": "Als HTML speichern",
|
||||||
|
"html-file": "HTML-Datei",
|
||||||
|
"dide-doc.error.loading-html": "Digital CodeDoc-Ressourcen konnten nicht geladen werden, das Installationsverzeichnis ist beschädigt. Bitte installieren Sie das Programm neu!"
|
||||||
}
|
}
|
@ -126,5 +126,10 @@
|
|||||||
"info.pdf.exporting": "Exporting PDF to {0}",
|
"info.pdf.exporting": "Exporting PDF to {0}",
|
||||||
"info.generate-pdf-to": "PDF has been generated to {0}",
|
"info.generate-pdf-to": "PDF has been generated to {0}",
|
||||||
"info.vivado-gui.started": "Vivado GUI is starting, please wait a moment",
|
"info.vivado-gui.started": "Vivado GUI is starting, please wait a moment",
|
||||||
"ok": "Good"
|
"ok": "Good",
|
||||||
|
"netlist.save-as-markdown": "Save as Markdown",
|
||||||
|
"markdown-file": "Markdown file",
|
||||||
|
"toolbar.save-as-html": "Save as HTML",
|
||||||
|
"html-file": "HTML file",
|
||||||
|
"dide-doc.error.loading-html": "Digital CodeDoc resource loading failed, the installation directory is corrupted, please reinstall!"
|
||||||
}
|
}
|
@ -126,5 +126,10 @@
|
|||||||
"info.pdf.exporting": "PDFを{0}にエクスポート中",
|
"info.pdf.exporting": "PDFを{0}にエクスポート中",
|
||||||
"info.generate-pdf-to": "PDFは{0}に生成されました",
|
"info.generate-pdf-to": "PDFは{0}に生成されました",
|
||||||
"info.vivado-gui.started": "Vivado GUI を起動しています、少々お待ちください",
|
"info.vivado-gui.started": "Vivado GUI を起動しています、少々お待ちください",
|
||||||
"ok": "良い"
|
"ok": "良い",
|
||||||
|
"netlist.save-as-markdown": "Markdownとして保存",
|
||||||
|
"markdown-file": "Markdownファイル",
|
||||||
|
"toolbar.save-as-html": "HTMLとして保存",
|
||||||
|
"html-file": "HTMLファイル",
|
||||||
|
"dide-doc.error.loading-html": "Digital CodeDoc リソースの読み込みに失敗しました。インストールディレクトリが破損しています。再インストールしてください!"
|
||||||
}
|
}
|
@ -126,5 +126,10 @@
|
|||||||
"info.pdf.exporting": "正在导出 pdf 到 {0}",
|
"info.pdf.exporting": "正在导出 pdf 到 {0}",
|
||||||
"info.generate-pdf-to": "pdf 已经生成至 {0}",
|
"info.generate-pdf-to": "pdf 已经生成至 {0}",
|
||||||
"info.vivado-gui.started": "Vivado GUI 正在启动中,稍等片刻",
|
"info.vivado-gui.started": "Vivado GUI 正在启动中,稍等片刻",
|
||||||
"ok": "好的"
|
"ok": "好的",
|
||||||
|
"netlist.save-as-markdown": "保存为 Markdown",
|
||||||
|
"markdown-file": "Markdown 文件",
|
||||||
|
"toolbar.save-as-html": "保存为 HTML",
|
||||||
|
"html-file": "HTML 文件",
|
||||||
|
"dide-doc.error.loading-html": "Digital CodeDoc 资源加载失败,安装目录已经损坏,请重新安装!"
|
||||||
}
|
}
|
@ -126,5 +126,10 @@
|
|||||||
"info.pdf.exporting": "正在導出PDF到{0}",
|
"info.pdf.exporting": "正在導出PDF到{0}",
|
||||||
"info.generate-pdf-to": "PDF 已生成至 {0}",
|
"info.generate-pdf-to": "PDF 已生成至 {0}",
|
||||||
"info.vivado-gui.started": "Vivado GUI 正在啟動中,稍等片刻",
|
"info.vivado-gui.started": "Vivado GUI 正在啟動中,稍等片刻",
|
||||||
"ok": "好的"
|
"ok": "好的",
|
||||||
|
"netlist.save-as-markdown": "儲存為 Markdown",
|
||||||
|
"markdown-file": "Markdown 檔案",
|
||||||
|
"toolbar.save-as-html": "保存為HTML",
|
||||||
|
"html-file": "HTML檔案",
|
||||||
|
"dide-doc.error.loading-html": "Digital CodeDoc 資源加載失敗,安裝目錄已經損壞,請重新安裝!"
|
||||||
}
|
}
|
6
resources/dide-doc/README.md
Normal file
6
resources/dide-doc/README.md
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
dide-doc
|
||||||
|
- view
|
||||||
|
- index.html
|
||||||
|
- css
|
||||||
|
- js
|
||||||
|
- ...
|
@ -1,43 +0,0 @@
|
|||||||
@font-face {
|
|
||||||
font-family: "iconfont"; /* Project id 4748764 */
|
|
||||||
src: url('iconfont.woff2?t=1731914985969') format('woff2'),
|
|
||||||
url('iconfont.woff?t=1731914985969') format('woff'),
|
|
||||||
url('iconfont.ttf?t=1731914985969') format('truetype');
|
|
||||||
}
|
|
||||||
|
|
||||||
.iconfont {
|
|
||||||
font-family: "iconfont" !important;
|
|
||||||
|
|
||||||
font-style: normal;
|
|
||||||
-webkit-font-smoothing: antialiased;
|
|
||||||
-moz-osx-font-smoothing: grayscale;
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-tree:before {
|
|
||||||
content: "\e601";
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-verilog:before {
|
|
||||||
content: "\e634";
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-top-module:before {
|
|
||||||
content: "\e682";
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-top:before {
|
|
||||||
content: "\e600";
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-parameter:before {
|
|
||||||
content: "\e655";
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-unknown:before {
|
|
||||||
content: "\e62a";
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-port:before {
|
|
||||||
content: "\e638";
|
|
||||||
}
|
|
||||||
|
|
Binary file not shown.
@ -1,65 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<title>Digital IDE Document</title>
|
|
||||||
<link rel="icon" href="icon.png">
|
|
||||||
<link rel="stylesheet" href="documentation.css">
|
|
||||||
<link rel="stylesheet" href="iconfont.css">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div id="wrapper">
|
|
||||||
<div id="write"></div>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
<script>
|
|
||||||
const vscode = acquireVsCodeApi();
|
|
||||||
|
|
||||||
|
|
||||||
function enableHrefVscodeOpen() {
|
|
||||||
// 自定义超链接
|
|
||||||
document.querySelectorAll('a').forEach(link => {
|
|
||||||
link.addEventListener('click', (event) => {
|
|
||||||
event.preventDefault();
|
|
||||||
const href = link.getAttribute('href');
|
|
||||||
if (href.startsWith('file://')) {
|
|
||||||
vscode.postMessage({
|
|
||||||
command: 'openFile',
|
|
||||||
filePath: href
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
window.addEventListener('message', event => {
|
|
||||||
const response = event.data;
|
|
||||||
const { command, body } = response;
|
|
||||||
switch (command) {
|
|
||||||
case 'do-render':
|
|
||||||
doRender(body);
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
window.onload = async () => {
|
|
||||||
vscode.postMessage({
|
|
||||||
command: 'do-render'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function doRender(body) {
|
|
||||||
document.getElementById('write').innerHTML = body;
|
|
||||||
enableHrefVscodeOpen();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
|
||||||
</html>
|
|
@ -1,42 +0,0 @@
|
|||||||
import requests as r
|
|
||||||
import os
|
|
||||||
import shutil
|
|
||||||
import zipfile
|
|
||||||
|
|
||||||
# 下载 压缩包
|
|
||||||
headers = {
|
|
||||||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36',
|
|
||||||
'Cookie': 'cna=FeNcHjgPWA8CAXU/P9lD8IsF; EGG_SESS_ICONFONT=Hu68kBY7XO7C6Udp3T99M1asKmUZ0gxjps8xjTrjx4ZtNCIR_nFu9Li15nxoPAWLmGlcEMN2KEQyAvgBfASR3cSsmd2lhqg89lUmApzbWgBgCWjMwMzjawMqh2KNT8kCICxit3iWC7YLdUuCdUfXg_cGkRjPNvDohqyeHF27gTb5CloBSvLjqN45PcUvcUig; ctoken=Ku-GfnHTFQU6ObMjjX4rrwYn; u=10114852; u.sig=mv5vi-TPPlhvQJi2PMIC4VoPpD03Wc9UykMTMiG6ElA; xlly_s=1; tfstk=fSrIwBNqyBACtg2sZ2BZ5BUbpIn7PWsVNLM8n8KeeDnpwQex_JrEY887N5wxykyrvui717NU8DUUPYN4p7glKbl-N7y88OSV0J2nq0K5giSVfSIC9W9pv3B-6YMoT58eCJ2nqdvwwZzTKU6xnQBS27ntXvkj2HHKwO9tnfKKeHHJ6OMo6bn-9v39XxMD9e3Kpbdy1Y7IeJ69Kr6y7I-gLftJcKDKJZyez3-yav0nMVh62Arsd2GYpk3XwyMTblgq7L5ZX-4a9AifbenYCzFbk7b2SDw8J70_t1Ys_PE3eb3wenysPXaTvV9J2RmsN447O6Tn9yPsoA39FiDagfe3vP6k6JFqODHt7iBbB4UaxqqF6HiYoJoUy7b2SDw8JcszunlfpXTWCqxSCjW1CUYrE4jk1CVx8l3KIvIVCOO6r2HiCjW1CUYoJADLuO661Uf..; isg=BCwsfWsQZki1QXEWw0jCCc4h_Qpe5dCP-aVamIZsF1d6kc6br_ZyHmFnsVkpGQjn',
|
|
||||||
'Pragma': 'no-cache',
|
|
||||||
'sec-fetch-mode': 'navigate'
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
url = 'https://www.iconfont.cn/api/project/download.zip?spm=a313x.manage_type_myprojects.i1.d7543c303.21213a81tE9WyY&pid=4748764&ctoken=QcRJGHx0m7kL39pW1Slgy_E8'
|
|
||||||
res = r.get(url, headers=headers)
|
|
||||||
|
|
||||||
if res.status_code:
|
|
||||||
with open('./script/tmp.zip', 'wb') as fp:
|
|
||||||
fp.write(res.content)
|
|
||||||
|
|
||||||
# 解压文件
|
|
||||||
with zipfile.ZipFile('./script/tmp.zip', 'r') as zipf:
|
|
||||||
zipf.extractall('./script/tmp')
|
|
||||||
|
|
||||||
# 将文件搬运至工作区,我的 css 全放在 public 下面了,你的视情况而定
|
|
||||||
for parent, _, files in os.walk('./script/tmp'):
|
|
||||||
for file in files:
|
|
||||||
filepath = os.path.join(parent, file)
|
|
||||||
if file.startswith('demo'):
|
|
||||||
continue
|
|
||||||
if file.endswith('.css'):
|
|
||||||
content = open(filepath, 'r', encoding='utf-8').read().replace('font-size: 16px;', '')
|
|
||||||
open(filepath, 'w', encoding='utf-8').write(content)
|
|
||||||
shutil.move(filepath, os.path.join('./resources/dide-doc', file))
|
|
||||||
elif file.endswith('.woff2'):
|
|
||||||
shutil.move(filepath, os.path.join('./resources/dide-doc', file))
|
|
||||||
|
|
||||||
# 删除压缩包和解压区域
|
|
||||||
os.remove('./script/tmp.zip')
|
|
||||||
shutil.rmtree('./script/tmp')
|
|
BIN
resources/dide-doc/view/CascadiaCode.woff2
Normal file
BIN
resources/dide-doc/view/CascadiaCode.woff2
Normal file
Binary file not shown.
127
resources/dide-doc/view/animation.css
Normal file
127
resources/dide-doc/view/animation.css
Normal file
@ -0,0 +1,127 @@
|
|||||||
|
:root {
|
||||||
|
--main-during: 0.35s;
|
||||||
|
--fade-during: .5s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fade-animation-effect {
|
||||||
|
transition: var(--animation-5s);
|
||||||
|
-webkit-transition: var(--animation-5s);
|
||||||
|
-ms-transition: var(--animation-5s);
|
||||||
|
}
|
||||||
|
|
||||||
|
.easy-hidden {
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.main-fade-enter-from,
|
||||||
|
.main-fade-leave-to {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
.main-fade-enter-to,
|
||||||
|
.main-fade-leave-from {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
.main-fade-enter-active,
|
||||||
|
.main-fade-leave-active {
|
||||||
|
transition: opacity var(--main-during);
|
||||||
|
-moz-transition: opacity var(--main-during);
|
||||||
|
-webkit-transition: opacity var(--main-during);
|
||||||
|
}
|
||||||
|
|
||||||
|
.slide-enter-active,
|
||||||
|
.slide-leave-active {
|
||||||
|
transition: all .5s ease-out;
|
||||||
|
-moz-transition: all .5s ease-out;
|
||||||
|
-webkit-transition: all .5s ease-out;
|
||||||
|
}
|
||||||
|
.slide-enter-from {
|
||||||
|
position: relative;
|
||||||
|
transform: translateY(-100px);
|
||||||
|
opacity: 0%;
|
||||||
|
}
|
||||||
|
.slide-leave-to {
|
||||||
|
transform: translateY(100px);
|
||||||
|
opacity: 0%;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.slide-down-enter-active,
|
||||||
|
.slide-down-leave-active {
|
||||||
|
transition: all .5s ease-out;
|
||||||
|
-moz-transition: all .5s ease-out;
|
||||||
|
-webkit-transition: all .5s ease-out;
|
||||||
|
}
|
||||||
|
.slide-down-enter-from {
|
||||||
|
position: relative;
|
||||||
|
transform: translateY(100px);
|
||||||
|
opacity: 0%;
|
||||||
|
}
|
||||||
|
.slide-down-leave-to {
|
||||||
|
transform: translateY(100px);
|
||||||
|
opacity: 0%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slide-up-enter-active,
|
||||||
|
.slide-up-leave-active {
|
||||||
|
transition: all .5s ease-out;
|
||||||
|
-moz-transition: all .5s ease-out;
|
||||||
|
-webkit-transition: all .5s ease-out;
|
||||||
|
}
|
||||||
|
.slide-up-enter-from {
|
||||||
|
position: relative;
|
||||||
|
transform: translateY(-100px);
|
||||||
|
opacity: 0%;
|
||||||
|
}
|
||||||
|
.slide-up-leave-to {
|
||||||
|
transform: translateY(-100px);
|
||||||
|
opacity: 0%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.collapse-from-top-enter-active,
|
||||||
|
.collapse-from-top-leave-active {
|
||||||
|
transition: var(--animation-3s);
|
||||||
|
-moz-transition: var(--animation-3s);
|
||||||
|
-webkit-transition: var(--animation-3s);
|
||||||
|
}
|
||||||
|
|
||||||
|
.collapse-from-top-enter-from {
|
||||||
|
transform: scaleY(0);
|
||||||
|
transform-origin: center top;
|
||||||
|
opacity: 0%;
|
||||||
|
}
|
||||||
|
.collapse-from-top-leave-to {
|
||||||
|
transform: scaleY(0);
|
||||||
|
transform-origin: center top;
|
||||||
|
opacity: 0%;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes loading-mask {
|
||||||
|
0% {
|
||||||
|
background-position: 100% 50%;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
background-position: 0 50%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes word-jump {
|
||||||
|
0% {
|
||||||
|
transform: translateY(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
20% {
|
||||||
|
transform: translateY(-5px);
|
||||||
|
}
|
||||||
|
|
||||||
|
80% {
|
||||||
|
transform: translateY(2px);
|
||||||
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
|
transform: translateY(0px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.fast-transition {
|
||||||
|
transition: var(--animation-3s);
|
||||||
|
}
|
@ -1,15 +1,138 @@
|
|||||||
:root {
|
:root {
|
||||||
--dark-main-color : #df733d;
|
--display-signal-info-height: 50px;
|
||||||
--light-main-color : #cc6633;
|
--signal-default-color: #4CAF50;
|
||||||
|
--main-color: #CB81DA;
|
||||||
|
--main-transplate-color: rgba(203, 129, 208, 0.1);
|
||||||
|
--main-hover-color: rgba(203, 129, 208, 0.5);
|
||||||
|
--shadow-color: rgba(139, 73, 225, 0.99);
|
||||||
|
--main-dark-color: #2D323B;
|
||||||
|
--main-light-color: var(--main-color);
|
||||||
|
--monospace-font: "Cascadia code", monospace;
|
||||||
|
--dark-theme-border: 1px solid rgba(242, 242, 242, 0.3);
|
||||||
|
--light-theme-border: 1px solid rgba(142, 142, 142, 0.3);
|
||||||
|
|
||||||
|
/* css 动画属性 */
|
||||||
|
--animation-7s: .7s cubic-bezier(0.23,1,0.32,1);
|
||||||
|
--animation-5s: .5s cubic-bezier(0.23,1,0.32,1);
|
||||||
|
--animation-3s: .35s cubic-bezier(0.23,1,0.32,1);
|
||||||
|
--gray-box-shadow-0: 0 0 8px 3px rgba(182, 181, 182, 0.9);
|
||||||
|
--gray-box-shadow-1: 0 0 5px 1px rgba(16, 16, 16, 0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: "Cascadia code";
|
||||||
|
src: url("./CascadiaCode.woff2");
|
||||||
|
}
|
||||||
|
|
||||||
|
html, body {
|
||||||
|
background-color: var(--background);
|
||||||
|
color: var(--foreground);
|
||||||
|
}
|
||||||
|
|
||||||
|
*::selection {
|
||||||
|
background-color: var(--main-hover-color) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
body::-webkit-scrollbar {
|
||||||
|
width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
* hr {
|
||||||
|
border: none;
|
||||||
|
background-color: var(--main-color);
|
||||||
|
height: 1.5px;
|
||||||
|
width: 95%;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
::-webkit-scrollbar {
|
||||||
|
width: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
::-webkit-scrollbar-track {
|
||||||
|
background: var(--sidebar);
|
||||||
|
}
|
||||||
|
|
||||||
|
::-webkit-scrollbar-thumb {
|
||||||
|
background: var(--scrollbar-background);
|
||||||
|
border-radius: .3em;
|
||||||
|
}
|
||||||
|
|
||||||
|
::-webkit-scrollbar-thumb:hover {
|
||||||
|
background: var(--scrollbar-hover);
|
||||||
|
border-radius: .3em;
|
||||||
|
}
|
||||||
|
|
||||||
|
::-webkit-scrollbar-thumb:active {
|
||||||
|
background: var(--scrollbar-active);
|
||||||
|
border-radius: .3em;
|
||||||
|
}
|
||||||
|
|
||||||
|
::-webkit-scrollbar-button {
|
||||||
|
height: 0;
|
||||||
|
width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
::-webkit-scrollbar-corner {
|
||||||
|
background: none;
|
||||||
|
display: none;
|
||||||
|
} */
|
||||||
|
|
||||||
|
.el-select__wrapper {
|
||||||
|
min-width: 100px;
|
||||||
|
padding: 13px;
|
||||||
|
color: var(--sidebar-item-text);
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-select-group__title {
|
||||||
|
color: var(--main-color) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-select__placeholder {
|
||||||
|
color: var(--sidebar-item-text) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-select-dropdown {
|
||||||
|
background-color: var(--sidebar);
|
||||||
|
border: 1.0px solid var(--main-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-checkbox-button__inner {
|
||||||
|
font-size: 16px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: var(--main-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.digital-ide-icon {
|
||||||
|
background-image: url(./icon.svg);
|
||||||
|
background-size: 100%;
|
||||||
|
height: 50px;
|
||||||
|
width: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.digital-ide-icon.big {
|
||||||
|
background-image: url(./icon.svg);
|
||||||
|
background-size: 100%;
|
||||||
|
height: 150px;
|
||||||
|
width: 150px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-radio-button__original-radio:disabled:checked+.el-radio-button__inner {
|
||||||
|
opacity: 0.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-select__wrapper.is-disabled {
|
||||||
|
opacity: 0.6;
|
||||||
|
box-shadow: unset !important;
|
||||||
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
-ms-text-size-adjust: 100%;
|
-ms-text-size-adjust: 100%;
|
||||||
-webkit-text-size-adjust: 100%;
|
-webkit-text-size-adjust: 100%;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
||||||
font-size: 16px;
|
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
background-attachment: fixed;
|
background-attachment: fixed;
|
||||||
@ -37,8 +160,8 @@ a {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#write {
|
#write {
|
||||||
padding: 15px 30px;
|
padding: 10px;
|
||||||
width: 1000px;
|
width: 800px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ImgCaption {
|
.ImgCaption {
|
||||||
@ -435,27 +558,6 @@ li+li {
|
|||||||
margin-top: 0.25em;
|
margin-top: 0.25em;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
table {
|
|
||||||
display: block;
|
|
||||||
width: 100%;
|
|
||||||
overflow: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
table th {
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
table th,
|
|
||||||
table td {
|
|
||||||
padding: 6px 13px;
|
|
||||||
border: .7px solid;
|
|
||||||
}
|
|
||||||
|
|
||||||
table tr {
|
|
||||||
border-top: .7px solid;
|
|
||||||
} */
|
|
||||||
|
|
||||||
|
|
||||||
img {
|
img {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
@ -479,16 +581,13 @@ img {
|
|||||||
|
|
||||||
#write table thead th {
|
#write table thead th {
|
||||||
/* background-color: var(--dark-main-color); */
|
/* background-color: var(--dark-main-color); */
|
||||||
font-size: 20px;
|
|
||||||
font-weight: bolder;
|
font-weight: bolder;
|
||||||
width: 100px;
|
|
||||||
text-align: center;
|
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.vscode-dark table {
|
.vscode-dark table {
|
||||||
color: #F0F0F0;
|
color: var(--vscode-foreground);
|
||||||
}
|
}
|
||||||
|
|
||||||
.vscode-light table {
|
.vscode-light table {
|
||||||
@ -595,7 +694,7 @@ img {
|
|||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
padding: 20px 0px;
|
padding: 20px 0px;
|
||||||
margin: 10px 0 10px 0px;
|
margin: 10px 0 10px 0px;
|
||||||
width: 105px;
|
width: 95px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.diagram-container .arrow-wrapper {
|
.diagram-container .arrow-wrapper {
|
||||||
@ -672,6 +771,106 @@ img {
|
|||||||
background-color: #a09c9c;
|
background-color: #a09c9c;
|
||||||
}
|
}
|
||||||
|
|
||||||
#write table, th, td {
|
.vscode-dark table, th, td {
|
||||||
border: 1px solid var(--vscode-foreground) !important;
|
border: 1px solid rgba(242, 242, 242, 0.1) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.vscode-light table, th, td {
|
||||||
|
border: 1px solid rgba(142, 142, 142, 0.1) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* #write table, th {
|
||||||
|
border-bottom: 1px solid rgb(76, 55, 114) !important;
|
||||||
|
} */
|
||||||
|
|
||||||
|
/* #write table, td {
|
||||||
|
border-bottom: 1px solid rgba(242, 242, 242, 0.3) !important;
|
||||||
|
} */
|
||||||
|
|
||||||
|
#write table {
|
||||||
|
border-radius: .3em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.left-align {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-ext-block {
|
||||||
|
border-radius: .3em;
|
||||||
|
border: 1px solid var(--main-color);
|
||||||
|
background-color: var(--main-transplate-color);
|
||||||
|
padding: 3px 15px;
|
||||||
|
margin-bottom: 25px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-ext-block .iconfont {
|
||||||
|
font-size: 1.2rem;
|
||||||
|
margin-right: .7rem;
|
||||||
|
color: var(--main-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-ext-block .title {
|
||||||
|
color: var(--main-color);
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: 1.3rem;
|
||||||
|
letter-spacing: unset;
|
||||||
|
line-height: unset;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-ext-block .desc {
|
||||||
|
color: black;
|
||||||
|
font-weight: 700;
|
||||||
|
margin-left: .7rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pre-dot::before {
|
||||||
|
content: "";
|
||||||
|
display: inline-table;
|
||||||
|
width: 12px;
|
||||||
|
height: 12px;
|
||||||
|
margin-right: 7px;
|
||||||
|
background-color: var(--main-color);
|
||||||
|
border-radius: .5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre {
|
||||||
|
-webkit-overflow-scrolling: touch;
|
||||||
|
font-family: var(--monospace-font), "Courier New", monospace;
|
||||||
|
font-size: 0.9em;
|
||||||
|
margin: 0 0 2em 0;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
pre > code {
|
||||||
|
display: block;
|
||||||
|
line-height: 1.75;
|
||||||
|
padding: 1em 1.5em;
|
||||||
|
overflow-x: auto;
|
||||||
|
border-top: rgba(230, 235, 237, 0) solid 35px;
|
||||||
|
background-color: var(--vscode-textCodeBlock-background);
|
||||||
|
border-radius: .3em;
|
||||||
|
font-family: var(--monospace-font), "Courier New", monospace;
|
||||||
|
font-size: 15px;
|
||||||
|
margin: 0 0.25em;
|
||||||
|
transition: all 0.3s linear;
|
||||||
|
-moz-transition: all 0.3s linear;
|
||||||
|
-webkit-transition: all 0.3s linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre > code:before {
|
||||||
|
content: "";
|
||||||
|
background: var(--shadow-color);
|
||||||
|
box-shadow: 23px 0 #b6bdc9, 45px 0 #b6bdc9;
|
||||||
|
border-radius: 50%;
|
||||||
|
margin-top: -36px;
|
||||||
|
margin-left: -6px;
|
||||||
|
position: absolute;
|
||||||
|
height: 13px;
|
||||||
|
width: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.el-popper {
|
||||||
|
color: white !important;
|
||||||
|
}
|
1
resources/dide-doc/view/css/app.6bbe8d76.css
Normal file
1
resources/dide-doc/view/css/app.6bbe8d76.css
Normal file
File diff suppressed because one or more lines are too long
1
resources/dide-doc/view/css/chunk-vendors.0be1d56f.css
Normal file
1
resources/dide-doc/view/css/chunk-vendors.0be1d56f.css
Normal file
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
42
resources/dide-doc/view/icon.svg
Normal file
42
resources/dide-doc/view/icon.svg
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"
|
||||||
|
width="126px" height="126px" viewBox="-0.5 -0.5 126 126"
|
||||||
|
content="<mxfile><diagram id="E9SxX19eNgA6MUTyjjO6" name="Icon-黑白">7VnbktsoEP0aP0YlhG5+HF/GqVSS8pZrd2f3xcVIWGJXEiqEx3K+fsFCN8sXORnNuJL1g003TQN9DtDgEZzG+YKhNPxCfRyNDN3PR3A2MgzoOOJbKvaFwjDNQhEw4hcqUCtW5BtWSl1pt8THWcuQUxpxkraVHk0S7PGWDjFGd22zDY3avaYowB3FykNRV/sn8XmotMAe1xUfMQlC1bVrqAnHqDRWM8lC5NNdQwXnIzhllPKiFOdTHMnYlXHxJ7s5fqSf7OfpbvVp7cXpYv2hcPZ4S5NqCgwn/HVdw8L1C4q2Kl5qrnxfBnAXEo5XKfKkvBMcGcFJyONISEAUUZYWsG1IjkVXkw2JoimNKDs0h8YMGnAi9Bln9N8KA0ta0oQ3LDeHT2VZ1iQ0ET1PGN0mvuyg6JV5imrAFWLPAKlAvmDGcd6ghwrYAtMYc7YXJqrWtBX2JflLedegUsmPsMGiSokUfYPKdw2RKCiUbkDMfC/EYG/ERM104oLZwwXYLH1I2FyoOVYbuYaqAZ5jaFYXvVr76vDZ1+ETXsTmKDl/K5BtwIwutBUs5wELGPIJrmFWy2+4FeZobaSgVWmaq+wETGAokJx7B2koNCzrDtFw/0ejPn/eEo08X23Th+zzxPqbzBe7cGIbf/TZwAKx6adVXDrzrXI99Fy20G8J4fm9ZHzEXb17WlsnYgWHYu74eqxkdIjIVj+jZxwtaUY4oYmoeqac01jSrsw65YHpoyw8HKZSQBEJpKknYoZZm+el2wdlw2la+Eplv3EeyFxfw5FAgUk7LaIB8dYB4jhrlEUbmmKG1KBQMtySuUi23kumjLBiADA1B9quKW4jlmFDYHf4AOGJteNqVQvLccdD0QOA6/y4OZcTGdojikkkIzClMfGEvxVKMvHzZaUMVA7mdsAER2D6eIO2ER8CsOb+BU5gAIYKuvELB708RgzNAWNj7BqmZQNTh2b3THlTTJzuie6LW7wSKeMhDWiConmtbdws9DY8OCf8Sall+S9Zlsl/Ic7yRt1s3xCWmBExIbmXFrpETO6p9CqFwpVVirWrg1T6uoUOAB6a+w/yqaNOt4XmkcggHhye30e7e/FtnMnolnn4+hHGEQvwxZNZrSKJ20UKMhyJ4+Sl/TrzI4zS7309j2QiIj+nkKxqfsK1fvfH2zsh8wahPznCIR77XhuP3rnjiWtFP4juB48hnvJ+Bjzef+c6OVpriCSlLDcyi/M5SpmPVELRyriWkByk4+zmVqq8fpJylCt8P2F65xSHpmIWaN8wSClJeNbwvJSK+k4J7KNXGFuTbLR011H8bFLrenMw1mxzDAzD1R0dOJZpHVGzGOAZb6DHUKqpFemdcnFhjMfX5rEGWzdgs+22yAY7bg+rqoKl10Lzflt8s5++muuPH5bW+vf863LzT59z6h4e/K7seN/zgNV5DB/0wU+I9b+XBXj1X8Bw/h8=</diagram><diagram id="2oZjiazD9LnPP1Vpl2Fo" name="第 2 页">5ZZdb4IwFEB/DY8m0DLQV5m6h7nEuGXPDVToVigpVXC/fkUuX+Lilui2RF+k515u29ObBgN7cbGQJI2WIqDcQGZQGPjeQAiZeKL/SrKviGU6qCKhZAGwFqzZB60TgW5ZQLNeohKCK5b2oS+ShPqqx4iUIu+nbQTvz5qSEGY0W7D2CaeDtFcWqKiiY+S2/IGyMKpnthzYcUzqZCicRSQQeQfhmYE9KYSqnuLCo7y0V3up3pt/EW0WJmmivvNCulw+b3YrwlZPycub9Tgd52oEVXaEb2HDsFi1rw1IsU0CWhaxDDzNI6boOiV+Gc31oWsWqZhDeMM49wQXUo8TkeikaaakeG/kIVuj4dLrdVCpaNFBsJUFFTFVcq9TIDqyXPAKnYVtGOftMWEMLOocUQMJtEbYFG/t6QcQ+AOZ6NdlmheS6Y57Lm2MBi4t2xm6bODFXeLzLnUVfQvQ8x5JllZXw4YVpfsji+Mj1QbC88OvyTwVuUgP20c97A572D7Rwva1OvjuBqxP/plz5/acO+YfO3dvwPngdrmidT1sP2QOsc73IJ59Ag==</diagram></mxfile>">
|
||||||
|
<defs />
|
||||||
|
<g>
|
||||||
|
<rect x="2" y="2" width="120" height="120" rx="21.6" ry="21.6" fill="#2d323b" stroke="none"
|
||||||
|
pointer-events="all" />
|
||||||
|
<rect x="25.75" y="25.75" width="72.5" height="72.5" rx="36.25" ry="36.25" fill="#2d323b"
|
||||||
|
stroke="#cb81da" stroke-width="3" pointer-events="all" />
|
||||||
|
<ellipse cx="17" cy="107" rx="7.500000000000001" ry="7.500000000000001" fill="#cb81da"
|
||||||
|
stroke="#cb81da" stroke-width="2" pointer-events="all" />
|
||||||
|
<ellipse cx="107" cy="107" rx="7.500000000000001" ry="7.500000000000001" fill="#cb81da"
|
||||||
|
stroke="#cb81da" stroke-width="2" pointer-events="all" />
|
||||||
|
<ellipse cx="107" cy="17" rx="7.500000000000001" ry="7.500000000000001" fill="#cb81da"
|
||||||
|
stroke="#cb81da" stroke-width="2" pointer-events="all" />
|
||||||
|
<path d="M 85.4 65.95 L 92 65.95 M 59 61.34 L 65.6 61.34 M 59 70.55 L 65.6 70.55"
|
||||||
|
fill="none" stroke="#cb81da" stroke-width="2" stroke-miterlimit="10"
|
||||||
|
pointer-events="none" />
|
||||||
|
<path
|
||||||
|
d="M 65.6 56.74 L 75.5 56.74 C 80.97 56.74 85.4 60.86 85.4 65.95 C 85.4 71.03 80.97 75.16 75.5 75.16 L 65.6 75.16 Z"
|
||||||
|
fill="#cb81da" stroke="#cb81da" stroke-width="2" stroke-miterlimit="10"
|
||||||
|
pointer-events="none" />
|
||||||
|
<rect x="37" y="42" width="11" height="11" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)"
|
||||||
|
pointer-events="none" />
|
||||||
|
<rect x="37" y="64.72" width="11" height="11" fill="rgb(255, 255, 255)"
|
||||||
|
stroke="rgb(0, 0, 0)" pointer-events="none" />
|
||||||
|
<path d="M 59 70.55 L 48.01 70.6" fill="none" stroke="#cb81da" stroke-width="2"
|
||||||
|
stroke-miterlimit="10" pointer-events="none" />
|
||||||
|
<rect x="37" y="64.72" width="11" height="11" fill="#000000" stroke="#000000"
|
||||||
|
pointer-events="none" />
|
||||||
|
<rect x="37" y="42" width="11" height="11" fill="#000000" stroke="#000000"
|
||||||
|
pointer-events="none" />
|
||||||
|
<rect x="37" y="42" width="11" height="11" fill="#cb81da" stroke="#cb81da"
|
||||||
|
pointer-events="none" />
|
||||||
|
<rect x="37" y="64.72" width="11" height="11" fill="#cb81da" stroke="#cb81da"
|
||||||
|
pointer-events="none" />
|
||||||
|
<path d="M 48 48.14 L 53.51 48.09 L 53.51 61.31 L 59 61.34" fill="none" stroke="#cb81da"
|
||||||
|
stroke-width="2" stroke-miterlimit="10" pointer-events="none" />
|
||||||
|
<ellipse cx="17" cy="17" rx="7.500000000000001" ry="7.500000000000001" fill="#cb81da"
|
||||||
|
stroke="#cb81da" stroke-width="2" pointer-events="none" />
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 4.9 KiB |
99
resources/dide-doc/view/iconfont.css
Normal file
99
resources/dide-doc/view/iconfont.css
Normal file
@ -0,0 +1,99 @@
|
|||||||
|
@font-face {
|
||||||
|
font-family: "iconfont"; /* Project id 4748764 */
|
||||||
|
src: url('iconfont.woff2?t=1739366063009') format('woff2'),
|
||||||
|
url('iconfont.woff?t=1739366063009') format('woff'),
|
||||||
|
url('iconfont.ttf?t=1739366063009') format('truetype');
|
||||||
|
}
|
||||||
|
|
||||||
|
.iconfont {
|
||||||
|
font-family: "iconfont" !important;
|
||||||
|
|
||||||
|
font-style: normal;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
-moz-osx-font-smoothing: grayscale;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-markdown:before {
|
||||||
|
content: "\e946";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-pdf:before {
|
||||||
|
content: "\e604";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-html:before {
|
||||||
|
content: "\e6a0";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-setting:before {
|
||||||
|
content: "\e657";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-about:before {
|
||||||
|
content: "\e603";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-i18n:before {
|
||||||
|
content: "\e669";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-close:before {
|
||||||
|
content: "\e602";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-full-screen:before {
|
||||||
|
content: "\e656";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-down:before {
|
||||||
|
content: "\e69b";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-download:before {
|
||||||
|
content: "\e66c";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-export:before {
|
||||||
|
content: "\e63e";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-scale-minus:before {
|
||||||
|
content: "\ec13";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-scale-plus:before {
|
||||||
|
content: "\ec14";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-triangle:before {
|
||||||
|
content: "\e615";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-tree:before {
|
||||||
|
content: "\e601";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-verilog:before {
|
||||||
|
content: "\e634";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-top-module:before {
|
||||||
|
content: "\e682";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-top:before {
|
||||||
|
content: "\e600";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-parameter:before {
|
||||||
|
content: "\e655";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-unknown:before {
|
||||||
|
content: "\e62a";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-port:before {
|
||||||
|
content: "\e638";
|
||||||
|
}
|
||||||
|
|
BIN
resources/dide-doc/view/iconfont.woff2
Normal file
BIN
resources/dide-doc/view/iconfont.woff2
Normal file
Binary file not shown.
1
resources/dide-doc/view/index.html
Normal file
1
resources/dide-doc/view/index.html
Normal file
@ -0,0 +1 @@
|
|||||||
|
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="icon.png"><title>CodeDoc Viewer</title><link rel="stylesheet" href="default-dark.css"><link rel="stylesheet" href="vscode.css"><link rel="stylesheet" href="codedoc.css"><link rel="stylesheet" href="iconfont.css"><link rel="stylesheet" href="animation.css"><link rel="stylesheet" href="svg.css"><script defer="defer" src="js/chunk-vendors.bfc2ce54.js"></script><script defer="defer" src="js/app.c552ae0e.js"></script><link href="css/chunk-vendors.0be1d56f.css" rel="stylesheet"><link href="css/app.6bbe8d76.css" rel="stylesheet"></head><body><div id="app"></div></body></html>
|
1
resources/dide-doc/view/js/661.6678bd27.js
Normal file
1
resources/dide-doc/view/js/661.6678bd27.js
Normal file
File diff suppressed because one or more lines are too long
6
resources/dide-doc/view/js/664.3bf7a321.js
Normal file
6
resources/dide-doc/view/js/664.3bf7a321.js
Normal file
File diff suppressed because one or more lines are too long
1
resources/dide-doc/view/js/842.bcf3c20f.js
Normal file
1
resources/dide-doc/view/js/842.bcf3c20f.js
Normal file
File diff suppressed because one or more lines are too long
1
resources/dide-doc/view/js/app.c552ae0e.js
Normal file
1
resources/dide-doc/view/js/app.c552ae0e.js
Normal file
File diff suppressed because one or more lines are too long
71
resources/dide-doc/view/js/chunk-vendors.bfc2ce54.js
Normal file
71
resources/dide-doc/view/js/chunk-vendors.bfc2ce54.js
Normal file
File diff suppressed because one or more lines are too long
59
resources/dide-doc/view/svg.css
Normal file
59
resources/dide-doc/view/svg.css
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
/* .node rect,
|
||||||
|
.node circle,
|
||||||
|
.node ellipse,
|
||||||
|
.node polygon,
|
||||||
|
.node path {
|
||||||
|
fill: rgba(203, 129, 208, 0.1) !important;
|
||||||
|
stroke: rgb(203, 129, 208) !important;
|
||||||
|
stroke-width: 1px !important;
|
||||||
|
} */
|
||||||
|
|
||||||
|
.node rect {
|
||||||
|
rx: 5 !important;
|
||||||
|
ry: 5 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info {
|
||||||
|
fill: var(--main-color) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.common-svg-container,
|
||||||
|
.diagram-container {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
position: relative;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
border-radius: .3em;
|
||||||
|
transition: var(--animation-3s);
|
||||||
|
}
|
||||||
|
|
||||||
|
.container-inner {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
min-height: 200px;
|
||||||
|
max-height: 880px;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
padding: 30px 10px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vscode-dark .common-svg-container,
|
||||||
|
.vscode-dark .diagram-container {
|
||||||
|
border: var(--dark-theme-border);
|
||||||
|
}
|
||||||
|
|
||||||
|
.vscode-dark .common-svg-container:hover,
|
||||||
|
.vscode-dark .diagram-container:hover {
|
||||||
|
border: 1px solid var(--main-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.vscode-light .common-svg-container,
|
||||||
|
.vscode-light .diagram-container {
|
||||||
|
border: var(--light-theme-border);
|
||||||
|
}
|
||||||
|
|
||||||
|
.vscode-light .common-svg-container:hover,
|
||||||
|
.vscode-light .diagram-container:hover {
|
||||||
|
border: 1px solid var(--main-color);
|
||||||
|
}
|
149
resources/dide-doc/view/vscode.css
Normal file
149
resources/dide-doc/view/vscode.css
Normal file
@ -0,0 +1,149 @@
|
|||||||
|
:root {
|
||||||
|
--font-monospace-family: var(--vscode-editor-font-family);
|
||||||
|
--font-monospace-weight: var(--vscode-editor-font-weight);
|
||||||
|
--font-monospace-size: var(--vscode-editor-font-size);
|
||||||
|
|
||||||
|
--link-foreground: var(--vscode-textLink-foreground);
|
||||||
|
--link-active: var(--vscode-textLink-activeForeground);
|
||||||
|
|
||||||
|
/* UI & Control */
|
||||||
|
--input-active-background: var(--vscode-input-background);
|
||||||
|
--input-active-border: var(--vscode-focusBorder);
|
||||||
|
--input-active-foreground: var(--vscode-input-foreground);
|
||||||
|
|
||||||
|
--input-error-background: var(--vscode-inputValidation-errorBackground);
|
||||||
|
--input-error-border: var(--vscode-inputValidation-errorBorder);
|
||||||
|
--input-error-foreground: var(--vscode-inputValidation-errorForeground);
|
||||||
|
|
||||||
|
--input-foreground: var(--vscode-input-foreground);
|
||||||
|
--input-background: var(--vscode-input-background);
|
||||||
|
--input-border: var(--vscode-input-border);
|
||||||
|
--input-hover: var(--vscode-input-background);
|
||||||
|
--input-placeholder: var(--vscode-input-placeholderForeground);
|
||||||
|
--input-radius: 0px;
|
||||||
|
|
||||||
|
--scrollbar-background: var(--vscode-scrollbarSlider-background);
|
||||||
|
--scrollbar-hover: var(--vscode-scrollbarSlider-hoverBackground);
|
||||||
|
--scrollbar-active: var(--vscode-scrollbarSlider-activeBackground);
|
||||||
|
|
||||||
|
/* Window */
|
||||||
|
--title-bar: #1f1f1f;
|
||||||
|
--title-color: #fff;
|
||||||
|
--foreground: var(--vscode-editor-foreground);
|
||||||
|
--background: var(--vscode-editor-background);
|
||||||
|
--label: rgb(189, 189, 189);
|
||||||
|
--shadow: #000;
|
||||||
|
--border: var(--vscode-input-border);
|
||||||
|
--window-button-hover: rgba(255,255,255,0.1);
|
||||||
|
--window-button-active: rgba(255,255,255,0.2);
|
||||||
|
--window-blur-background: rgba(0,0,0,0.25);
|
||||||
|
|
||||||
|
--window-title-foreground: var(--foreground);
|
||||||
|
--window-background: var(--sidebar);
|
||||||
|
--window-border: transparent;
|
||||||
|
--window-radius: 0px;
|
||||||
|
|
||||||
|
/* Sidebar */
|
||||||
|
--sidebar: var(--vscode-sideBar-background);
|
||||||
|
--sidebar-border: var(--vscode-sideBar-border);
|
||||||
|
--sidebar-min-width: 280px;
|
||||||
|
|
||||||
|
--sidebar-item-text: var(--vscode-list-inactiveSelectionForeground);
|
||||||
|
--sidebar-item-border: var(--vscode-input-border);
|
||||||
|
--sidebar-item-background: var(--sidebar);
|
||||||
|
--sidebar-item-selected: var(--vscode-list-inactiveSelectionBackground);
|
||||||
|
--sidebar-item-hover: var(--vscode-list-hoverBackground);
|
||||||
|
--sidebar-item-max-height: 40px;
|
||||||
|
--sidebar-item-radix-background: var(--vscode-breadcrumb-background);
|
||||||
|
|
||||||
|
--sidebar-group-text: var(--vscode-sideBarSectionHeader-foreground);
|
||||||
|
--sidebar-group-border: var(--vscode-sideBarSectionHeader-border);
|
||||||
|
--sidebar-group-background: var(--vscode-sideBarSectionHeader-background);
|
||||||
|
|
||||||
|
/* Labels */
|
||||||
|
--signalSize-background: rgba(0,0,0,0.5);
|
||||||
|
--signalSize-border: rgba(255,255,255,0.2);
|
||||||
|
--signalSize-color: var(--foreground);
|
||||||
|
|
||||||
|
/* Color Picker */
|
||||||
|
--picker-swatch-size: 15px;
|
||||||
|
--picker-swatch-cols: 8;
|
||||||
|
--picker-background: var(--vscode-breadcrumbPicker-background);
|
||||||
|
--picker-border: var(--vscode-dropdown-border);
|
||||||
|
|
||||||
|
/* Search */
|
||||||
|
--search-background: var(--vscode-quickInput-background);
|
||||||
|
--search-border: var(--border);
|
||||||
|
--search-panel-background: transparent;
|
||||||
|
--search-panel-border: var(--vscode-pickerGroup-border);
|
||||||
|
--search-panel-text: var(--vscode-quickInput-foreground);
|
||||||
|
--search-label: var(--foreground);
|
||||||
|
--search-selected-background: var(--vscode-list-inactiveSelectionBackground);
|
||||||
|
|
||||||
|
/* Properties */
|
||||||
|
--properties-background: var(--vscode-breadcrumb-background);
|
||||||
|
--properties-border: var(--border);
|
||||||
|
|
||||||
|
/* Navbar */
|
||||||
|
--navBar-background: var(--sidebar);
|
||||||
|
--navBar-height: 32px;
|
||||||
|
--navBar-button: transparent;
|
||||||
|
--navBar-button-text: var(--foreground);
|
||||||
|
--navBar-group-background: var(--background);
|
||||||
|
--navBar-preview-background: var(--vscode-scrollbarSlider-background);
|
||||||
|
--navBar-slider-border: var(--foreground);
|
||||||
|
|
||||||
|
/* Buttons */
|
||||||
|
--button: var(--vscode-button-background);
|
||||||
|
--button-text: var(--vscode-button-foreground);
|
||||||
|
--button-hover: var(--vscode-button-hoverBackground);
|
||||||
|
--button-active: var(--vscode-button-hoverBackground);
|
||||||
|
--button-disabled: var(--vscode-activityBar-background);
|
||||||
|
--button-disabled-text: var(--vscode-activityBar-inactiveForeground);
|
||||||
|
|
||||||
|
/* Grid Lines */
|
||||||
|
--grid-dash: 2;
|
||||||
|
--grid-space: 4;
|
||||||
|
--grid-line: var(--vscode-editorIndentGuide-background);
|
||||||
|
--grid-tick: var(--vscode-editorIndentGuide-activeBackground);
|
||||||
|
|
||||||
|
/* Cursor */
|
||||||
|
--cursor: var(--vscode-editorCursor-foreground);
|
||||||
|
--cursor-ghost: rgba(255, 255, 255, 0.2);
|
||||||
|
--cursor-width: 2;
|
||||||
|
|
||||||
|
/* X-Axis */
|
||||||
|
--axis-height: 38px;
|
||||||
|
--axis-line: var(--border);
|
||||||
|
--axis-background: var(--vscode-sideBar-background);
|
||||||
|
--axis-foreground: var(--foreground);
|
||||||
|
|
||||||
|
/* Signals */
|
||||||
|
--signal-highlight: var(--vscode-list-inactiveSelectionBackground);
|
||||||
|
|
||||||
|
/* Colors */
|
||||||
|
--accent: var(--vscode-button-background);
|
||||||
|
--accent-dim: #234175;
|
||||||
|
--accent-bright: #24c5f7;
|
||||||
|
--accent-hover: var(--vscode-button-hoverBackground);
|
||||||
|
|
||||||
|
--color-red: #ff5252;
|
||||||
|
--color-pink: #ff4081;
|
||||||
|
--color-purple: #e040fb;
|
||||||
|
--color-deepPurple: #7c4dff;
|
||||||
|
--color-indigo: #536dfe;
|
||||||
|
--color-blue: #448aff;
|
||||||
|
--color-lightBlue: #40c4ff;
|
||||||
|
--color-cyan: #18ffff;
|
||||||
|
--color-teal: #64ffda;
|
||||||
|
--color-green: #69f0ae;
|
||||||
|
--color-lightGreen: #b2ff59;
|
||||||
|
--color-lime: #eeff41;
|
||||||
|
--color-yellow: #ffff00;
|
||||||
|
--color-amber: #ffd740;
|
||||||
|
--color-orange: #ffab40;
|
||||||
|
--color-deepOrange: #ff6e40;
|
||||||
|
|
||||||
|
/* Settings */
|
||||||
|
--settings-action-background: var(--background);
|
||||||
|
}
|
308
src/function/dide-doc/codedoc.ts
Normal file
308
src/function/dide-doc/codedoc.ts
Normal file
@ -0,0 +1,308 @@
|
|||||||
|
import * as fs from 'fs';
|
||||||
|
import * as path from 'path';
|
||||||
|
import * as vscode from 'vscode';
|
||||||
|
|
||||||
|
import * as puppeteer from 'puppeteer-core';
|
||||||
|
import { PDFOptions, PaperFormat } from 'puppeteer-core';
|
||||||
|
import * as pako from 'pako';
|
||||||
|
import { t } from '../../i18n';
|
||||||
|
import { hdlPath } from '../../hdlFs';
|
||||||
|
import { opeParam } from '../../global';
|
||||||
|
|
||||||
|
export interface IPdfSetting {
|
||||||
|
scale: number
|
||||||
|
printBackground: boolean
|
||||||
|
landscape: boolean
|
||||||
|
format: string
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async function htmlFile2PdfFile(htmlPath: string, pdfPath: string, option?: IPdfSetting) {
|
||||||
|
const browserPath = 'C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe';
|
||||||
|
|
||||||
|
option = option || { scale: 1, printBackground: true, landscape: false, format: 'a4' };
|
||||||
|
|
||||||
|
const browser = await puppeteer.launch({
|
||||||
|
headless: 'new',
|
||||||
|
executablePath: browserPath,
|
||||||
|
args: ['--lang=en', '--no-sandbox', '--disable-setuid-sandbox']
|
||||||
|
});
|
||||||
|
|
||||||
|
const page = await browser.newPage();
|
||||||
|
|
||||||
|
const absoluteHtmlPath = path.resolve(htmlPath);
|
||||||
|
const uriFilePath = `file://${absoluteHtmlPath.replace(/\\/g, '/')}`;
|
||||||
|
await page.goto(uriFilePath, { waitUntil: 'networkidle0' });
|
||||||
|
|
||||||
|
const options: PDFOptions = {
|
||||||
|
path: pdfPath,
|
||||||
|
displayHeaderFooter: true,
|
||||||
|
// headerTemplate: '',
|
||||||
|
// footerTemplate: `<div style="font-size: 15px; margin: 0 auto; color: #CB81DA">CodeDoc - Powered By Digital IDE</div>`,
|
||||||
|
scale: option.scale,
|
||||||
|
printBackground: option.printBackground,
|
||||||
|
landscape: option.landscape,
|
||||||
|
format: option.format as PaperFormat,
|
||||||
|
margin: {
|
||||||
|
top: 0,
|
||||||
|
right: 0,
|
||||||
|
bottom: 0,
|
||||||
|
left: 0
|
||||||
|
}
|
||||||
|
};
|
||||||
|
await page.pdf(options);
|
||||||
|
await browser.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export async function getDocIR(data: any, panel: vscode.WebviewPanel, codeDocIr: any) {
|
||||||
|
const docIrPath = './static/codedoc.test.json';
|
||||||
|
const raw = fs.readFileSync(docIrPath, { encoding: 'utf-8' });
|
||||||
|
panel.webview.postMessage({
|
||||||
|
command: 'get-doc-ir',
|
||||||
|
codeDocIr
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function makeHtmlFromTemplate(content: string, backgroundColor: string): string {
|
||||||
|
return `
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Digital IDE</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="dide-svg">
|
||||||
|
${content}
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
<style>
|
||||||
|
.dide-svg {
|
||||||
|
background-color: ${backgroundColor};
|
||||||
|
width: 100vw;
|
||||||
|
height: 100vh;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</html>
|
||||||
|
`.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function downloadSvg(data: any, panel: vscode.WebviewPanel) {
|
||||||
|
try {
|
||||||
|
const { svgString, format, backgroundColor } = data;
|
||||||
|
switch (format) {
|
||||||
|
case 'pdf':
|
||||||
|
await downloadAsPdf(svgString, backgroundColor);
|
||||||
|
break;
|
||||||
|
case 'svg':
|
||||||
|
await downloadAsSvg(svgString);
|
||||||
|
break;
|
||||||
|
case 'markdown':
|
||||||
|
await downloadAsMarkdown(svgString);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
console.log('发生错误 downloadSvg');
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function downloadAsPdf(svgString: string, backgroundColor: string) {
|
||||||
|
const defaultFilename = '.pdf';
|
||||||
|
const defaultPath = hdlPath.join(opeParam.workspacePath, defaultFilename);
|
||||||
|
const saveUri = await vscode.window.showSaveDialog({
|
||||||
|
title: t('toolbar.save-as-pdf'),
|
||||||
|
defaultUri: vscode.Uri.file(defaultPath),
|
||||||
|
saveLabel: t('info.vcd-viewer.save'),
|
||||||
|
filters: {
|
||||||
|
[t('pdf-file')]: ['pdf'],
|
||||||
|
[t("info.vcd-viewer.all-file")]: ['*']
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (saveUri) {
|
||||||
|
const savePath = saveUri.fsPath;
|
||||||
|
const html = makeHtmlFromTemplate(svgString, backgroundColor);
|
||||||
|
fs.writeFileSync(savePath + '.html', html);
|
||||||
|
await htmlFile2PdfFile(savePath + '.html', savePath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function downloadAsSvg(svgString: string) {
|
||||||
|
const defaultFilename = '.svg';
|
||||||
|
const defaultPath = hdlPath.join(opeParam.workspacePath, defaultFilename);
|
||||||
|
|
||||||
|
const saveUri = await vscode.window.showSaveDialog({
|
||||||
|
title: t('netlist.save-as-svg'),
|
||||||
|
defaultUri: vscode.Uri.file(defaultPath),
|
||||||
|
saveLabel: t('info.vcd-viewer.save'),
|
||||||
|
filters: {
|
||||||
|
[t('svg-file')]: ['svg'],
|
||||||
|
[t("info.vcd-viewer.all-file")]: ['*']
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (saveUri) {
|
||||||
|
const savePath = saveUri.fsPath;
|
||||||
|
fs.writeFileSync(savePath, svgString);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function downloadAsMarkdown(svgString: string) {
|
||||||
|
const defaultFilename = '.md';
|
||||||
|
const defaultPath = hdlPath.join(opeParam.workspacePath, defaultFilename);
|
||||||
|
|
||||||
|
const saveUri = await vscode.window.showSaveDialog({
|
||||||
|
title: t('netlist.save-as-markdown'),
|
||||||
|
defaultUri: vscode.Uri.file(defaultPath),
|
||||||
|
saveLabel: t('info.vcd-viewer.save'),
|
||||||
|
filters: {
|
||||||
|
[t('markdown-file')]: ['md'],
|
||||||
|
[t("info.vcd-viewer.all-file")]: ['*']
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (saveUri) {
|
||||||
|
const savePath = saveUri.fsPath;
|
||||||
|
fs.writeFileSync(savePath, svgString);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function makeDocHtmlFromTemplate(content: string, cssString: string): string {
|
||||||
|
return `
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Digital IDE</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="vscode-dark dide-doc">
|
||||||
|
${content}
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
<style>
|
||||||
|
.dide-doc {
|
||||||
|
width: 100vw;
|
||||||
|
height: 100vh;
|
||||||
|
}
|
||||||
|
${cssString}
|
||||||
|
</style>
|
||||||
|
</html>
|
||||||
|
`.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
function getNameFromFileName(filename: string) {
|
||||||
|
if (filename) {
|
||||||
|
if (filename.includes('/')) {
|
||||||
|
return filename.split('/').at(-1) || '';
|
||||||
|
}
|
||||||
|
return filename;
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function exportDocHtml(data: any, panel: vscode.WebviewPanel) {
|
||||||
|
try {
|
||||||
|
const { renderStringArray, cssStringArray, filename, option } = data;
|
||||||
|
const renderString = pako.ungzip(renderStringArray, { to: 'string' });
|
||||||
|
const cssString = pako.ungzip(cssStringArray, { to: 'string' });
|
||||||
|
const html = makeDocHtmlFromTemplate(renderString, cssString);
|
||||||
|
|
||||||
|
const defaultFilename = getNameFromFileName(filename) + '.html';
|
||||||
|
const defaultPath = hdlPath.join(opeParam.workspacePath, defaultFilename);
|
||||||
|
const saveUri = await vscode.window.showSaveDialog({
|
||||||
|
title: t('toolbar.save-as-html'),
|
||||||
|
defaultUri: vscode.Uri.file(defaultPath),
|
||||||
|
saveLabel: t('info.vcd-viewer.save'),
|
||||||
|
filters: {
|
||||||
|
[t('html-file')]: ['html'],
|
||||||
|
[t("info.vcd-viewer.all-file")]: ['*']
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (saveUri) {
|
||||||
|
const savePath = saveUri.fsPath;
|
||||||
|
fs.writeFileSync(savePath, html);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function exportDocPdf(data: any, panel: vscode.WebviewPanel) {
|
||||||
|
try {
|
||||||
|
const { renderStringArray, cssStringArray, filename, option } = data;
|
||||||
|
const renderString = pako.ungzip(renderStringArray, { to: 'string' });
|
||||||
|
const cssString = pako.ungzip(cssStringArray, { to: 'string' });
|
||||||
|
const html = makeDocHtmlFromTemplate(renderString, cssString);
|
||||||
|
|
||||||
|
const defaultFilename = getNameFromFileName(filename) + '.pdf';
|
||||||
|
const defaultPath = hdlPath.join(opeParam.workspacePath, defaultFilename);
|
||||||
|
const saveUri = await vscode.window.showSaveDialog({
|
||||||
|
title: t('toolbar.save-as-pdf'),
|
||||||
|
defaultUri: vscode.Uri.file(defaultPath),
|
||||||
|
saveLabel: t('info.vcd-viewer.save'),
|
||||||
|
filters: {
|
||||||
|
[t('pdf-file')]: ['pdf'],
|
||||||
|
[t("info.vcd-viewer.all-file")]: ['*']
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (saveUri) {
|
||||||
|
const savePath = saveUri.fsPath;
|
||||||
|
const tempPath = savePath + '.html';
|
||||||
|
fs.writeFileSync(tempPath, html);
|
||||||
|
console.log(option);
|
||||||
|
htmlFile2PdfFile(tempPath, savePath, option);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function exportDocMarkdown(data: any, panel: vscode.WebviewPanel) {
|
||||||
|
try {
|
||||||
|
const { renderStringArray, cssStringArray, filename, option } = data;
|
||||||
|
const renderString = pako.ungzip(renderStringArray, { to: 'string' });
|
||||||
|
const cssString = pako.ungzip(cssStringArray, { to: 'string' });
|
||||||
|
|
||||||
|
console.log('receive renderString size: ' + renderString.length);
|
||||||
|
|
||||||
|
const html = makeDocHtmlFromTemplate(renderString, cssString);
|
||||||
|
|
||||||
|
const defaultFilename = getNameFromFileName(filename) + '.md';
|
||||||
|
const defaultPath = hdlPath.join(opeParam.workspacePath, defaultFilename);
|
||||||
|
const saveUri = await vscode.window.showSaveDialog({
|
||||||
|
title: t('netlist.save-as-markdown'),
|
||||||
|
defaultUri: vscode.Uri.file(defaultPath),
|
||||||
|
saveLabel: t('info.vcd-viewer.save'),
|
||||||
|
filters: {
|
||||||
|
[t('markdown-file')]: ['md'],
|
||||||
|
[t("info.vcd-viewer.all-file")]: ['*']
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (saveUri) {
|
||||||
|
const savePath = saveUri.fsPath;
|
||||||
|
const tempPath = savePath + '.html';
|
||||||
|
fs.writeFileSync(tempPath, html);
|
||||||
|
console.log(option);
|
||||||
|
htmlFile2PdfFile(tempPath, savePath, option);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
|
}
|
@ -1,9 +1,13 @@
|
|||||||
import * as vscode from 'vscode';
|
import * as vscode from 'vscode';
|
||||||
|
import * as fspath from 'path';
|
||||||
|
|
||||||
import { hdlIcon } from "../../hdlFs";
|
import { hdlFile, hdlIcon, hdlPath } from "../../hdlFs";
|
||||||
import { exportCurrentFileDocAsMarkdown, exportProjectDocAsMarkdown } from './markdown';
|
import { exportCurrentFileDocAsMarkdown, exportProjectDocAsMarkdown } from './markdown';
|
||||||
import { exportCurrentFileDocAsHTML, exportProjectDocAsHTML, showDocWebview, makeDocWebview } from './html';
|
import { exportCurrentFileDocAsHTML, exportProjectDocAsHTML, makeDocWebview } from './html';
|
||||||
import { exportCurrentFileDocAsPDF, exportProjectDocAsPDF } from './pdf';
|
import { exportCurrentFileDocAsPDF, exportProjectDocAsPDF } from './pdf';
|
||||||
|
import { downloadSvg, exportDocHtml, exportDocMarkdown, exportDocPdf, getDocIR } from './codedoc';
|
||||||
|
import { opeParam } from '../../global';
|
||||||
|
import { t } from '../../i18n';
|
||||||
|
|
||||||
const availableFormat = [
|
const availableFormat = [
|
||||||
'markdown', 'pdf', 'html'
|
'markdown', 'pdf', 'html'
|
||||||
@ -32,7 +36,7 @@ export interface IDocManagerItem {
|
|||||||
|
|
||||||
export const docManager = new Map<string, IDocManagerItem>();
|
export const docManager = new Map<string, IDocManagerItem>();
|
||||||
|
|
||||||
function registerFileDocExport(context: vscode.ExtensionContext) {
|
export function registerFileDocExport(context: vscode.ExtensionContext) {
|
||||||
vscode.commands.registerCommand('digital-ide.hdlDoc.exportFile', async uri => {
|
vscode.commands.registerCommand('digital-ide.hdlDoc.exportFile', async uri => {
|
||||||
const option = {
|
const option = {
|
||||||
placeHolder: 'Select an Export Format'
|
placeHolder: 'Select an Export Format'
|
||||||
@ -55,7 +59,7 @@ function registerFileDocExport(context: vscode.ExtensionContext) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function registerProjectDocExport(context: vscode.ExtensionContext) {
|
export function registerProjectDocExport(context: vscode.ExtensionContext) {
|
||||||
vscode.commands.registerCommand('digital-ide.hdlDoc.exportProject', async () => {
|
vscode.commands.registerCommand('digital-ide.hdlDoc.exportProject', async () => {
|
||||||
const option = {
|
const option = {
|
||||||
placeHolder: 'Select an Export Format'
|
placeHolder: 'Select an Export Format'
|
||||||
@ -73,9 +77,68 @@ function registerProjectDocExport(context: vscode.ExtensionContext) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export {
|
|
||||||
registerFileDocExport,
|
function getWebviewContent(panel: vscode.WebviewPanel) {
|
||||||
registerProjectDocExport,
|
const netlistPath = hdlPath.join(opeParam.extensionPath, 'resources', 'dide-doc', 'view');
|
||||||
showDocWebview,
|
const htmlIndexPath = hdlPath.join(netlistPath, 'index.html');
|
||||||
makeDocWebview
|
|
||||||
};
|
const html = hdlFile.readFile(htmlIndexPath)?.replace(/(<link.+?href="|<script.+?src="|<img.+?src=")(.+?)"/g, (m, $1, $2) => {
|
||||||
|
const absLocalPath = fspath.resolve(netlistPath, $2);
|
||||||
|
const webviewUri = panel.webview.asWebviewUri(vscode.Uri.file(absLocalPath));
|
||||||
|
const replaceHref = $1 + webviewUri?.toString() + '"';
|
||||||
|
return replaceHref;
|
||||||
|
});
|
||||||
|
return html;
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function showDocWebview(uri: vscode.Uri) {
|
||||||
|
const panel = vscode.window.createWebviewPanel(
|
||||||
|
'CodeDoc',
|
||||||
|
'CodeDoc',
|
||||||
|
vscode.ViewColumn.Two,
|
||||||
|
{
|
||||||
|
enableScripts: true,
|
||||||
|
enableForms: true,
|
||||||
|
retainContextWhenHidden: true
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
panel.iconPath = hdlIcon.getIconConfig('documentation');
|
||||||
|
panel.onDidDispose(() => {});
|
||||||
|
|
||||||
|
const html = getWebviewContent(panel);
|
||||||
|
if (html) {
|
||||||
|
panel.webview.html = html;
|
||||||
|
registerMessageEvent(panel);
|
||||||
|
} else {
|
||||||
|
vscode.window.showErrorMessage(t('dide-doc.error.loading-html'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function registerMessageEvent(panel: vscode.WebviewPanel) {
|
||||||
|
panel.webview.onDidReceiveMessage(message => {
|
||||||
|
const { command, data } = message;
|
||||||
|
|
||||||
|
// TODO: finish this
|
||||||
|
const codeDocIr = {};
|
||||||
|
|
||||||
|
switch (command) {
|
||||||
|
case 'get-doc-ir':
|
||||||
|
getDocIR(data, panel, codeDocIr);
|
||||||
|
break;
|
||||||
|
case 'download-svg':
|
||||||
|
downloadSvg(data, panel);
|
||||||
|
case 'export-doc-html':
|
||||||
|
exportDocHtml(data, panel);
|
||||||
|
break;
|
||||||
|
case 'export-doc-pdf':
|
||||||
|
exportDocPdf(data, panel);
|
||||||
|
break;
|
||||||
|
case 'export-doc-markdown':
|
||||||
|
exportDocMarkdown(data, panel);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
@ -120,10 +120,6 @@ async function generateFilelist(path: AbsPath): Promise<AbsPath[]> {
|
|||||||
pathset.add(path);
|
pathset.add(path);
|
||||||
|
|
||||||
const filelist = [...pathset.files];
|
const filelist = [...pathset.files];
|
||||||
|
|
||||||
console.log(filelist);
|
|
||||||
console.log(opeParam.prjInfo.prjPath);
|
|
||||||
|
|
||||||
return filelist;
|
return filelist;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user