spec-up-t 1.0.40 → 1.0.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/compiled/body.js +4 -4
- package/assets/compiled/head.css +1 -1
- package/assets/css/index.css +14 -3
- package/assets/js/pdf-download.js +1 -1
- package/assets/js/search.js +1 -5
- package/assets/js/show-commit-hashes.js +9 -3
- package/index.js +2 -7
- package/package.json +2 -1
- package/src/create-pdf.js +108 -6
- package/src/json-key-validator.js +34 -8
- package/templates/template.html +1 -0
package/assets/compiled/body.js
CHANGED
|
@@ -88,11 +88,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
88
88
|
* @since 2024-06-09
|
|
89
89
|
*/
|
|
90
90
|
function editTermButtons(){const t=((e=specConfig.spec_directory).startsWith("./")?e=e.substring(2):e.startsWith("/")&&(e=e.substring(1)),e.endsWith("/")&&(e=e.slice(0,-1)),e);var e;document.querySelectorAll('dt:has(> span[id^="term:"])').forEach(e=>{const n=function(t){let e=t;for(;e.querySelector('span[id^="term:"]');)e=e.querySelector('span[id^="term:"]');return e}(e),s=n.getAttribute("id").split(":")[1];n.innerHTML+=`<span class="edit-term-buttons"><a title="Link to the term file in the Github repo in a new tab" target="_blank" rel="noopener" href="https://github.com/${specConfig.source.account}/${specConfig.source.repo}/blob/main/${t}/${specConfig.spec_terms_directory}/${s}.md" class="edit-term-button btn">🖊️</a><a title="Link to a GitHub page that shows a history of the edits in a new tab" target="_blank" rel="noopener" href="https://github.com/${specConfig.source.account}/${specConfig.source.repo}/commits/main/${t}/${specConfig.spec_terms_directory}/${s}.md" class="history-term-button btn">📅</a></span>`})}document.addEventListener("DOMContentLoaded",(function(){editTermButtons()}));
|
|
91
|
-
function inPageSearch(){const e=document.querySelector("span[issue-count]"),t=specConfig.searchHighlightStyle||"ssi",n="search-h7vc6omi2hr2880",i=document.querySelector("main article");let c=document.createElement("div");c.setAttribute("id","container-"+n),c.setAttribute("class","container-"+n),e.after(c);let o=document.createElement("input");o.setAttribute("type","text"),o.setAttribute("id",n),o.setAttribute("placeholder","🔍"),c.appendChild(o),setTimeout(()=>{o.focus()},1e3);const
|
|
91
|
+
function inPageSearch(){const e=document.querySelector("span[issue-count]"),t=specConfig.searchHighlightStyle||"ssi",n="search-h7vc6omi2hr2880",i=document.querySelector("main article");let c=document.createElement("div");c.setAttribute("id","container-"+n),c.setAttribute("class","container-"+n),e.after(c);let o=document.createElement("input");o.setAttribute("type","text"),o.setAttribute("id",n),o.setAttribute("placeholder","🔍"),c.appendChild(o),setTimeout(()=>{o.focus()},1e3);const s=document.createElement("div");s.setAttribute("id","back-and-forth-buttons-container-"+n);const r=document.createElement("button");r.setAttribute("id","one-match-backward-"+n),r.setAttribute("disabled","disabled"),r.setAttribute("title","Go to previous match. Shortcut key: Left Arrow"),r.textContent="▲",s.appendChild(r);const a=document.createElement("button");a.setAttribute("id","one-match-forward-"+n),a.setAttribute("disabled","disabled"),a.setAttribute("title","Go to next match. Shortcut key: Right Arrow"),a.textContent="▼",s.appendChild(a),c.appendChild(s);const d=document.createElement("span");d.setAttribute("id","total-matches-"+n),d.innerHTML="0 matches",c.appendChild(d),o.addEventListener("input",(function(){g(o.value)})),document.addEventListener("click",e=>{e.target.classList.contains("collapse-all-defs-button")&&g(o.value)});const l="highlight-matches-"+n,h={dif:"highlight-matches-DIF-search-h7vc6omi2hr2880",toip:"highlight-matches-ToIP-search-h7vc6omi2hr2880",btc:"highlight-matches-BTC-search-h7vc6omi2hr2880",keri:"highlight-matches-KERI-search-h7vc6omi2hr2880",ssi:"highlight-matches-SSI-search-h7vc6omi2hr2880",gleif:"highlight-matches-GLEIF-search-h7vc6omi2hr2880"}[t.toLowerCase()];let u=0,m=-1;function b(e){e.scrollIntoView({behavior:"smooth",block:"start"});const t=e.getBoundingClientRect(),n=t.top+window.pageYOffset-(window.innerHeight-t.height)/2;window.scrollTo({top:n,behavior:"smooth"})}function p(){m<=0?document.getElementById("one-match-backward-"+n).setAttribute("disabled","disabled"):document.getElementById("one-match-backward-"+n).removeAttribute("disabled"),m>=u-1?document.getElementById("one-match-forward-"+n).setAttribute("disabled","disabled"):document.getElementById("one-match-forward-"+n).removeAttribute("disabled")}function f(){d.innerHTML=u+" matches"}const g=function(e,t){let n;return function(){const i=this,c=arguments;clearTimeout(n),n=setTimeout(()=>e.apply(i,c),t)}}((function(e){if(function(){document.querySelectorAll("span."+l).forEach(e=>{Array.from(e.childNodes).forEach(t=>{t.nodeType===Node.ELEMENT_NODE&&e.removeChild(t)}),e.classList.contains(l)&&(e.outerHTML=e.innerHTML)})}(),u=0,m=-1,""===e)return void f();let t=0;!function i(c){if(3!==c.nodeType||function(e){for(;e;){if(e.classList&&e.classList.contains("hidden"))return!0;e=e.parentNode}return!1}(c))1===c.nodeType&&Array.from(c.childNodes).forEach(i);else{const i=function(i){const c=i.nodeValue,o=new RegExp(e,"gi");let s,r=0,a=document.createDocumentFragment();for(;null!==(s=o.exec(c));){a.appendChild(document.createTextNode(c.substring(r,s.index)));const e=document.createElement("span");e.textContent=s[0],e.classList.add(l),e.classList.add(h),e.setAttribute("id",n+"-"+t),a.appendChild(e),u=t+1,t++,r=s.index+s[0].length}return a.appendChild(document.createTextNode(c.substring(r))),a}(c);i.childNodes.length>1&&c.parentNode.replaceChild(i,c)}}(i);let c=document.querySelector("."+h);null!==c&&b(c);f(),p(),m=-1}),600);r.addEventListener("click",(function(){m--;const e=document.querySelector("#"+n+"-"+m);e&&b(e),e.classList.add("active"),setTimeout(()=>{e.classList.remove("active")},3e3),p()})),a.addEventListener("click",(function(){m++;const e=document.querySelector("#"+n+"-"+m);e&&b(e),e.classList.add("active"),setTimeout(()=>{e.classList.remove("active")},3e3),p()})),document.addEventListener("keyup",e=>{switch(e.key){case"ArrowRight":a.click();break;case"ArrowLeft":r.click()}})}document.addEventListener("DOMContentLoaded",(function(){inPageSearch()}));
|
|
92
92
|
function highlightMenuItems(){let t=null;function e(t){document.querySelectorAll("#toc_list a").forEach(t=>{t.classList.remove("highlight-cfib41dyhcd99sm")});const e=document.querySelector(`#toc_list a[href="#${t.id}"]`);e&&(e.classList.add("highlight-cfib41dyhcd99sm"),e.scrollIntoView({behavior:"smooth",block:"center"}))}const o=new IntersectionObserver((o,n)=>{const c=o.filter(t=>t.isIntersecting).map(t=>t.target);c.length>0?(t=c[0],e(t)):t&&e(t)},{root:null,rootMargin:"0px",threshold:.1});document.querySelectorAll("h2, h3, h4, h5, h6").forEach(t=>o.observe(t))}document.addEventListener("DOMContentLoaded",(function(){highlightMenuItems()}));
|
|
93
93
|
function backToTop(){const n=document.createElement("a");n.id="back-to-top-a1zncgtqfpzsig8",n.href="#content",n.innerHTML="↑",document.body.appendChild(n);const t=function(n,t){let e;return function(){const o=this,c=arguments;clearTimeout(e),e=setTimeout(()=>n.apply(o,c),t)}}((function(){window.scrollY>300?n.style.display="flex":n.style.display="none"}),600);window.addEventListener("scroll",(function(){t()}))}document.addEventListener("DOMContentLoaded",(function(){backToTop()}));
|
|
94
94
|
/**
|
|
95
|
-
* @file This file fetches and displays commit hashes by matching elements with `
|
|
95
|
+
* @file This file fetches and displays commit hashes by matching elements with `x-term-reference` class against the `allXrefs` global object.
|
|
96
96
|
* Example:
|
|
97
97
|
* const allXrefs = {
|
|
98
98
|
"xrefs": [
|
|
@@ -117,13 +117,13 @@ function backToTop(){const n=document.createElement("a");n.id="back-to-top-a1znc
|
|
|
117
117
|
* @license MIT
|
|
118
118
|
* @since 2024-06-09
|
|
119
119
|
*/
|
|
120
|
-
function fetchCommitHashes(){const e=localStorage.getItem("githubToken");const t=function(e,t){let n;return function(...o){clearTimeout(n),n=setTimeout(()=>e.apply(this,o),t)}}(()=>{notyf.error('GitHub rate limit exceeded. See <a target="_blank" rel="noopener" href="https://blockchainbird.github.io/spec-up-t-website/docs/github-token/">documentation</a> for more info.')},3e3);document.querySelectorAll(".x-term-reference").forEach(n=>{const o=n.getAttribute("data-local-href").split(":");allXrefs.xrefs.forEach(r=>{if(r.externalSpec===o[1]&&r.term.toLowerCase()===o[2].toLowerCase()){if(!r.commitHash){const e=document.createElement("span");return e.classList.add("no-xref-found-message"),e.innerHTML="No xref found.",void n.parentNode.insertBefore(e,n.nextSibling)}r.commitHash&&r.commitHash&&r.commitHash.substring(0,7);const o=document.createElement("a");o.href="https://github.com/"+r.owner+"/"+r.repo+"/compare/"+r.commitHash+"../main",o.target="_blank",o.rel="noopener noreferrer",o.classList.add("diff","xref-info-links","btn"),o.innerHTML='<svg icon><use xlink:href="#svg-github"></use></svg> Xref < > <svg icon><use xlink:href="#svg-github"></use></svg> Now',o.title="A Diff between the current commit hash of the definition and the commit hash referenced when the link was created.",n.parentNode.insertBefore(o,n.nextSibling);const i=document.createElement("a");i.href="https://github.com/"+r.owner+"/"+r.repo+"/blob/main/"+r.terms_dir+"/"+r.term.replace(/ /g,"-").toLowerCase()+".md",i.target="_blank",i.rel="noopener noreferrer",i.classList.add("latest-version","xref-info-links","btn"),i.innerHTML='<svg icon><use xlink:href="#svg-github"></use></svg> Now',i.title="Go to the repo page of the definition‘s latest version.",o.parentNode.insertBefore(i,n.nextSibling);const s=document.createElement("a");s.href="https://github.com/"+r.owner+"/"+r.repo+"/blob/"+r.commitHash+"/"+r.terms_dir+"/"+r.term.replace(/ /g,"-").toLowerCase()+".md",s.target="_blank",s.rel="noopener noreferrer",s.classList.add("exact-commit-hash","xref-info-links","btn"),s.innerHTML='<svg icon><use xlink:href="#svg-github"></use></svg> Xref',s.title="Go to the repo page of the definition‘s version referenced when the link was created.",i.parentNode.insertBefore(s,n.nextSibling);const a=document.createElement("button");a.classList.add("show-diff-modal","xref-info-links","btn"),a.innerHTML='Xref < > <svg icon><use xlink:href="#svg-github"></use></svg> Now',a.title="Show diff between the latest version and the referenced version",i.parentNode.insertBefore(a,n.nextSibling),a.addEventListener("click",(function(n){n.preventDefault(),function(e,n){const o={};e&&e.length>0&&(o.Authorization="token "+e),fetch("https://api.github.com/repos/"+n.owner+"/"+n.repo+"/contents/"+n.terms_dir+"/"+n.term.replace(/ /g,"-").toLowerCase()+".md",{headers:o}).then(e=>{if(403===e.status&&"0"===e.headers.get("X-RateLimit-Remaining")){const n=new Date(1e3*e.headers.get("X-RateLimit-Reset"));return console.error(`\n SPEC-UP-T: Github API rate limit exceeded. Try again after ${n}. See https://blockchainbird.github.io/spec-up-t-website/docs/github-token/ for more info.\n`),t(),!0}return console.log(`\n SPEC-UP-T: Github API rate limit: ${e.headers.get("X-RateLimit-Remaining")} requests remaining. See https://blockchainbird.github.io/spec-up-t-website/docs/github-token/ for more info.\n`),e.json()}).then(e=>{const t=atob(e.content),o=Diff.diffChars(n.content,t),r=document.createDocumentFragment();o.forEach(e=>{const t=e.added?"green":e.removed?"red":"grey",n=e.added||e.removed?"#ddd":"white";span=document.createElement("span"),span.style.color=t,span.style.backgroundColor=n,span.appendChild(document.createTextNode(e.value)),r.appendChild(span)});const i=document.createElement("div");i.innerHTML="<h1>Diff xref (local snapshot) and latest version</h1>",i.appendChild(r),i.innerHTML=i.innerHTML.replace(/\n/g,"<br>"),showModal(i.innerHTML)}).catch(e=>{console.error("Error fetching content:",e)})}(e,r)}));const c=document.createElement("button");c.classList.add("show-diff-modal","xref-info-links","btn"),c.innerHTML="Xref",c.title="Show the stored version of the term-file",a.parentNode.insertBefore(c,n.nextSibling),c.addEventListener("click",(function(e){e.preventDefault();const t=r.content.replace(/\n/g,"<br>");showModal(`\n <h1>Term definition (local snapshot)</h1>\n <table>\n <tr>\n <th>Commit hash</th>\n <td>${r.commitHash}</td>\n </tr>\n <tr>\n <th>Content</th>\n <td>${t}</td>\n </tr>\n </table>\n `)}))}})})}document.addEventListener("DOMContentLoaded",(function(){fetchCommitHashes()}));
|
|
120
|
+
function fetchCommitHashes(){if("undefined"==typeof allXrefs||null===allXrefs)return void console.log("allXrefs is not defined or does not exist. We will continue without it.");const e=localStorage.getItem("githubToken");const t=function(e,t){let n;return function(...o){clearTimeout(n),n=setTimeout(()=>e.apply(this,o),t)}}(()=>{notyf.error('GitHub rate limit exceeded. See <a target="_blank" rel="noopener" href="https://blockchainbird.github.io/spec-up-t-website/docs/github-token/">documentation</a> for more info.')},3e3);document.querySelectorAll(".x-term-reference").forEach(n=>{const o=n.getAttribute("data-local-href").split(":");allXrefs.xrefs.forEach(r=>{if(r.externalSpec===o[1]&&r.term.toLowerCase()===o[2].toLowerCase()){if(!r.commitHash){const e=document.createElement("span");return e.classList.add("no-xref-found-message"),e.innerHTML="No xref found.",void n.parentNode.insertBefore(e,n.nextSibling)}r.commitHash&&r.commitHash&&r.commitHash.substring(0,7);const o=document.createElement("a");o.href="https://github.com/"+r.owner+"/"+r.repo+"/compare/"+r.commitHash+"../main",o.target="_blank",o.rel="noopener noreferrer",o.classList.add("diff","xref-info-links","btn"),o.innerHTML='<svg icon><use xlink:href="#svg-github"></use></svg> Xref < > <svg icon><use xlink:href="#svg-github"></use></svg> Now',o.title="A Diff between the current commit hash of the definition and the commit hash referenced when the link was created.",n.parentNode.insertBefore(o,n.nextSibling);const i=document.createElement("a");i.href="https://github.com/"+r.owner+"/"+r.repo+"/blob/main/"+r.terms_dir+"/"+r.term.replace(/ /g,"-").toLowerCase()+".md",i.target="_blank",i.rel="noopener noreferrer",i.classList.add("latest-version","xref-info-links","btn"),i.innerHTML='<svg icon><use xlink:href="#svg-github"></use></svg> Now',i.title="Go to the repo page of the definition‘s latest version.",o.parentNode.insertBefore(i,n.nextSibling);const s=document.createElement("a");s.href="https://github.com/"+r.owner+"/"+r.repo+"/blob/"+r.commitHash+"/"+r.terms_dir+"/"+r.term.replace(/ /g,"-").toLowerCase()+".md",s.target="_blank",s.rel="noopener noreferrer",s.classList.add("exact-commit-hash","xref-info-links","btn"),s.innerHTML='<svg icon><use xlink:href="#svg-github"></use></svg> Xref',s.title="Go to the repo page of the definition‘s version referenced when the link was created.",i.parentNode.insertBefore(s,n.nextSibling);const a=document.createElement("button");a.classList.add("show-diff-modal","xref-info-links","btn"),a.innerHTML='Xref < > <svg icon><use xlink:href="#svg-github"></use></svg> Now',a.title="Show diff between the latest version and the referenced version",i.parentNode.insertBefore(a,n.nextSibling),a.addEventListener("click",(function(n){n.preventDefault(),function(e,n){const o={};e&&e.length>0&&(o.Authorization="token "+e),fetch("https://api.github.com/repos/"+n.owner+"/"+n.repo+"/contents/"+n.terms_dir+"/"+n.term.replace(/ /g,"-").toLowerCase()+".md",{headers:o}).then(e=>{if(403===e.status&&"0"===e.headers.get("X-RateLimit-Remaining")){const n=new Date(1e3*e.headers.get("X-RateLimit-Reset"));return console.error(`\n SPEC-UP-T: Github API rate limit exceeded. Try again after ${n}. See https://blockchainbird.github.io/spec-up-t-website/docs/github-token/ for more info.\n`),t(),!0}return console.log(`\n SPEC-UP-T: Github API rate limit: ${e.headers.get("X-RateLimit-Remaining")} requests remaining. See https://blockchainbird.github.io/spec-up-t-website/docs/github-token/ for more info.\n`),e.json()}).then(e=>{const t=atob(e.content),o=Diff.diffChars(n.content,t),r=document.createDocumentFragment();o.forEach(e=>{const t=e.added?"green":e.removed?"red":"grey",n=e.added||e.removed?"#ddd":"white";span=document.createElement("span"),span.style.color=t,span.style.backgroundColor=n,span.appendChild(document.createTextNode(e.value)),r.appendChild(span)});const i=document.createElement("div");i.innerHTML="<h1>Diff xref (local snapshot) and latest version</h1>",i.appendChild(r),i.innerHTML=i.innerHTML.replace(/\n/g,"<br>"),showModal(i.innerHTML)}).catch(e=>{console.error("Error fetching content:",e)})}(e,r)}));const c=document.createElement("button");c.classList.add("show-diff-modal","xref-info-links","btn"),c.innerHTML="Xref",c.title="Show the stored version of the term-file",a.parentNode.insertBefore(c,n.nextSibling),c.addEventListener("click",(function(e){e.preventDefault();const t=r.content.replace(/\n/g,"<br>");showModal(`\n <h1>Term definition (local snapshot)</h1>\n <table>\n <tr>\n <th>Commit hash</th>\n <td>${r.commitHash}</td>\n </tr>\n <tr>\n <th>Content</th>\n <td>${t}</td>\n </tr>\n </table>\n `)}))}})})}document.addEventListener("DOMContentLoaded",(function(){fetchCommitHashes()}));
|
|
121
121
|
function addAnchorsToTerms(){document.querySelectorAll('dt:has(> span[id^="term:"])').forEach(e=>{const t=function(e){let t=e;for(;t.querySelector('span[id^="term:"]');)t=t.querySelector('span[id^="term:"]');return t}(e),r=t.getAttribute("id"),n=document.createElement("a");n.setAttribute("href","#"+r),n.setAttribute("class","toc-anchor"),n.innerHTML="# ",t.parentNode.insertBefore(n,t)})}document.addEventListener("DOMContentLoaded",(function(){addAnchorsToTerms()}));
|
|
122
122
|
function copyAnchorToCliboard(){document.addEventListener("click",(function(o){if(o.target.classList.contains("toc-anchor")){const c=o.target.href;navigator.clipboard.writeText(c).then(()=>{console.log("Anchor copied to clipboard"),notyf.success("Anchor copied to clipboard: "+c)}).catch(o=>{console.error("Failed to copy anchor to clipboard",o)})}}))}document.addEventListener("DOMContentLoaded",(function(){copyAnchorToCliboard()}));
|
|
123
123
|
var Notyf=function(){"use strict";var t,i=function(){return(i=Object.assign||function(t){for(var i,e=1,n=arguments.length;e<n;e++)for(var o in i=arguments[e])Object.prototype.hasOwnProperty.call(i,o)&&(t[o]=i[o]);return t}).apply(this,arguments)},e=(n.prototype.on=function(t,i){var e=this.listeners[t]||[];this.listeners[t]=e.concat([i])},n.prototype.triggerEvent=function(t,i){var e=this;(this.listeners[t]||[]).forEach((function(t){return t({target:e,event:i})}))},n);function n(t){this.options=t,this.listeners={}}(s=t=t||{})[s.Add=0]="Add",s[s.Remove=1]="Remove";var o,s,a=(r.prototype.push=function(i){this.notifications.push(i),this.updateFn(i,t.Add,this.notifications)},r.prototype.splice=function(i,e){return e=this.notifications.splice(i,e)[0],this.updateFn(e,t.Remove,this.notifications),e},r.prototype.indexOf=function(t){return this.notifications.indexOf(t)},r.prototype.onUpdate=function(t){this.updateFn=t},r);function r(){this.notifications=[]}(s=o=o||{}).Dismiss="dismiss";var c={types:[{type:"success",className:"notyf__toast--success",backgroundColor:"#3dc763",icon:{className:"notyf__icon--success",tagName:"i"}},{type:"error",className:"notyf__toast--error",backgroundColor:"#ed3d3d",icon:{className:"notyf__icon--error",tagName:"i"}}],duration:2e3,ripple:!0,position:{x:"right",y:"bottom"},dismissible:!(s.Click="click")},p=(d.prototype.on=function(t,e){var n;this.events=i(i({},this.events),((n={})[t]=e,n))},d.prototype.update=function(i,e){e===t.Add?this.addNotification(i):e===t.Remove&&this.removeNotification(i)},d.prototype.removeNotification=function(t){var i,e,n=this;(t=this._popRenderedNotification(t))&&((e=t.node).classList.add("notyf__toast--disappear"),e.addEventListener(this.animationEndEventName,i=function(t){t.target===e&&(e.removeEventListener(n.animationEndEventName,i),n.container.removeChild(e))}))},d.prototype.addNotification=function(t){var i=this._renderNotification(t);this.notifications.push({notification:t,node:i}),this._announce(t.options.message||"Notification")},d.prototype._renderNotification=function(t){var i=this._buildNotificationCard(t),e=t.options.className;return e&&(t=i.classList).add.apply(t,e.split(" ")),this.container.appendChild(i),i},d.prototype._popRenderedNotification=function(t){for(var i=-1,e=0;e<this.notifications.length&&i<0;e++)this.notifications[e].notification===t&&(i=e);if(-1!==i)return this.notifications.splice(i,1)[0]},d.prototype.getXPosition=function(t){return(null===(t=null==t?void 0:t.position)||void 0===t?void 0:t.x)||"right"},d.prototype.getYPosition=function(t){return(null===(t=null==t?void 0:t.position)||void 0===t?void 0:t.y)||"bottom"},d.prototype.adjustContainerAlignment=function(t){var i=this.X_POSITION_FLEX_MAP[this.getXPosition(t)],e=this.Y_POSITION_FLEX_MAP[this.getYPosition(t)];(t=this.container.style).setProperty("justify-content",e),t.setProperty("align-items",i)},d.prototype._buildNotificationCard=function(t){var i=this,e=t.options,n=e.icon;this.adjustContainerAlignment(e);var s=this._createHTMLElement({tagName:"div",className:"notyf__toast"}),a=this._createHTMLElement({tagName:"div",className:"notyf__ripple"}),r=this._createHTMLElement({tagName:"div",className:"notyf__wrapper"}),c=this._createHTMLElement({tagName:"div",className:"notyf__message"});c.innerHTML=e.message||"";var p,d,l,u,f=e.background||e.backgroundColor;return n&&(p=this._createHTMLElement({tagName:"div",className:"notyf__icon"}),("string"==typeof n||n instanceof String)&&(p.innerHTML=new String(n).valueOf()),"object"==typeof n&&(d=n.tagName,l=n.className,u=n.text,n=void 0===(n=n.color)?f:n,u=this._createHTMLElement({tagName:void 0===d?"i":d,className:l,text:u}),n&&(u.style.color=n),p.appendChild(u)),r.appendChild(p)),r.appendChild(c),s.appendChild(r),f&&(e.ripple?(a.style.background=f,s.appendChild(a)):s.style.background=f),e.dismissible&&(a=this._createHTMLElement({tagName:"div",className:"notyf__dismiss"}),f=this._createHTMLElement({tagName:"button",className:"notyf__dismiss-btn"}),a.appendChild(f),r.appendChild(a),s.classList.add("notyf__toast--dismissible"),f.addEventListener("click",(function(e){var n,s;null!==(s=(n=i.events)[o.Dismiss])&&void 0!==s&&s.call(n,{target:t,event:e}),e.stopPropagation()}))),s.addEventListener("click",(function(e){var n,s;return null===(s=(n=i.events)[o.Click])||void 0===s?void 0:s.call(n,{target:t,event:e})})),e="top"===this.getYPosition(e)?"upper":"lower",s.classList.add("notyf__toast--"+e),s},d.prototype._createHTMLElement=function(t){var i=t.tagName,e=t.className;t=t.text,i=document.createElement(i);return e&&(i.className=e),i.textContent=t||null,i},d.prototype._createA11yContainer=function(){var t=this._createHTMLElement({tagName:"div",className:"notyf-announcer"});t.setAttribute("aria-atomic","true"),t.setAttribute("aria-live","polite"),t.style.border="0",t.style.clip="rect(0 0 0 0)",t.style.height="1px",t.style.margin="-1px",t.style.overflow="hidden",t.style.padding="0",t.style.position="absolute",t.style.width="1px",t.style.outline="0",document.body.appendChild(t),this.a11yContainer=t},d.prototype._announce=function(t){var i=this;this.a11yContainer.textContent="",setTimeout((function(){i.a11yContainer.textContent=t}),100)},d.prototype._getAnimationEndEventName=function(){var t,i=document.createElement("_fake"),e={MozTransition:"animationend",OTransition:"oAnimationEnd",WebkitTransition:"webkitAnimationEnd",transition:"animationend"};for(t in e)if(void 0!==i.style[t])return e[t];return"animationend"},d);function d(){this.notifications=[],this.events={},this.X_POSITION_FLEX_MAP={left:"flex-start",center:"center",right:"flex-end"},this.Y_POSITION_FLEX_MAP={top:"flex-start",center:"center",bottom:"flex-end"};var t=document.createDocumentFragment(),i=this._createHTMLElement({tagName:"div",className:"notyf"});t.appendChild(i),document.body.appendChild(t),this.container=i,this.animationEndEventName=this._getAnimationEndEventName(),this._createA11yContainer()}function l(t){var e=this;this.dismiss=this._removeNotification,this.notifications=new a,this.view=new p;var n=this.registerTypes(t);this.options=i(i({},c),t),this.options.types=n,this.notifications.onUpdate((function(t,i){return e.view.update(t,i)})),this.view.on(o.Dismiss,(function(t){var i=t.target;t=t.event;e._removeNotification(i),i.triggerEvent(o.Dismiss,t)})),this.view.on(o.Click,(function(t){var i=t.target;t=t.event;return i.triggerEvent(o.Click,t)}))}return l.prototype.error=function(t){return t=this.normalizeOptions("error",t),this.open(t)},l.prototype.success=function(t){return t=this.normalizeOptions("success",t),this.open(t)},l.prototype.open=function(t){var n=this.options.types.find((function(i){return i.type===t.type}))||{};n=i(i({},n),t);return this.assignProps(["ripple","position","dismissible"],n),n=new e(n),this._pushNotification(n),n},l.prototype.dismissAll=function(){for(;this.notifications.splice(0,1););},l.prototype.assignProps=function(t,i){var e=this;t.forEach((function(t){i[t]=(null==i[t]?e.options:i)[t]}))},l.prototype._pushNotification=function(t){var i=this;this.notifications.push(t);var e=(void 0!==t.options.duration?t:this).options.duration;e&&setTimeout((function(){return i._removeNotification(t)}),e)},l.prototype._removeNotification=function(t){-1!==(t=this.notifications.indexOf(t))&&this.notifications.splice(t,1)},l.prototype.normalizeOptions=function(t,e){return t={type:t},"string"==typeof e?t.message=e:"object"==typeof e&&(t=i(i({},t),e)),t},l.prototype.registerTypes=function(t){var e=(t&&t.types||[]).slice();return c.types.map((function(t){var n=-1;e.forEach((function(i,e){i.type===t.type&&(n=e)}));var o=-1!==n?e.splice(n,1)[0]:{};return i(i({},t),o)})).concat(e)},l}(),notyf=new Notyf({types:[{type:"success",background:"#1D6DAE",duration:3e3},{type:"error",background:"orange",duration:1e7,dismissible:!0}]});
|
|
124
124
|
function showModal(e){const n=document.createElement("div");n.className="modal-overlay";const o=document.createElement("div");o.className="modal";const c=document.createElement("button");function t(){document.body.removeChild(n)}c.className="modal-close",c.innerHTML="×",c.onclick=t,o.innerHTML=e,o.appendChild(c),n.appendChild(o),document.body.appendChild(n),n.onclick=function(e){e.target===n&&t()},document.addEventListener("keydown",(function(e){"Escape"===e.key&&t()}),{once:!0})}
|
|
125
125
|
function tokenInput(){let t=document.createElement("button");t.classList.add("button-token-input"),t.classList.add("btn"),t.innerHTML="🔑",document.querySelector("#container-search-h7vc6omi2hr2880").appendChild(t),t.addEventListener("click",()=>{const t=prompt("Please enter your GitHub token:");t?(localStorage.setItem("githubToken",t),console.log("GitHub token is set.")):alert("GitHub token is not set.")})}document.addEventListener("DOMContentLoaded",(function(){tokenInput()}));
|
|
126
|
-
function pdfDownload(){fetch("index.pdf",{method:"HEAD"}).then(e=>{if(e.ok){let e=document.createElement("a");e.classList.add("button-pdf-download"),e.classList.add("btn"),e.target="_blank",e.rel="noopener noreferrer",e.href="index.pdf",e.title="Download this page as a PDF",e.innerHTML="PDF",document.querySelector("#container-search-h7vc6omi2hr2880").appendChild(e)}else console.
|
|
126
|
+
function pdfDownload(){fetch("index.pdf",{method:"HEAD"}).then(e=>{if(e.ok){let e=document.createElement("a");e.classList.add("button-pdf-download"),e.classList.add("btn"),e.target="_blank",e.rel="noopener noreferrer",e.href="index.pdf",e.title="Download this page as a PDF",e.innerHTML="PDF",document.querySelector("#container-search-h7vc6omi2hr2880").appendChild(e)}else console.log("PDF file does not exist. No PDF download button will be added.")}).catch(e=>{console.error("Error checking PDF file:",e)})}document.addEventListener("DOMContentLoaded",(function(){pdfDownload()}));
|
|
127
127
|
function helpButtons(){const t=document.createElement("a");t.textContent="?",t.classList.add("help-button","btn"),t.title="Click to see the explanation of the buttons at the documentation website, in a new tab.",t.target="_blank",t.rel="noopener noreferrer",t.href="https://blockchainbird.github.io/spec-up-t-website/docs/general/specification#explanation-buttons",function(t){document.querySelectorAll("#content dl dt").forEach(e=>{e.appendChild(t.cloneNode(!0))})}(t)}document.addEventListener("DOMContentLoaded",helpButtons);
|
|
128
128
|
function createAlphabetIndex(){const e=document.getElementById("alphabet-index-h7vc6omi2hr2880"),t=document.querySelector(".terms-and-definitions-list").querySelectorAll("dt"),n={};t.forEach(e=>{const t=e.querySelector("span");if(t&&t.id){const e=t.id,o=e.charAt(e.indexOf("term:")+5).toUpperCase();n[o]||(n[o]=t.id)}});const o=document.createElement("div");o.className="alphabet-index";const r=document.createElement("p");r.className="number-of-terms",r.textContent=`– There are ${t.length} terms –`;const c=e.parentNode;c.insertBefore(r,e.nextSibling),c.insertBefore(o,r.nextSibling),Object.keys(n).sort().forEach(e=>{const t=document.createElement("a");t.href="#"+n[e],t.textContent=e,o.appendChild(t)})}document.addEventListener("DOMContentLoaded",(function(){createAlphabetIndex()}));
|
|
129
129
|
function collapseDefinitions(){const t=document.querySelectorAll("#content dl dd"),e=document.querySelectorAll(".collapse-all-defs-button");document.querySelectorAll("dt").forEach(t=>{const e=document.createElement("button");e.classList.add("collapse-all-defs-button","btn"),e.innerHTML="▲",e.setAttribute("id","toggleButton"),t.appendChild(e)}),document.addEventListener("click",n=>{n.target.classList.contains("collapse-all-defs-button")&&(!function(){const n=t[0].classList.contains("hidden");t.forEach(t=>{t.classList.toggle("hidden",!n),t.classList.toggle("visible",n)}),e.forEach(t=>{t.innerHTML=n?"▲":"▼",t.title=n?"Collapse all definitions":"Expand all definitions"})}(),n.target.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"}),setTimeout(()=>{window.scrollBy({top:-100,behavior:"smooth"})},500))})}document.addEventListener("DOMContentLoaded",(function(){collapseDefinitions()}));
|
package/assets/compiled/head.css
CHANGED
|
@@ -11,4 +11,4 @@ code[class*=language-],pre[class*=language-]{color:#ccc;background:0 0;font-fami
|
|
|
11
11
|
.modal-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,.5);display:flex;justify-content:center;align-items:center;z-index:1000}.modal{background-color:#fff;padding:2rem 20px 20px;border-radius:8px;max-width:80%;max-height:80%;overflow-y:auto;position:relative;box-shadow:0 2px 10px rgba(0,0,0,.1)}.modal-close{position:absolute;top:0;right:5px;background-color:transparent;border:none;font-size:2rem;line-height:1;cursor:pointer}
|
|
12
12
|
.alphabet-index{display:flex;flex-wrap:wrap;justify-content:center;margin:1em auto;padding:0;width:100%}.alphabet-index a{background-color:#f5f5f5;border:1px solid #e0e0e0;border-radius:50%;color:#333;display:block;font-size:1rem;height:33.33px;line-height:33.33px;margin:3.33px;text-align:center;text-decoration:none;width:33.33px}.number-of-terms{text-align:center}
|
|
13
13
|
.button-pdf-download{padding-left:.1em;padding-right:.1em;border:none;background:red;color:#fff;box-shadow:2.8px 2.8px 2.2px rgba(0,0,0,.02),6.7px 6.7px 5.3px rgba(0,0,0,.028),12.5px 12.5px 10px rgba(0,0,0,.035),22.3px 22.3px 17.9px rgba(0,0,0,.042),41.8px 41.8px 33.4px rgba(0,0,0,.05),100px 100px 80px rgba(0,0,0,.07)}
|
|
14
|
-
:root{--base-theme-color:207,71%;--themed-element-bk:hsl(var(--base-theme-color), 40%);--themed-element-text:#fff;--themed-element-border:1px solid hsl(var(--base-theme-color), 26%);--themed-heading-text:hsl(var(--base-theme-color), 30%);--no-color:255,255,255;--faint-color:245,245,245;--dim-color:225,225,225;--low-color:200,200,200;--mid-color:100,100,100;--high-color:50,50,50;--full-color:0,0,0;--active-color:#3aaaff;--visited-color:rgb(188, 129, 255);--green-status:rgb(0, 123, 9);--light-green-status:rgb(0, 194, 13);--page-bk:rgb(var(--no-color));--page-text:rgb(var(--full-color));--page-text-hover:rgb(var(--full-color));--element-bk:rgb(var(--no-color));--element-bk-hover:rgba(var(--low-color), 0.5);--element-bk-transparent:rgba(var(--dim-color), 0.92);--element-border:rgba(var(--high-color), 0.4);--element-border-focus:rgb(var(--full-color), 0.75);--element-border-radius:3px;--element-shadow-low:0 1px 3px 0px rgba(0,0,0, 0.25);--element-shadow-mid:0 1px 3px 0px rgba(0,0,0, 0.35);--element-shadow-high:0 1px 5px 0px rgba(0,0,0, 0.45);--code-bk:#1a1e23;--input-bk:rgba(var(--dim-color), 0.6);--input-border:rgba(var(--high-color), 0.4);--header-height:48px;--header-bk:rgba(var(--low-color), 0.985);--header-text:rgb(var(--full-color));--header-border:rgba(var(--full-color), 0.1);--header-border-inverse:rgba(var(--no-color), 0.3);--text-shadow:0 1px 2px rgba(0,0,0,0.8);--svg-size:2vw;--font-size:14px}:target{scroll-margin:calc(var(--header-height)/ .75) 0 0}body:not([hashscroll]) :target{animation:highlight 1.5s .25s ease}body{margin:0;padding:0;font-family:Heebo,san-serif;line-height:1.5em;widows:2;orphans:2;word-wrap:break-word;overflow-wrap:break-word;color:#000;word-spacing:1px;counter-reset:h2 toc1}h1{font-size:2em;font-weight:700;line-height:1.2em}h2{margin:1.5em 0 1em}blockquote{position:relative;padding:0;margin:1.75em .75em;color:rgb(var(--mid-color));background:rgb(var(--faint-color))}blockquote:after,blockquote:before{content:"“";position:absolute;top:.065em;left:.065em;font-size:3em;height:.34em;line-height:100%;color:rgb(var(--low-color))}blockquote:after{content:"”";top:auto;left:auto;bottom:.065em;right:.065em;text-align:center}blockquote>p{padding:.6em 1.8em .5em 1.8em}strong strong{font-size:.9em;color:#b30032;font-weight:400;text-transform:uppercase}main article>ol,main article>ul{padding:0 0 0 2em}main article h1,main article h2,main article h3,main article h4,main article h5,main article h6{color:var(--themed-heading-text)}main article h2,main article h3,main article h4{display:flex;font-weight:500}main article h2{counter-reset:h3 h4}main article h3{counter-reset:h4}main article h2:after{counter-increment:h2;content:counter(h2) ".";padding:0 .4em 0 .2em;order:-1}main article h3:after{counter-increment:h3;content:counter(h2) "." counter(h3);padding:0 .45em 0 .2em;order:-1}main article h4:after{counter-increment:h4;content:counter(h2) "." counter(h3) "." counter(h4);padding:0 .5em 0 .2em;order:-1}h1 .toc-anchor{display:none}.toc-anchor{margin:-.1em 0 0;font-size:.875em;color:inherit;text-decoration:none;opacity:.35;order:-1;transition:opacity .3s ease}.toc-anchor:hover{opacity:1}pre{overflow:auto}code{padding:.085em .3em .1em;font-size:1.075em;color:#c7001c;vertical-align:middle;background:#f0f0f0;border-radius:4px}pre code{background:unset;padding:unset;border-radius:unset}h1 code,h2 code,h3 code,h4 code,h5 code,h6 code{font-size:1.25em;margin:-.11em .3em 0 0;border-radius:3px}ol,ul{margin:0;padding:0 0 0 1.2em}dl{margin:0;padding:0}dt{font-weight:700;margin:0;background-color:#f0f0f0;border:1px solid #ccc;padding:10px;border-radius:5px 5px 0 0}dd{margin:0;background-color:#f9f9f9;border:1px solid #ccc;border-top:none;padding:.5em 2em;border-bottom:none}dd p{margin:0}dd+dd{border-bottom:none}dd+dt{margin-top:2em}dd.last-dd{border-radius:0 0 5px 5px;border-bottom:1px solid #ccc}main{box-sizing:border-box;float:right;width:75%;min-width:calc(100% - 325px);max-width:calc(100% - 275px);padding:.5em 2em 1.5em 2em;background:#fff;box-shadow:0 0 5px -1px rgba(0,0,0,.3)}table{display:block;width:-webkit-fill-available;width:fit-content;max-width:100%;margin:1.5em 0 1.75em;border-spacing:0;border-collapse:collapse;overflow-x:auto;word-wrap:normal;overflow-wrap:normal;hyphens:manual}thead tr th{color:var(--themed-element-text);background:var(--themed-element-bk);border:var(--themed-element-border);text-shadow:0 1px 1px rgba(0,0,0,.5)}tr{border-top:1px solid #ccc;background-color:#fff;margin:0;padding:0}tr:nth-child(2n){background-color:#f0f0f0}tr th{font-weight:400;border:1px solid #ccc;text-align:left;margin:0;padding:6px 13px}td,th{padding:9px 13px;border:1px solid #d8d8d8}tr td{border:1px solid #ccc;text-align:left;margin:0;padding:.55em .75em .55em}tr td :first-child,tr th :first-child{margin-top:0}tr td :last-child,tr th :last-child{margin-bottom:0}table pre[class*=language-]{border:none;border-radius:0}table pre[class*=language-]:before{display:none}svg[icon]{width:1.25em;height:1.25em;vertical-align:text-top;pointer-events:none}article p>img{max-width:100%;margin:0 auto}article li{margin-top:.4em}slide-panel>:not(header):not(footer){flex:1}:not(pre)>code[class*=language-],pre[class*=language-]{padding:.65em .8em .8em;background:var(--code-bk)}.tippy-box{box-shadow:var(--element-shadow-mid)}.tippy-box a{color:var(--active-color)}.tippy-box a:visited{color:var(--visited-color)}.tippy-content{padding:.55em .55em .5em}.tippy-content header{margin:0 0 .4em;padding:.15em .3em .1em;border-radius:2px;background:rgba(255,255,255,.1);text-shadow:0 1px rgba(0,0,0,.9)}.tippy-content table,.tippy-content tbody,.tippy-content td,.tippy-content tr{margin:0;padding:0;border:none;border-spacing:0;border-collapse:collapse;background:0 0!important;background-color:transparent!important}.tippy-content table{margin:0 .3em}.tippy-content td{font-size:.9em;padding:.2em 0 0}.tippy-content td:first-child{padding-right:.5em}a[path-0$="github.com"]:before{content:"\f09b";color:var(--page-text);margin:0 .25em 0 0;font-family:FontAwesome;text-decoration:none;display:inline-block;vertical-align:bottom}a[path-0$="github.com"][path-3=issues][path-4],a[path-0$="github.com"][path-3=projects],a[path-0$="github.com"][path-3=pull],a[path-0$="github.com"][path-3=releases]{text-decoration:none}a[path-0$="github.com"][path-3=issues][path-4] span,a[path-0$="github.com"][path-3=projects] span,a[path-0$="github.com"][path-3=pull] span,a[path-0$="github.com"][path-3=releases] span{display:none}a[path-0$="github.com"][path-3=issues][path-4]:after{content:"Issue #" attr(path-4)}a[path-0$="github.com"][path-3=pull]:after{content:"Pull Request #" attr(path-4)}a[path-0$="github.com"][path-3=releases][path-5]:after{content:"Release " attr(path-5)}a[path-0$="github.com"][path-3=projects]:after{content:"Project #" attr(path-4)}[issue-count]:after{content:"Issues (" attr(issue-count) ")";margin:0 0 0 .3em;padding:.1em 0 0}[issue-count=""][animate]{display:none;opacity:0}[issue-count][animate]:not([issue-count=""]){animation:display-show 1s}[panel-toggle]{cursor:pointer}.panel-header{display:flex;align-items:center;height:var(--header-height)}.panel-header>*{display:flex;height:100%;padding:.1em .8em 0;align-items:center}.slide-panel{width:calc(100% - 1em);max-width:475px;transition:transform .35s ease}.slide-panel[panel-open]{transform:translateX(0)}.notice{margin:1em 0;padding:.5em .9em .55em .65em;border-left:.5em solid}.notice p{margin:.4em 0 0}.note{background:#e9fbe9;border-color:#52e052}.note .notice-link{display:block;color:#178217}.issue{background:#e9f0fb;border-color:#527fe0}.issue .notice-link:before{display:block;color:#1e4cae}.warning{background:#fbe9e9;border-color:#e05252}.warning .notice-link{display:block;color:#ae1e1e}.example{color:#cebe00;background:#1a1e23;border-left:.5em solid}.example .notice-link{display:block;color:inherit;font-size:1.1em;font-family:Heebo,san-serif}.example pre[class*=language-]{padding:0;border-radius:0}.todo{background:#fbe4ff;border-color:#9700e2}.todo .notice-link{display:block;color:#6d00a2}.mermaid{display:flex;align-items:center;justify-content:center;margin:1.5em 0 1.75em}.reference-list{margin:0;padding:0;list-style:none}.reference-list dd a,.reference-status{font-style:italic}.reference-status{color:var(--green-status)}.tippy-box .reference-status{color:var(--light-green-status)}code[class*=language-],pre,pre[class*=language-]{font-size:.9em;margin:1em 0 1.5em;border-radius:3px}.example code[class*=language-],.example pre,.example pre[class*=language-]{margin:0}#svg{display:none}#header{position:sticky;position:-webkit-sticky;padding:0;top:0;margin:-.5em -2em 0 -2em;background:rgba(255,255,255,.9);border-bottom:1px solid rgba(0,0,0,.175);box-shadow:0 1px 3px 1px rgba(0,0,0,.1);z-index:2}#logo{box-sizing:border-box;display:flex;align-items:center;height:100%;padding:.5em}#logo img{height:100%}#logo+span{margin-left:auto}#header #toc_toggle{display:none;padding:0 1em;border-right:1px solid rgba(0,0,0,.15)}#content{max-width:800px}#content h1:first-of-type{margin:1em 0 .5em}#content h1:first-of-type .markdownIt-Anchor{display:none}#repo_issues{width:calc(100% - 1.5em);max-width:450px;border-left:1px solid rgba(0,0,0,.15)}#repo_issues>header{background:#eee;border-bottom:1px solid #ddd}#repo_issues>header span:first-of-type{font-weight:700;padding-top:.1em}#repo_issues>header .repo-issue-toggle{margin-left:auto;color:inherit;font-weight:700;text-decoration:none}#repo_issue_list{list-style:none;margin:0;padding:0 1.25em 1.25em;font-size:.85em;overflow:auto;-ms-overflow-style:none;scrollbar-width:none}#repo_issue_list::-webkit-scrollbar{display:none}#repo_issue_list:empty:before{content:"No issues found";display:block;text-align:center;font-size:1.1em;color:#aaa;margin:1em 0 0}.repo-issue detail-box{display:flex;flex-direction:column;padding:1em 0;border-bottom:1px solid #ddd}.repo-issue detail-box>section{order:1}.repo-issue detail-box>section:empty+.repo-issue-title [detail-box-toggle]{display:none}.repo-issue-title{display:flex;align-items:center}.repo-issue-link{flex:1;margin:0 0 0 .5em}.repo-issue-number{height:1em;margin:0 .4em 0 0;padding:.3em .25em 0;border-radius:3px;font-weight:700;background:#eee;border:1px solid #ddd;text-align:center;line-height:1em}.repo-issue-number:before{content:"#";font-weight:400;margin:0 .1em 0 0}.repo-issue [detail-box-toggle]{margin:0 0 0 1em;opacity:.35;transition:opacity .4s}.repo-issue [detail-box-toggle]:hover,.repo-issue detail-box[open] [detail-box-toggle]{opacity:1}#toc{display:flex;flex-direction:column;width:25%;max-width:325px;min-width:275px;background:#eceff1}#toc header{color:var(--themed-element-text);background:var(--themed-element-bk);box-shadow:0 1px 3px 0 rgba(0,0,0,.3);border:var(--themed-element-border);border-top:none;border-left:none}#toc header [panel-toggle]{display:none;height:var(--header-height);line-height:var(--header-height);margin-left:auto;padding:0 1em;color:inherit;font-weight:700;text-decoration:none}#toc_list{flex:1;padding:1em .8em;overflow:auto}.toc{padding:0 0 1.75em;font-size:.85em}.toc,.toc ul{margin:0;list-style:none}.toc ul{padding:0 0 0 1em}.toc a{display:block;padding:.4em .3em .225em;text-decoration:none;border-radius:3px;color:#333}.toc a:before{color:#000;font-weight:700}.toc a:hover{text-shadow:0 1px 1px #fff;background:rgba(0,0,0,.1)}.toc>li a:before{counter-increment:toc1;content:counter(toc1) ".";padding:0 .4em 0 .2em}.toc>li>ul{counter-reset:toc2}.toc>li>ul>li a:before{counter-increment:toc2;content:counter(toc1) "." counter(toc2);padding:0 .45em 0 .2em}.toc>li>ul ul{counter-reset:toc3}.toc>li>ul ul li a:before{counter-increment:toc3;content:counter(toc1) "." counter(toc2) "." counter(toc3);padding:0 .5em 0 .2em}@media (min-width:900px){slide-panel{z-index:2}#slidepanels[open=sidebar]:before{opacity:0;transition:none;pointer-events:none}#slidepanels:before{z-index:1}#toc{transition:none;transform:translate3d(0,0,0);box-shadow:0 0 5px 1px rgba(0,0,0,.15) inset;z-index:0}}@media (max-width:900px){main{width:100%;min-width:auto;max-width:none;padding:.5em 1.25em 1.5em 1.25em}#header{margin:-.5em -1.25em 0 -1.25em}#toc header [panel-toggle]{display:block}#header #toc_toggle{display:flex}}@media (max-width:550px){td{font-size:.8em}}@keyframes display-show{0%{display:none;opacity:0}1%{display:block}100%{opacity:1}}@keyframes highlight{50%{background-color:#ff0}}article a[href^="https://"]:not(.btn)::after,article a[href^=http]:not(.btn)::after{content:'';width:12px;height:12px;margin-left:4px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='currentColor' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M8.636 3.5a.5.5 0 0 0-.5-.5H1.5A1.5 1.5 0 0 0 0 4.5v10A1.5 1.5 0 0 0 1.5 16h10a1.5 1.5 0 0 0 1.5-1.5V7.864a.5.5 0 0 0-1 0V14.5a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h6.636a.5.5 0 0 0 .5-.5z'/%3E%3Cpath fill-rule='evenodd' d='M16 .5a.5.5 0 0 0-.5-.5h-5a.5.5 0 0 0 0 1h3.793L6.146 9.146a.5.5 0 1 0 .708.708L15 1.707V5.5a.5.5 0 0 0 1 0v-5z'/%3E%3C/svg%3E");background-position:center;background-repeat:no-repeat;background-size:contain;display:inline-block}.btn,.no-xref-found-message{font-variant:small-caps;text-transform:uppercase}.no-xref-found-message{background:#f8c481!important;color:#03365f!important;margin:0 .5em;padding:0 .8em;border-radius:.25rem;font-size:.8rem}.snapshots{padding:1em .8em;flex:none}.snapshots a{display:block;margin:.5em 0;padding:.5em .8em;border-radius:.25rem;background:#a9dde0;color:#03365f;text-decoration:none;font-size:1rem}
|
|
14
|
+
:root{--base-theme-color:207,71%;--themed-element-bk:hsl(var(--base-theme-color), 40%);--themed-element-text:#fff;--themed-element-border:1px solid hsl(var(--base-theme-color), 26%);--themed-heading-text:hsl(var(--base-theme-color), 30%);--no-color:255,255,255;--faint-color:245,245,245;--dim-color:225,225,225;--low-color:200,200,200;--mid-color:100,100,100;--high-color:50,50,50;--full-color:0,0,0;--active-color:#3aaaff;--visited-color:rgb(188, 129, 255);--green-status:rgb(0, 123, 9);--light-green-status:rgb(0, 194, 13);--page-bk:rgb(var(--no-color));--page-text:rgb(var(--full-color));--page-text-hover:rgb(var(--full-color));--element-bk:rgb(var(--no-color));--element-bk-hover:rgba(var(--low-color), 0.5);--element-bk-transparent:rgba(var(--dim-color), 0.92);--element-border:rgba(var(--high-color), 0.4);--element-border-focus:rgb(var(--full-color), 0.75);--element-border-radius:3px;--element-shadow-low:0 1px 3px 0px rgba(0,0,0, 0.25);--element-shadow-mid:0 1px 3px 0px rgba(0,0,0, 0.35);--element-shadow-high:0 1px 5px 0px rgba(0,0,0, 0.45);--code-bk:#1a1e23;--input-bk:rgba(var(--dim-color), 0.6);--input-border:rgba(var(--high-color), 0.4);--header-height:48px;--header-bk:rgba(var(--low-color), 0.985);--header-text:rgb(var(--full-color));--header-border:rgba(var(--full-color), 0.1);--header-border-inverse:rgba(var(--no-color), 0.3);--text-shadow:0 1px 2px rgba(0,0,0,0.8);--svg-size:2vw;--font-size:14px}:target{scroll-margin:calc(var(--header-height)/ .75) 0 0}body:not([hashscroll]) :target{animation:highlight 1.5s .25s ease}body{margin:0;padding:0;font-family:Heebo,san-serif;line-height:1.5em;widows:2;orphans:2;word-wrap:break-word;overflow-wrap:break-word;color:#000;word-spacing:1px;counter-reset:h2 toc1}h1{font-size:2em;font-weight:700;line-height:1.2em}h2{margin:1.5em 0 1em}blockquote{position:relative;padding:0;margin:1.75em .75em;color:rgb(var(--mid-color));background:rgb(var(--faint-color))}blockquote:after,blockquote:before{content:"“";position:absolute;top:.065em;left:.065em;font-size:3em;height:.34em;line-height:100%;color:rgb(var(--low-color))}blockquote:after{content:"”";top:auto;left:auto;bottom:.065em;right:.065em;text-align:center}blockquote>p{padding:.6em 1.8em .5em 1.8em}strong strong{font-size:.9em;color:#b30032;font-weight:400;text-transform:uppercase}main article>ol,main article>ul{padding:0 0 0 2em}main article h1,main article h2,main article h3,main article h4,main article h5,main article h6{color:var(--themed-heading-text)}main article h2,main article h3,main article h4{display:flex;font-weight:500}main article h2{counter-reset:h3 h4}main article h3{counter-reset:h4}main article h2:after{counter-increment:h2;content:counter(h2) ".";padding:0 .4em 0 .2em;order:-1}main article h3:after{counter-increment:h3;content:counter(h2) "." counter(h3);padding:0 .45em 0 .2em;order:-1}main article h4:after{counter-increment:h4;content:counter(h2) "." counter(h3) "." counter(h4);padding:0 .5em 0 .2em;order:-1}h1 .toc-anchor{display:none}.toc-anchor{margin:-.1em 0 0;font-size:.875em;color:inherit;text-decoration:none;opacity:.35;order:-1;transition:opacity .3s ease}.toc-anchor:hover{opacity:1}pre{overflow:auto}code{padding:.085em .3em .1em;font-size:1.075em;color:#c7001c;vertical-align:middle;background:#f0f0f0;border-radius:4px}pre code{background:unset;padding:unset;border-radius:unset}h1 code,h2 code,h3 code,h4 code,h5 code,h6 code{font-size:1.25em;margin:-.11em .3em 0 0;border-radius:3px}ol,ul{margin:0;padding:0 0 0 1.2em}dl{margin:0;padding:0}dt{font-weight:700;margin:0;background-color:#f0f0f0;border:1px solid #ccc;padding:10px;border-radius:5px 5px 0 0}dd{margin:0;background-color:#f9f9f9;border:1px solid #ccc;border-top:none;padding:.5em 2em;border-bottom:none}dd p{margin:0}dd+dd{border-bottom:none}dd+dt{margin-top:2em}dd.last-dd{border-radius:0 0 5px 5px;border-bottom:1px solid #ccc}main{box-sizing:border-box;float:right;width:75%;min-width:calc(100% - 325px);max-width:calc(100% - 275px);padding:.5em 2em 1.5em 2em;background:#fff;box-shadow:0 0 5px -1px rgba(0,0,0,.3)}table{display:block;width:-webkit-fill-available;width:fit-content;max-width:100%;margin:1.5em 0 1.75em;border-spacing:0;border-collapse:collapse;overflow-x:auto;word-wrap:normal;overflow-wrap:normal;hyphens:manual}thead tr th{color:var(--themed-element-text);background:var(--themed-element-bk);border:var(--themed-element-border);text-shadow:0 1px 1px rgba(0,0,0,.5)}tr{border-top:1px solid #ccc;background-color:#fff;margin:0;padding:0}tr:nth-child(2n){background-color:#f0f0f0}tr th{font-weight:400;border:1px solid #ccc;text-align:left;margin:0;padding:6px 13px}td,th{padding:9px 13px;border:1px solid #d8d8d8}tr td{border:1px solid #ccc;text-align:left;margin:0;padding:.55em .75em .55em}tr td :first-child,tr th :first-child{margin-top:0}tr td :last-child,tr th :last-child{margin-bottom:0}table pre[class*=language-]{border:none;border-radius:0}table pre[class*=language-]:before{display:none}svg[icon]{width:1.25em;height:1.25em;vertical-align:text-top;pointer-events:none}article p>img{max-width:100%;margin:0 auto}article li{margin-top:.4em}slide-panel>:not(header):not(footer){flex:1}:not(pre)>code[class*=language-],pre[class*=language-]{padding:.65em .8em .8em;background:var(--code-bk)}.tippy-box{box-shadow:var(--element-shadow-mid)}.tippy-box a{color:var(--active-color)}.tippy-box a:visited{color:var(--visited-color)}.tippy-content{padding:.55em .55em .5em}.tippy-content header{margin:0 0 .4em;padding:.15em .3em .1em;border-radius:2px;background:rgba(255,255,255,.1);text-shadow:0 1px rgba(0,0,0,.9)}.tippy-content table,.tippy-content tbody,.tippy-content td,.tippy-content tr{margin:0;padding:0;border:none;border-spacing:0;border-collapse:collapse;background:0 0!important;background-color:transparent!important}.tippy-content table{margin:0 .3em}.tippy-content td{font-size:.9em;padding:.2em 0 0}.tippy-content td:first-child{padding-right:.5em}a[path-0$="github.com"]:before{content:"\f09b";color:var(--page-text);margin:0 .25em 0 0;font-family:FontAwesome;text-decoration:none;display:inline-block;vertical-align:bottom}a[path-0$="github.com"][path-3=issues][path-4],a[path-0$="github.com"][path-3=projects],a[path-0$="github.com"][path-3=pull],a[path-0$="github.com"][path-3=releases]{text-decoration:none}a[path-0$="github.com"][path-3=issues][path-4] span,a[path-0$="github.com"][path-3=projects] span,a[path-0$="github.com"][path-3=pull] span,a[path-0$="github.com"][path-3=releases] span{display:none}a[path-0$="github.com"][path-3=issues][path-4]:after{content:"Issue #" attr(path-4)}a[path-0$="github.com"][path-3=pull]:after{content:"Pull Request #" attr(path-4)}a[path-0$="github.com"][path-3=releases][path-5]:after{content:"Release " attr(path-5)}a[path-0$="github.com"][path-3=projects]:after{content:"Project #" attr(path-4)}[issue-count]:after{content:"Issues (" attr(issue-count) ")";margin:0 0 0 .3em;padding:.1em 0 0}[issue-count=""][animate]{display:none;opacity:0}[issue-count][animate]:not([issue-count=""]){animation:display-show 1s}[panel-toggle]{cursor:pointer}.panel-header{display:flex;align-items:center;height:var(--header-height)}.panel-header>*{display:flex;height:100%;padding:.1em .8em 0;align-items:center}.slide-panel{width:calc(100% - 1em);max-width:475px;transition:transform .35s ease}.slide-panel[panel-open]{transform:translateX(0)}.notice{margin:1em 0;padding:.5em .9em .55em .65em;border-left:.5em solid}.notice p{margin:.4em 0 0}.note{background:#e9fbe9;border-color:#52e052}.note .notice-link{display:block;color:#178217}.issue{background:#e9f0fb;border-color:#527fe0}.issue .notice-link:before{display:block;color:#1e4cae}.warning{background:#fbe9e9;border-color:#e05252}.warning .notice-link{display:block;color:#ae1e1e}.example{color:#cebe00;background:#1a1e23;border-left:.5em solid}.example .notice-link{display:block;color:inherit;font-size:1.1em;font-family:Heebo,san-serif}.example pre[class*=language-]{padding:0;border-radius:0}.todo{background:#fbe4ff;border-color:#9700e2}.todo .notice-link{display:block;color:#6d00a2}.mermaid{display:flex;align-items:center;justify-content:center;margin:1.5em 0 1.75em}.reference-list{margin:0;padding:0;list-style:none}.reference-list dd a,.reference-status{font-style:italic}.reference-status{color:var(--green-status)}.tippy-box .reference-status{color:var(--light-green-status)}code[class*=language-],pre,pre[class*=language-]{font-size:.9em;margin:1em 0 1.5em;border-radius:3px}.example code[class*=language-],.example pre,.example pre[class*=language-]{margin:0}#svg{display:none}#header{position:sticky;position:-webkit-sticky;padding:0;top:0;margin:-.5em -2em 0 -2em;background:rgba(255,255,255,.9);border-bottom:1px solid rgba(0,0,0,.175);box-shadow:0 1px 3px 1px rgba(0,0,0,.1);z-index:2}#logo{box-sizing:border-box;display:flex;align-items:center;height:100%;padding:.5em}#logo img{height:100%}#logo+span{margin-left:auto}#header #toc_toggle{display:none;padding:0 1em;border-right:1px solid rgba(0,0,0,.15)}#content{max-width:800px}#content h1:first-of-type{margin:1em 0 .5em}#content h1:first-of-type .markdownIt-Anchor{display:none}#repo_issues{width:calc(100% - 1.5em);max-width:450px;border-left:1px solid rgba(0,0,0,.15)}#repo_issues>header{background:#eee;border-bottom:1px solid #ddd}#repo_issues>header span:first-of-type{font-weight:700;padding-top:.1em}#repo_issues>header .repo-issue-toggle{margin-left:auto;color:inherit;font-weight:700;text-decoration:none}#repo_issue_list{list-style:none;margin:0;padding:0 1.25em 1.25em;font-size:.85em;overflow:auto;-ms-overflow-style:none;scrollbar-width:none}#repo_issue_list::-webkit-scrollbar{display:none}#repo_issue_list:empty:before{content:"No issues found";display:block;text-align:center;font-size:1.1em;color:#aaa;margin:1em 0 0}.repo-issue detail-box{display:flex;flex-direction:column;padding:1em 0;border-bottom:1px solid #ddd}.repo-issue detail-box>section{order:1}.repo-issue detail-box>section:empty+.repo-issue-title [detail-box-toggle]{display:none}.repo-issue-title{display:flex;align-items:center}.repo-issue-link{flex:1;margin:0 0 0 .5em}.repo-issue-number{height:1em;margin:0 .4em 0 0;padding:.3em .25em 0;border-radius:3px;font-weight:700;background:#eee;border:1px solid #ddd;text-align:center;line-height:1em}.repo-issue-number:before{content:"#";font-weight:400;margin:0 .1em 0 0}.repo-issue [detail-box-toggle]{margin:0 0 0 1em;opacity:.35;transition:opacity .4s}.repo-issue [detail-box-toggle]:hover,.repo-issue detail-box[open] [detail-box-toggle]{opacity:1}#toc{display:flex;flex-direction:column;width:25%;max-width:325px;min-width:275px;background:#eceff1}#toc header{color:var(--themed-element-text);background:var(--themed-element-bk);box-shadow:0 1px 3px 0 rgba(0,0,0,.3);border:var(--themed-element-border);border-top:none;border-left:none}#toc header [panel-toggle]{display:none;height:var(--header-height);line-height:var(--header-height);margin-left:auto;padding:0 1em;color:inherit;font-weight:700;text-decoration:none}#toc_list{flex:1;padding:1em .8em;overflow:auto}.toc{padding:0 0 1.75em;font-size:.85em}.toc,.toc ul{margin:0;list-style:none}.toc ul{padding:0 0 0 1em}.toc a{display:block;padding:.4em .3em .225em;text-decoration:none;border-radius:3px;color:#333}.toc a:before{color:#000;font-weight:700}.toc a:hover{text-shadow:0 1px 1px #fff;background:rgba(0,0,0,.1)}.toc>li a:before{counter-increment:toc1;content:counter(toc1) ".";padding:0 .4em 0 .2em}.toc>li>ul{counter-reset:toc2}.toc>li>ul>li a:before{counter-increment:toc2;content:counter(toc1) "." counter(toc2);padding:0 .45em 0 .2em}.toc>li>ul ul{counter-reset:toc3}.toc>li>ul ul li a:before{counter-increment:toc3;content:counter(toc1) "." counter(toc2) "." counter(toc3);padding:0 .5em 0 .2em}@media (min-width:900px){slide-panel{z-index:2}#slidepanels[open=sidebar]:before{opacity:0;transition:none;pointer-events:none}#slidepanels:before{z-index:1}#toc{transition:none;transform:translate3d(0,0,0);box-shadow:0 0 5px 1px rgba(0,0,0,.15) inset;z-index:0}}@media (max-width:900px){main{width:100%;min-width:auto;max-width:none;padding:.5em 1.25em 1.5em 1.25em}#header{margin:-.5em -1.25em 0 -1.25em}#toc header [panel-toggle]{display:block}#header #toc_toggle{display:flex}}@media (max-width:550px){td{font-size:.8em}}@keyframes display-show{0%{display:none;opacity:0}1%{display:block}100%{opacity:1}}@keyframes highlight{50%{background-color:#ff0}}article a[href^="https://"]:not(.btn)::after,article a[href^=http]:not(.btn)::after{content:'';width:12px;height:12px;margin-left:4px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='currentColor' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M8.636 3.5a.5.5 0 0 0-.5-.5H1.5A1.5 1.5 0 0 0 0 4.5v10A1.5 1.5 0 0 0 1.5 16h10a1.5 1.5 0 0 0 1.5-1.5V7.864a.5.5 0 0 0-1 0V14.5a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h6.636a.5.5 0 0 0 .5-.5z'/%3E%3Cpath fill-rule='evenodd' d='M16 .5a.5.5 0 0 0-.5-.5h-5a.5.5 0 0 0 0 1h3.793L6.146 9.146a.5.5 0 1 0 .708.708L15 1.707V5.5a.5.5 0 0 0 1 0v-5z'/%3E%3C/svg%3E");background-position:center;background-repeat:no-repeat;background-size:contain;display:inline-block}.btn,.no-xref-found-message{font-variant:small-caps;text-transform:uppercase}.no-xref-found-message{background:#f8c481!important;color:#03365f!important;margin:0 .5em;padding:0 .8em;border-radius:.25rem;font-size:.8rem}.powered-by,.snapshots{margin:0;padding:0;flex:none}.powered-by{text-align:center;font-size:.7em}.snapshots a{display:block;margin:.5em;padding:.5em .8em;border-radius:.25rem;background:#a9dde0;color:#03365f;text-decoration:none;font-size:1rem}
|
package/assets/css/index.css
CHANGED
|
@@ -980,13 +980,24 @@ article a[href^="https://"]:not(.btn)::after {
|
|
|
980
980
|
font-size: 0.8rem;
|
|
981
981
|
}
|
|
982
982
|
|
|
983
|
-
.snapshots {
|
|
984
|
-
padding: 1em 0.8em;
|
|
983
|
+
.snapshots, .powered-by {
|
|
984
|
+
/* padding: 1em 0.8em 0.5em; */
|
|
985
|
+
margin: 0;
|
|
986
|
+
padding: 0;
|
|
985
987
|
flex:none;
|
|
986
988
|
}
|
|
989
|
+
|
|
990
|
+
.powered-by {
|
|
991
|
+
/* margin: 0;
|
|
992
|
+
padding: 0; */
|
|
993
|
+
text-align: center;
|
|
994
|
+
font-size: 0.7em;
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
|
|
987
998
|
.snapshots a {
|
|
988
999
|
display: block;
|
|
989
|
-
margin: 0.5em
|
|
1000
|
+
margin: 0.5em;
|
|
990
1001
|
padding: 0.5em 0.8em;
|
|
991
1002
|
border-radius: 0.25rem;
|
|
992
1003
|
background: #A9DDE0;
|
|
@@ -19,7 +19,7 @@ function pdfDownload() {
|
|
|
19
19
|
buttonPdfDownload.innerHTML = "PDF";
|
|
20
20
|
document.querySelector('#container-search-h7vc6omi2hr2880').appendChild(buttonPdfDownload);
|
|
21
21
|
} else {
|
|
22
|
-
console.
|
|
22
|
+
console.log('PDF file does not exist. No PDF download button will be added.');
|
|
23
23
|
}
|
|
24
24
|
})
|
|
25
25
|
.catch(error => {
|
package/assets/js/search.js
CHANGED
|
@@ -283,12 +283,8 @@ function inPageSearch() {
|
|
|
283
283
|
}
|
|
284
284
|
return false;
|
|
285
285
|
}
|
|
286
|
-
|
|
287
|
-
// A:
|
|
288
|
-
if (node.nodeType === 3) { // Node.TEXT_NODE
|
|
289
286
|
|
|
290
|
-
|
|
291
|
-
// if (node.nodeType === 3 && !hasHiddenAncestor(node)) { // Node.TEXT_NODE
|
|
287
|
+
if (node.nodeType === 3 && !hasHiddenAncestor(node)) { // Node.TEXT_NODE
|
|
292
288
|
|
|
293
289
|
const fragments = markAndCountMatches(node);
|
|
294
290
|
if (fragments.childNodes.length > 1) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @file This file fetches and displays commit hashes by matching elements with `
|
|
2
|
+
* @file This file fetches and displays commit hashes by matching elements with `x-term-reference` class against the `allXrefs` global object.
|
|
3
3
|
* Example:
|
|
4
4
|
* const allXrefs = {
|
|
5
5
|
"xrefs": [
|
|
@@ -26,6 +26,13 @@
|
|
|
26
26
|
*/
|
|
27
27
|
|
|
28
28
|
function fetchCommitHashes() {
|
|
29
|
+
|
|
30
|
+
// Check if allXrefs is undefined or does not exist
|
|
31
|
+
if (typeof allXrefs === 'undefined' || allXrefs === null) {
|
|
32
|
+
console.log('allXrefs is not defined or does not exist. We will continue without it.');
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
|
|
29
36
|
// Load GitHub API token from local storage if it exists
|
|
30
37
|
const savedToken = localStorage.getItem('githubToken');
|
|
31
38
|
|
|
@@ -108,10 +115,9 @@ function fetchCommitHashes() {
|
|
|
108
115
|
});
|
|
109
116
|
}
|
|
110
117
|
|
|
111
|
-
// get all elements with
|
|
118
|
+
// get all elements with class “x-term-reference”
|
|
112
119
|
const elements = document.querySelectorAll('.x-term-reference');
|
|
113
120
|
|
|
114
|
-
// for each element, get the value of the data-attribute “data-local-href”
|
|
115
121
|
elements.forEach((element) => {
|
|
116
122
|
// Get the value of the data-local-href attribute
|
|
117
123
|
const href = element.getAttribute('data-local-href');
|
package/index.js
CHANGED
|
@@ -52,13 +52,8 @@ module.exports = function(options = {}) {
|
|
|
52
52
|
// Test if xrefs-data.js exists, else make it an empty string
|
|
53
53
|
const inputPath = 'output/xrefs-data.js';
|
|
54
54
|
let xrefsData = "";
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
if (fs.existsSync(inputPath)) {
|
|
58
|
-
xrefsData = '<script>' + fs.readFileSync(inputPath, 'utf8') + '</script>';
|
|
59
|
-
}
|
|
60
|
-
} catch (error) {
|
|
61
|
-
console.error("\n SPEC-UP-T: " + error + "\n");
|
|
55
|
+
if (fs.existsSync(inputPath)) {
|
|
56
|
+
xrefsData = '<script>' + fs.readFileSync(inputPath, 'utf8') + '</script>';
|
|
62
57
|
}
|
|
63
58
|
|
|
64
59
|
function applyReplacers(doc) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "spec-up-t",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.42",
|
|
4
4
|
"description": "Technical specification drafting tool that generates rich specification documents from markdown. Forked from https://github.com/decentralized-identity/spec-up by Daniel Buchner (https://github.com/csuwildcat)",
|
|
5
5
|
"main": "./index",
|
|
6
6
|
"repository": {
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
"markdown-it-textual-uml": "0.1.3",
|
|
56
56
|
"markdown-it-toc-and-anchor": "4.2.0",
|
|
57
57
|
"merge-stream": "2.0.0",
|
|
58
|
+
"pdf-lib": "^1.17.1",
|
|
58
59
|
"pkg-dir": "4.2.0",
|
|
59
60
|
"prismjs": ">=1.24.0",
|
|
60
61
|
"puppeteer": "^23.2.1",
|
package/src/create-pdf.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const fs = require('fs-extra');
|
|
2
2
|
const puppeteer = require('puppeteer');
|
|
3
3
|
const path = require('path');
|
|
4
|
+
const pdfLib = require('pdf-lib');
|
|
4
5
|
|
|
5
6
|
(async () => {
|
|
6
7
|
try {
|
|
@@ -21,7 +22,7 @@ const path = require('path');
|
|
|
21
22
|
// Navigate to the HTML file
|
|
22
23
|
await page.goto(fileUrl, { waitUntil: 'networkidle2' });
|
|
23
24
|
|
|
24
|
-
// Inject CSS to set padding
|
|
25
|
+
// Inject CSS to set padding and enforce system fonts
|
|
25
26
|
await page.evaluate(() => {
|
|
26
27
|
const style = document.createElement('style');
|
|
27
28
|
style.innerHTML = `
|
|
@@ -32,12 +33,41 @@ const path = require('path');
|
|
|
32
33
|
margin-right: 15mm;
|
|
33
34
|
border: none;
|
|
34
35
|
}
|
|
36
|
+
|
|
37
|
+
/* Override all fonts with system fonts */
|
|
38
|
+
* {
|
|
39
|
+
font-family: Arial, Helvetica, sans-serif !important;
|
|
40
|
+
}
|
|
35
41
|
`;
|
|
36
42
|
document.head.appendChild(style);
|
|
37
43
|
});
|
|
38
44
|
|
|
39
45
|
// Remove or hide the search bar or any other element
|
|
40
46
|
await page.evaluate(() => {
|
|
47
|
+
// Remove elements with display: none
|
|
48
|
+
const hiddenElements = document.querySelectorAll('[style*="display: none"]');
|
|
49
|
+
hiddenElements.forEach((element) => {
|
|
50
|
+
element.remove();
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
// Remove all script elements
|
|
54
|
+
const scriptElements = document.querySelectorAll('script');
|
|
55
|
+
scriptElements.forEach((element) => {
|
|
56
|
+
element.remove();
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
// Remove all style elements
|
|
60
|
+
const styleElements = document.querySelectorAll('style');
|
|
61
|
+
styleElements.forEach((element) => {
|
|
62
|
+
element.remove();
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
// // Remove images
|
|
66
|
+
// const images = document.querySelectorAll('img');
|
|
67
|
+
// images.forEach((img) => {
|
|
68
|
+
// img.remove();
|
|
69
|
+
// });
|
|
70
|
+
|
|
41
71
|
const displayNoneInPdf = document.querySelectorAll('#header span, #container-search-h7vc6omi2hr2880, .btn'); // Adjust the selector as needed
|
|
42
72
|
if (displayNoneInPdf) {
|
|
43
73
|
displayNoneInPdf.forEach((element) => {
|
|
@@ -53,20 +83,92 @@ const path = require('path');
|
|
|
53
83
|
element.style.backgroundColor = 'white';
|
|
54
84
|
element.style.border = 'none';
|
|
55
85
|
});
|
|
86
|
+
|
|
87
|
+
// Inject CSS Reset and Basic Styling
|
|
88
|
+
const style = document.createElement('style');
|
|
89
|
+
style.innerHTML = `
|
|
90
|
+
/* CSS Reset */
|
|
91
|
+
* {
|
|
92
|
+
margin: 0;
|
|
93
|
+
padding: 0;
|
|
94
|
+
box-sizing: border-box;
|
|
95
|
+
}
|
|
96
|
+
html, body {
|
|
97
|
+
height: 100%;
|
|
98
|
+
font-family: Arial, Helvetica, sans-serif;
|
|
99
|
+
font-size: 14px;
|
|
100
|
+
line-height: 1.6;
|
|
101
|
+
color: #333;
|
|
102
|
+
background-color: #fff;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/* Basic Styling */
|
|
106
|
+
body {
|
|
107
|
+
padding: 15mm;
|
|
108
|
+
}
|
|
109
|
+
h1, h2, h3, h4, h5, h6 {
|
|
110
|
+
margin-bottom: 10px;
|
|
111
|
+
}
|
|
112
|
+
p {
|
|
113
|
+
margin-bottom: 15px;
|
|
114
|
+
}
|
|
115
|
+
ul, ol {
|
|
116
|
+
margin-left: 20px;
|
|
117
|
+
margin-bottom: 15px;
|
|
118
|
+
}
|
|
119
|
+
a {
|
|
120
|
+
color: #007BFF;
|
|
121
|
+
text-decoration: none;
|
|
122
|
+
}
|
|
123
|
+
a:hover {
|
|
124
|
+
text-decoration: underline;
|
|
125
|
+
}
|
|
126
|
+
table {
|
|
127
|
+
width: 100%;
|
|
128
|
+
border-collapse: collapse;
|
|
129
|
+
margin-bottom: 15px;
|
|
130
|
+
}
|
|
131
|
+
table, th, td {
|
|
132
|
+
border: 1px solid #ddd;
|
|
133
|
+
}
|
|
134
|
+
th, td {
|
|
135
|
+
padding: 8px;
|
|
136
|
+
text-align: left;
|
|
137
|
+
}
|
|
138
|
+
th {
|
|
139
|
+
background-color: #f2f2f2;
|
|
140
|
+
}
|
|
141
|
+
`;
|
|
142
|
+
document.head.appendChild(style);
|
|
56
143
|
});
|
|
57
144
|
|
|
58
|
-
|
|
59
|
-
|
|
145
|
+
|
|
146
|
+
// Generate the PDF with optimized settings
|
|
147
|
+
const pdfBuffer = await page.pdf({
|
|
60
148
|
path: path.resolve(process.cwd(), 'docs/index.pdf'), // Output file path
|
|
61
149
|
format: 'A4', // Paper format
|
|
62
|
-
printBackground: true, // Print background graphics
|
|
63
150
|
displayHeaderFooter: false, // Do not display header and footer
|
|
64
|
-
preferCSSPageSize: true // Use CSS-defined page size
|
|
151
|
+
preferCSSPageSize: true, // Use CSS-defined page size
|
|
152
|
+
printBackground: false, // Disable background graphics
|
|
153
|
+
quality: 1, // Adjust the quality of images (0-100)
|
|
154
|
+
compressionLevel: 10 // Maximum compression
|
|
65
155
|
});
|
|
66
156
|
|
|
67
|
-
// Close the browser instance
|
|
68
157
|
await browser.close();
|
|
69
158
|
|
|
159
|
+
// Load the PDF with pdf-lib to remove metadata and optimize fonts
|
|
160
|
+
const pdfDoc = await pdfLib.PDFDocument.load(pdfBuffer);
|
|
161
|
+
pdfDoc.setTitle('');
|
|
162
|
+
pdfDoc.setAuthor('');
|
|
163
|
+
pdfDoc.setSubject('');
|
|
164
|
+
pdfDoc.setKeywords([]);
|
|
165
|
+
pdfDoc.setProducer('');
|
|
166
|
+
pdfDoc.setCreator('');
|
|
167
|
+
|
|
168
|
+
// Save the optimized PDF
|
|
169
|
+
const optimizedPdfBytes = await pdfDoc.save();
|
|
170
|
+
fs.writeFileSync('docs/index.pdf', optimizedPdfBytes);
|
|
171
|
+
|
|
70
172
|
console.log('\n SPEC-UP-T: PDF generated successfully! Find the PDF in the same directory as the index.html file.' + "\n");
|
|
71
173
|
} catch (error) {
|
|
72
174
|
console.error('SPEC-UP-T: Error generating PDF:', error + "\n");
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file json-key-validator.js
|
|
3
|
+
* @description This script validates the presence of required keys in a JSON object loaded from 'specs.json'.
|
|
4
|
+
* It uses synchronous methods to read the file and check the keys. If any required key is missing, it logs an error.
|
|
5
|
+
* The script pauses execution and waits for the user to press ENTER before continuing.
|
|
6
|
+
*
|
|
7
|
+
* @requires fs - File system module to read the JSON file.
|
|
8
|
+
* @requires readline-sync - Module to pause the script and wait for user input.
|
|
9
|
+
*/
|
|
10
|
+
|
|
1
11
|
const fs = require('fs');
|
|
2
12
|
const readlineSync = require('readline-sync');
|
|
3
13
|
|
|
@@ -8,22 +18,27 @@ function pauseForEnterSync() {
|
|
|
8
18
|
readlineSync.question('Press ENTER to continue...');
|
|
9
19
|
}
|
|
10
20
|
|
|
21
|
+
// Load the JSON data from the 'specs.json' file
|
|
11
22
|
function loadData() {
|
|
12
23
|
return JSON.parse(fs.readFileSync('./specs.json', 'utf8'));
|
|
13
24
|
}
|
|
14
25
|
|
|
26
|
+
// This function recursively checks if the required keys are present in the object
|
|
15
27
|
function checkKeysSync(object, expectedKeys, parentKey = '') {
|
|
16
28
|
for (let key of expectedKeys) {
|
|
17
29
|
if (Array.isArray(object)) {
|
|
30
|
+
// If the object is an array, check each item within the array
|
|
18
31
|
for (let [index, item] of object.entries()) {
|
|
19
32
|
checkKeysSync(item, expectedKeys, `${parentKey}[${index}]`);
|
|
20
33
|
}
|
|
21
34
|
} else if (typeof object === 'object') {
|
|
35
|
+
// If the key is missing from the object, log an error
|
|
22
36
|
if (!(key in object)) {
|
|
23
37
|
console.error(`\n SPEC-UP-T: Error: Missing key '${key}' in ${parentKey}\n We cannot guarantee that Spec-Up-T will work properly.\n Here is an example specs.json file:\n https://github.com/blockchainbird/spec-up-t-starter-pack/blob/main/spec-up-t-starterpack/specs.json` + "\n");
|
|
24
38
|
errorFound = true;
|
|
25
|
-
pauseForEnterSync(); // Pause synchronously
|
|
39
|
+
pauseForEnterSync(); // Pause synchronously to allow user to acknowledge the error
|
|
26
40
|
}
|
|
41
|
+
// If the expected key contains nested objects, recursively check for them
|
|
27
42
|
if (typeof expectedKeys[key] === 'object' && object[key]) {
|
|
28
43
|
checkKeysSync(object[key], expectedKeys[key], `${parentKey}.${key}`);
|
|
29
44
|
}
|
|
@@ -31,8 +46,11 @@ function checkKeysSync(object, expectedKeys, parentKey = '') {
|
|
|
31
46
|
}
|
|
32
47
|
}
|
|
33
48
|
|
|
49
|
+
// Main function that runs the validator script
|
|
34
50
|
function runJsonKeyValidatorSync() {
|
|
35
|
-
const data = loadData();
|
|
51
|
+
const data = loadData(); // Load the JSON file data
|
|
52
|
+
|
|
53
|
+
// Define the keys expected in the JSON structure
|
|
36
54
|
const expectedKeys = {
|
|
37
55
|
specs: [
|
|
38
56
|
"title",
|
|
@@ -45,7 +63,7 @@ function runJsonKeyValidatorSync() {
|
|
|
45
63
|
"source",
|
|
46
64
|
"external_specs",
|
|
47
65
|
"external_specs_repos",
|
|
48
|
-
"assets"
|
|
66
|
+
// "assets" // Commented out: We no longer check for 'assets' in the specs object
|
|
49
67
|
],
|
|
50
68
|
source: [
|
|
51
69
|
"host",
|
|
@@ -57,30 +75,38 @@ function runJsonKeyValidatorSync() {
|
|
|
57
75
|
"url",
|
|
58
76
|
"terms_dir"
|
|
59
77
|
],
|
|
60
|
-
assets:
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
78
|
+
// Removed the 'assets' block entirely, as it's no longer part of the required keys:
|
|
79
|
+
// assets: [
|
|
80
|
+
// "path",
|
|
81
|
+
// "inject",
|
|
82
|
+
// "module"
|
|
83
|
+
// ]
|
|
65
84
|
};
|
|
66
85
|
|
|
86
|
+
// Iterate over each spec entry in the specs array from the JSON file
|
|
67
87
|
for (let [index, spec] of data.specs.entries()) {
|
|
68
88
|
console.log(`\n SPEC-UP-T: Checking spec #${index + 1}` + "\n");
|
|
89
|
+
|
|
90
|
+
// Check for keys defined in expectedKeys.specs
|
|
69
91
|
checkKeysSync(spec, expectedKeys.specs, `specs[${index}]`);
|
|
70
92
|
|
|
93
|
+
// Check for keys inside the 'source' object, if present
|
|
71
94
|
if (spec.source) {
|
|
72
95
|
checkKeysSync(spec.source, expectedKeys.source, `specs[${index}].source`);
|
|
73
96
|
}
|
|
74
97
|
|
|
98
|
+
// Check for keys inside the 'external_specs_repos' array, if present
|
|
75
99
|
if (spec.external_specs_repos) {
|
|
76
100
|
checkKeysSync(spec.external_specs_repos, expectedKeys.external_specs_repos, `specs[${index}].external_specs_repos`);
|
|
77
101
|
}
|
|
78
102
|
|
|
103
|
+
// The assets check is no longer necessary and has been commented out
|
|
79
104
|
// if (spec.assets) {
|
|
80
105
|
// checkKeysSync(spec.assets, expectedKeys.assets, `specs[${index}].assets`);
|
|
81
106
|
// }
|
|
82
107
|
}
|
|
83
108
|
|
|
109
|
+
// If no errors were found, print a success message
|
|
84
110
|
if (!errorFound) {
|
|
85
111
|
console.log('\n SPEC-UP-T: All keys are present. No errors found. Continuing…' + "\n");
|
|
86
112
|
}
|
package/templates/template.html
CHANGED
|
@@ -66,6 +66,7 @@
|
|
|
66
66
|
</div>
|
|
67
67
|
<!-- href added via JS -->
|
|
68
68
|
<div class="snapshots"><a href="#">Snapshots</a></div>
|
|
69
|
+
<div class="powered-by"><a href="https://github.com/trustoverip/spec-up-t" target="_blank" rel="noopener">Powered By Spec-Up-T</a></div>
|
|
69
70
|
</slide-panel>
|
|
70
71
|
</slide-panels>
|
|
71
72
|
<div style="display: none;">
|