diff --git a/.vscode/settings.json b/.vscode/settings.json index 8a3043b..d0146e9 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,12 +1,10 @@ -// Place your settings in this file to overwrite default and user settings. { "files.exclude": { - "out": false // set this to true to hide the "out" folder with the compiled JS files + "out": false }, "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", "i18n-haru.root": "l10n", "i18n-haru.main": "zh-cn", diff --git a/l10n/bundle.l10n.de.json b/l10n/bundle.l10n.de.json index 8df01b2..e3402b1 100644 --- a/l10n/bundle.l10n.de.json +++ b/l10n/bundle.l10n.de.json @@ -126,5 +126,10 @@ "info.pdf.exporting": "PDF wird nach {0} exportiert", "info.generate-pdf-to": "PDF wurde unter {0} generiert", "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!" } \ No newline at end of file diff --git a/l10n/bundle.l10n.en.json b/l10n/bundle.l10n.en.json index 6e0b938..01da669 100644 --- a/l10n/bundle.l10n.en.json +++ b/l10n/bundle.l10n.en.json @@ -126,5 +126,10 @@ "info.pdf.exporting": "Exporting PDF to {0}", "info.generate-pdf-to": "PDF has been generated to {0}", "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!" } \ No newline at end of file diff --git a/l10n/bundle.l10n.ja.json b/l10n/bundle.l10n.ja.json index ed37dfe..76bbedd 100644 --- a/l10n/bundle.l10n.ja.json +++ b/l10n/bundle.l10n.ja.json @@ -126,5 +126,10 @@ "info.pdf.exporting": "PDFを{0}にエクスポート中", "info.generate-pdf-to": "PDFは{0}に生成されました", "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 リソースの読み込みに失敗しました。インストールディレクトリが破損しています。再インストールしてください!" } \ No newline at end of file diff --git a/l10n/bundle.l10n.zh-cn.json b/l10n/bundle.l10n.zh-cn.json index b327d92..9cd3d42 100644 --- a/l10n/bundle.l10n.zh-cn.json +++ b/l10n/bundle.l10n.zh-cn.json @@ -126,5 +126,10 @@ "info.pdf.exporting": "正在导出 pdf 到 {0}", "info.generate-pdf-to": "pdf 已经生成至 {0}", "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 资源加载失败,安装目录已经损坏,请重新安装!" } \ No newline at end of file diff --git a/l10n/bundle.l10n.zh-tw.json b/l10n/bundle.l10n.zh-tw.json index 8aec2ff..3b29529 100644 --- a/l10n/bundle.l10n.zh-tw.json +++ b/l10n/bundle.l10n.zh-tw.json @@ -126,5 +126,10 @@ "info.pdf.exporting": "正在導出PDF到{0}", "info.generate-pdf-to": "PDF 已生成至 {0}", "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 資源加載失敗,安裝目錄已經損壞,請重新安裝!" } \ No newline at end of file diff --git a/resources/dide-doc/README.md b/resources/dide-doc/README.md new file mode 100644 index 0000000..0fcf892 --- /dev/null +++ b/resources/dide-doc/README.md @@ -0,0 +1,6 @@ +dide-doc + - view + - index.html + - css + - js + - ... \ No newline at end of file diff --git a/resources/dide-doc/iconfont.css b/resources/dide-doc/iconfont.css deleted file mode 100644 index 8b0a030..0000000 --- a/resources/dide-doc/iconfont.css +++ /dev/null @@ -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"; -} - diff --git a/resources/dide-doc/iconfont.woff2 b/resources/dide-doc/iconfont.woff2 deleted file mode 100644 index 6e23383..0000000 Binary files a/resources/dide-doc/iconfont.woff2 and /dev/null differ diff --git a/resources/dide-doc/index.html b/resources/dide-doc/index.html deleted file mode 100644 index cb080a6..0000000 --- a/resources/dide-doc/index.html +++ /dev/null @@ -1,65 +0,0 @@ - - -
- - - -=0&&d[f]<=1&&g.push(d[f]);g.push(1),g.push(0);for(var v,y,m,b=-1,x=0;x t&&(s=t),l0){for(var A=n.pop(),C=0;C=a?m(t,c):0===h?c:x(t,r,r+u)}var E=!1;function T(){E=!0,e===t&&n===r||b()}var _=function(i){return E||T(),e===t&&n===r?i:0===i?0:1===i?1:v(w(i),t,r)};_.getControlPoints=function(){return[{x:e,y:t},{x:n,y:r}]};var A="generateBezier("+[e,t,n,r]+")";return _.toString=function(){return A},_}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var oc=function(){function e(e){return-e.tension*e.x-e.friction*e.v}function t(t,n,r){var i={x:t.x+r.dx*n,v:t.v+r.dv*n,tension:t.tension,friction:t.friction};return{dx:i.v,dv:e(i)}}function n(n,r){var i={dx:n.v,dv:e(n)},a=t(n,.5*r,i),o=t(n,.5*r,a),s=t(n,r,o),l=1/6*(i.dx+2*(a.dx+o.dx)+s.dx),u=1/6*(i.dv+2*(a.dv+o.dv)+s.dv);return n.x=n.x+l*r,n.v=n.v+u*r,n}return function e(t,r,i){var a,o,s,l={x:-1,v:0,tension:null,friction:null},u=[0],c=0,h=1e-4,d=.016;for(t=parseFloat(t)||500,r=parseFloat(r)||20,i=i||null,l.tension=t,l.friction=r,a=null!==i,a?(c=e(t,r),o=c/i*d):o=d;;)if(s=n(s||l,o),u.push(1+s.x),c+=16,!(Math.abs(s.x)>h&&Math.abs(s.v)>h))break;return a?function(e){return u[e*(u.length-1)|0]}:c}}(),sc=function(e,t,n,r){var i=ac(e,t,n,r);return function(e,t,n){return e+(t-e)*i(n)}},lc={linear:function(e,t,n){return e+(t-e)*n},ease:sc(.25,.1,.25,1),"ease-in":sc(.42,0,1,1),"ease-out":sc(0,0,.58,1),"ease-in-out":sc(.42,0,.58,1),"ease-in-sine":sc(.47,0,.745,.715),"ease-out-sine":sc(.39,.575,.565,1),"ease-in-out-sine":sc(.445,.05,.55,.95),"ease-in-quad":sc(.55,.085,.68,.53),"ease-out-quad":sc(.25,.46,.45,.94),"ease-in-out-quad":sc(.455,.03,.515,.955),"ease-in-cubic":sc(.55,.055,.675,.19),"ease-out-cubic":sc(.215,.61,.355,1),"ease-in-out-cubic":sc(.645,.045,.355,1),"ease-in-quart":sc(.895,.03,.685,.22),"ease-out-quart":sc(.165,.84,.44,1),"ease-in-out-quart":sc(.77,0,.175,1),"ease-in-quint":sc(.755,.05,.855,.06),"ease-out-quint":sc(.23,1,.32,1),"ease-in-out-quint":sc(.86,0,.07,1),"ease-in-expo":sc(.95,.05,.795,.035),"ease-out-expo":sc(.19,1,.22,1),"ease-in-out-expo":sc(1,0,0,1),"ease-in-circ":sc(.6,.04,.98,.335),"ease-out-circ":sc(.075,.82,.165,1),"ease-in-out-circ":sc(.785,.135,.15,.86),spring:function(e,t,n){if(0===n)return lc.linear;var r=oc(e,t,n);return function(e,t,n){return e+(t-e)*r(n)}},"cubic-bezier":sc};function uc(e,t,n,r,i){if(1===r)return n;if(t===n)return n;var a=i(t,n,r);return null==e||((e.roundValue||e.color)&&(a=Math.round(a)),void 0!==e.min&&(a=Math.max(a,e.min)),void 0!==e.max&&(a=Math.min(a,e.max))),a}function cc(e,t){return null!=e.pfValue||null!=e.value?null==e.pfValue||null!=t&&"%"===t.type.units?e.value:e.pfValue:e}function hc(e,t,n,r,i){var a=null!=i?i.type:null;n<0?n=0:n>1&&(n=1);var o=cc(e,i),s=cc(t,i);if(S(o)&&S(s))return uc(a,o,s,n,r);if(C(o)&&C(s)){for(var l=[],u=0;u0){var de=c,pe=In(de,Tn(t)),ge=In(de,Tn(he)),fe=pe;if(ge
=u)break;var L=u-A,P=L/_;P=Fn(0,P,1),t=Bn(C,D,P),i=gd(C,D);break}o("labelX",n,t.x),o("labelY",n,t.y),o("labelAutoAngle",n,i)}};u("source"),u("target"),this.applyLabelDimensions(e)}},dd.applyLabelDimensions=function(e){this.applyPrefixedLabelDimensions(e),e.isEdge()&&(this.applyPrefixedLabelDimensions(e,"source"),this.applyPrefixedLabelDimensions(e,"target"))},dd.applyPrefixedLabelDimensions=function(e,t){var n=e._private,r=this.getLabelText(e,t),i=this.calculateLabelDimensions(e,r),a=e.pstyle("line-height").pfValue,o=e.pstyle("text-wrap").strValue,s=qt(n.rscratch,"labelWrapCachedLines",t)||[],l="wrap"!==o?1:Math.max(s.length,1),u=i.height/l,c=u*a,h=i.width,d=i.height+(l-1)*(a-1)*u;$t(n.rstyle,"labelWidth",t,h),$t(n.rscratch,"labelWidth",t,h),$t(n.rstyle,"labelHeight",t,d),$t(n.rscratch,"labelHeight",t,d),$t(n.rscratch,"labelLineHeight",t,c)},dd.getLabelText=function(e,t){var n=e._private,r=t?t+"-":"",i=e.pstyle(r+"label").strValue,a=e.pstyle("text-transform").value,o=function(e,r){return r?($t(n.rscratch,e,t,r),r):qt(n.rscratch,e,t)};if(!i)return"";"none"==a||("uppercase"==a?i=i.toUpperCase():"lowercase"==a&&(i=i.toLowerCase()));var s=e.pstyle("text-wrap").value;if("wrap"===s){var l=o("labelKey");if(null!=l&&o("labelWrapKey")===l)return o("labelWrapCachedText");for(var u="",c=i.split("\n"),h=e.pstyle("text-max-width").pfValue,d=e.pstyle("text-overflow-wrap").value,p="anywhere"===d,g=[],f=/[\s\u200b]+|$/g,y=0;ye&&(r=e),a>t&&(a=t)}return r==i.MAX_VALUE?null:(n=void 0!=o[0].getParent().paddingLeft?o[0].getParent().paddingLeft:this.margin,this.left=a-n,this.top=r-n,new c(this.left,this.top))},d.prototype.updateBounds=function(e){for(var t,n,r,a,o,s=i.MAX_VALUE,l=-i.MAX_VALUE,c=i.MAX_VALUE,h=-i.MAX_VALUE,d=this.nodes,p=d.length,g=0;go)return n[0]=r,n[1]=l,n[2]=a,n[3]=b,!1;if(i
)/).reverse(),a=[],o=1.1,s=n.attr("y"),l=parseFloat(n.attr("dy")),u=n.text(null).append("tspan").attr("x",0).attr("y",s).attr("dy",l+"em");for(let i=0;i
"===e)&&(a.pop(),u.text(a.join(" ").trim()),a="
"===e?[""]:[e],u=n.append("tspan").attr("x",0).attr("y",s).attr("dy",o+"em").text(e))}))}const O=function(e,t,n){const r=5;e.append("path").attr("id","node-"+t.id).attr("class","node-bkg node-"+C(t.type)).attr("d",`M0 ${t.height-r} v${-t.height+2*r} q0,-5 5,-5 h${t.width-2*r} q5,0 5,5 v${t.height-r} H0 Z`),e.append("line").attr("class","node-line-"+n).attr("x1",0).attr("y1",t.height).attr("x2",t.width).attr("y2",t.height)},R=function(e,t){e.append("rect").attr("id","node-"+t.id).attr("class","node-bkg node-"+C(t.type)).attr("height",t.height).attr("width",t.width)},B=function(e,t){const n=t.width,r=t.height,i=.15*n,a=.25*n,o=.35*n,s=.2*n;e.append("path").attr("id","node-"+t.id).attr("class","node-bkg node-"+C(t.type)).attr("d",`M0 0 a${i},${i} 0 0,1 ${.25*n},${-1*n*.1}\n a${o},${o} 1 0,1 ${.4*n},${-1*n*.1}\n a${a},${a} 1 0,1 ${.35*n},${1*n*.2}\n\n a${i},${i} 1 0,1 ${.15*n},${1*r*.35}\n a${s},${s} 1 0,1 ${-1*n*.15},${1*r*.65}\n\n a${a},${i} 1 0,1 ${-1*n*.25},${.15*n}\n a${o},${o} 1 0,1 ${-1*n*.5},0\n a${i},${i} 1 0,1 ${-1*n*.25},${-1*n*.15}\n\n a${i},${i} 1 0,1 ${-1*n*.1},${-1*r*.35}\n a${s},${s} 1 0,1 ${.1*n},${-1*r*.65}\n\n H0 V0 Z`)},F=function(e,t){const n=t.width,r=t.height,i=.15*n;e.append("path").attr("id","node-"+t.id).attr("class","node-bkg node-"+C(t.type)).attr("d",`M0 0 a${i},${i} 1 0,0 ${.25*n},${-1*r*.1}\n a${i},${i} 1 0,0 ${.25*n},0\n a${i},${i} 1 0,0 ${.25*n},0\n a${i},${i} 1 0,0 ${.25*n},${1*r*.1}\n\n a${i},${i} 1 0,0 ${.15*n},${1*r*.33}\n a${.8*i},${.8*i} 1 0,0 0,${1*r*.34}\n a${i},${i} 1 0,0 ${-1*n*.15},${1*r*.33}\n\n a${i},${i} 1 0,0 ${-1*n*.25},${.15*r}\n a${i},${i} 1 0,0 ${-1*n*.25},0\n a${i},${i} 1 0,0 ${-1*n*.25},0\n a${i},${i} 1 0,0 ${-1*n*.25},${-1*r*.15}\n\n a${i},${i} 1 0,0 ${-1*n*.1},${-1*r*.33}\n a${.8*i},${.8*i} 1 0,0 0,${-1*r*.34}\n a${i},${i} 1 0,0 ${.1*n},${-1*r*.33}\n\n H0 V0 Z`)},z=function(e,t){e.append("circle").attr("id","node-"+t.id).attr("class","node-bkg node-"+C(t.type)).attr("r",t.width/2)};function G(e,t,n,r,i){return e.insert("polygon",":first-child").attr("points",r.map((function(e){return e.x+","+e.y})).join(" ")).attr("transform","translate("+(i.width-t)/2+", "+n+")")}const V=function(e,t){const n=t.height,r=4,i=n/r,a=t.width-t.padding+2*i,o=[{x:i,y:0},{x:a-i,y:0},{x:a,y:-n/2},{x:a-i,y:-n},{x:i,y:-n},{x:0,y:-n/2}];G(e,a,n,o,t)},X=function(e,t){e.append("rect").attr("id","node-"+t.id).attr("class","node-bkg node-"+C(t.type)).attr("height",t.height).attr("rx",t.padding).attr("ry",t.padding).attr("width",t.width)},Y=function(e,t,n,r){const i=n%(I-1),a=e.append("g");t.section=i;let o="section-"+i;i<0&&(o+=" section-root"),a.attr("class",(t.class?t.class+" ":"")+"mindmap-node "+o);const s=a.append("g"),l=a.append("g"),u=l.append("text").text(t.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(M,t.width),c=u.node().getBBox(),h=r.fontSize.replace?r.fontSize.replace("px",""):r.fontSize;if(t.height=c.height+1.1*h*.5+t.padding,t.width=c.width+2*t.padding,t.icon)if(t.type===E.CIRCLE){t.height+=50,t.width+=50;const e=a.append("foreignObject").attr("height","50px").attr("width",t.width).attr("style","text-align: center;");e.append("div").attr("class","icon-container").append("i").attr("class","node-icon-"+i+" "+t.icon),l.attr("transform","translate("+t.width/2+", "+(t.height/2-1.5*t.padding)+")")}else{t.width+=50;const e=t.height;t.height=Math.max(e,60);const n=Math.abs(t.height-e),r=a.append("foreignObject").attr("width","60px").attr("height",t.height).attr("style","text-align: center;margin-top:"+n/2+"px;");r.append("div").attr("class","icon-container").append("i").attr("class","node-icon-"+i+" "+t.icon),l.attr("transform","translate("+(25+t.width/2)+", "+(n/2+t.padding/2)+")")}else l.attr("transform","translate("+t.width/2+", "+t.padding/2+")");switch(t.type){case E.DEFAULT:O(s,t,i);break;case E.ROUNDED_RECT:X(s,t);break;case E.RECT:R(s,t);break;case E.CIRCLE:s.attr("transform","translate("+t.width/2+", "+ +t.height/2+")"),z(s,t);break;case E.CLOUD:B(s,t);break;case E.BANG:F(s,t);break;case E.HEXAGON:V(s,t);break}return _(t.id,a),t.height},U=function(e,t,n,r,i){const a=i%(I-1),o=n.x+n.width/2,s=n.y+n.height/2,l=t.x+t.width/2,u=t.y+t.height/2,c=l>o?o+Math.abs(o-l)/2:o-Math.abs(o-l)/2,h=u>s?s+Math.abs(s-u)/2:s-Math.abs(s-u)/2,d=l>o?Math.abs(o-c)/2+o:-Math.abs(o-c)/2+o,p=u>s?Math.abs(s-h)/2+s:-Math.abs(s-h)/2+s;e.append("path").attr("d","TB"===n.direction||"BT"===n.direction?`M${o},${s} Q${o},${p} ${c},${h} T${l},${u}`:`M${o},${s} Q${d},${s} ${c},${h} T${l},${u}`).attr("class","edge section-edge-"+a+" edge-depth-"+r)},W=function(e){const t=L(e.id),n=e.x||0,r=e.y||0;t.attr("transform","translate("+n+","+r+")")},j={drawNode:Y,positionNode:W,drawEdge:U};function H(e,t,n,r){j.drawNode(e,t,n,r),t.children&&t.children.forEach(((t,i)=>{H(e,t,n<0?i:n,r)}))}function q(e,t){t.edges().map(((t,n)=>{const i=t.data();if(t[0]._private.bodyBounds){const a=t[0]._private.rscratch;r.l.trace("Edge: ",n,i),e.insert("path").attr("d",`M ${a.startX},${a.startY} L ${a.midX},${a.midY} L${a.endX},${a.endY} `).attr("class","edge section-edge-"+i.section+" edge-depth-"+i.depth)}}))}function $(e,t,n,r){t.add({group:"nodes",data:{id:e.id,labelText:e.descr,height:e.height,width:e.width,level:r,nodeId:e.id,padding:e.padding,type:e.type},position:{x:e.x,y:e.y}}),e.children&&e.children.forEach((i=>{$(i,t,n,r+1),t.add({group:"edges",data:{id:`${e.id}_${i.id}`,source:e.id,target:i.id,depth:r,section:i.section}})}))}function K(e,t){return new Promise((n=>{const a=(0,i.Ltv)("body").append("div").attr("id","cy").attr("style","display:none"),s=o()({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});a.remove(),$(e,s,t,0),s.nodes().forEach((function(e){e.layoutDimensions=()=>{const t=e.data();return{w:t.width,h:t.height}}})),s.layout({name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1}).run(),s.ready((e=>{r.l.info("Ready",e),n(s)}))}))}function Z(e){e.nodes().map(((e,t)=>{const n=e.data();n.x=e.position().x,n.y=e.position().y,j.positionNode(n);const i=L(n.nodeId);r.l.info("Id:",t,"Position: (",e.position().x,", ",e.position().y,")",n),i.attr("transform",`translate(${e.position().x-n.width/2}, ${e.position().y-n.height/2})`),i.attr("attr",`apa-${t})`)}))}o().use(l());const Q=async(e,t,n,a)=>{const o=(0,r.g)();a.db.clear(),a.parser.parse(e),r.l.debug("Renering info diagram\n"+e);const s=(0,r.g)().securityLevel;let l;"sandbox"===s&&(l=(0,i.Ltv)("#i"+t));const u="sandbox"===s?(0,i.Ltv)(l.nodes()[0].contentDocument.body):(0,i.Ltv)("body"),c=u.select("#"+t);c.append("g");const h=a.db.getMindmap(),d=c.append("g");d.attr("class","mindmap-edges");const p=c.append("g");p.attr("class","mindmap-nodes"),H(p,h,-1,o);const g=await K(h,o);q(d,g),Z(g),(0,r.s)(void 0,c,o.mindmap.padding,o.mindmap.useMaxWidth)},J={draw:Q},ee=e=>{let t="";for(let n=0;n