spec-up-t 1.0.26 → 1.0.28

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.
@@ -87,7 +87,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
87
87
  * @license MIT
88
88
  * @since 2024-06-09
89
89
  */
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),o=n.getAttribute("id").split(":")[1];n.innerHTML+=`<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}/${o}.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}/${o}.md" class="history-term-button btn">📅</a>`})}document.addEventListener("DOMContentLoaded",(function(){editTermButtons()}));
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
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 r=document.createElement("div");r.setAttribute("id","back-and-forth-buttons-container-"+n);const a=document.createElement("button");a.setAttribute("id","one-match-backward-"+n),a.setAttribute("disabled","disabled"),a.setAttribute("title","Go to previous match. Shortcut key: Left Arrow"),a.textContent="▲",r.appendChild(a);const s=document.createElement("button");s.setAttribute("id","one-match-forward-"+n),s.setAttribute("disabled","disabled"),s.setAttribute("title","Go to next match. Shortcut key: Right Arrow"),s.textContent="▼",r.appendChild(s),c.appendChild(r);const d=document.createElement("span");d.setAttribute("id","total-matches-"+n),d.innerHTML="0 matches",c.appendChild(d),o.addEventListener("input",(function(){f(o.value)}));const h="highlight-matches-"+n,l={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 g(){d.innerHTML=u+" matches"}const f=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."+h).forEach(e=>{Array.from(e.childNodes).forEach(t=>{t.nodeType===Node.ELEMENT_NODE&&e.removeChild(t)}),e.classList.contains(h)&&(e.outerHTML=e.innerHTML)})}(),u=0,m=-1,""===e)return void g();let t=0;!function i(c){if(3===c.nodeType){const i=function(i){const c=i.nodeValue,o=new RegExp(e,"gi");let r,a=0,s=document.createDocumentFragment();for(;null!==(r=o.exec(c));){s.appendChild(document.createTextNode(c.substring(a,r.index)));const e=document.createElement("span");e.textContent=r[0],e.classList.add(h),e.classList.add(l),e.setAttribute("id",n+"-"+t),s.appendChild(e),u=t+1,t++,a=r.index+r[0].length}return s.appendChild(document.createTextNode(c.substring(a))),s}(c);i.childNodes.length>1&&c.parentNode.replaceChild(i,c)}else 1===c.nodeType&&Array.from(c.childNodes).forEach(i)}(i);let c=document.querySelector("."+l);null!==c&&b(c);g(),p(),m=-1}),600);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()})),s.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":s.click();break;case"ArrowLeft":a.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()}));
@@ -118,11 +118,11 @@ function backToTop(){const n=document.createElement("a");n.id="back-to-top-a1znc
118
118
  * @since 2024-06-09
119
119
  */
120
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 &lt; &gt; <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 &lt; &gt; <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
- 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()}));
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="&times;",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
- function tokenInput(){let t=document.createElement("button");t.classList.add("button-token-input"),t.classList.add("btn"),t.innerHTML="&#128273;",document.querySelector("#container-search-h7vc6omi2hr2880").after(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()}));
125
+ function tokenInput(){let t=document.createElement("button");t.classList.add("button-token-input"),t.classList.add("btn"),t.innerHTML="&#128273;",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
126
  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);
127
127
  function createAlphabetIndex(){const e=document.getElementById("terms-and-definitions-intro"),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,d=e.charAt(e.indexOf("term:")+5).toUpperCase();n[d]||(n[d]=t.id)}});const d=document.createElement("div");d.className="alphabet-index",Object.keys(n).sort().forEach(e=>{const t=document.createElement("a");t.href="#"+n[e],t.textContent=e,d.appendChild(t)}),e.appendChild(d)}document.addEventListener("DOMContentLoaded",(function(){createAlphabetIndex()}));
128
128
  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()}));
@@ -21,7 +21,7 @@ function addAnchorsToTerms() {
21
21
  const a = document.createElement('a');
22
22
  a.setAttribute('href', `#${id}`);
23
23
  a.setAttribute('class', 'toc-anchor');
24
- a.innerHTML = '§ ';
24
+ a.innerHTML = '# '; // was '§';
25
25
  dt.parentNode.insertBefore(a, dt);
26
26
  });
27
27
  }
@@ -48,7 +48,7 @@ function editTermButtons() {
48
48
  const fileName = url.split(":")[1];
49
49
 
50
50
  // add edit and history buttons to term
51
- term.innerHTML += `<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/${cleanedSpecDir}/${specConfig.spec_terms_directory}/${fileName}.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/${cleanedSpecDir}/${specConfig.spec_terms_directory}/${fileName}.md" class="history-term-button btn">📅</a>`;
51
+ term.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/${cleanedSpecDir}/${specConfig.spec_terms_directory}/${fileName}.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/${cleanedSpecDir}/${specConfig.spec_terms_directory}/${fileName}.md" class="history-term-button btn">📅</a></span>`;
52
52
  });
53
53
  }
54
54
 
@@ -10,7 +10,7 @@ function tokenInput() {
10
10
  buttonTokenInput.classList.add("button-token-input");
11
11
  buttonTokenInput.classList.add("btn");
12
12
  buttonTokenInput.innerHTML = "&#128273;";
13
- document.querySelector('#container-search-h7vc6omi2hr2880').after(buttonTokenInput);
13
+ document.querySelector('#container-search-h7vc6omi2hr2880').appendChild(buttonTokenInput);
14
14
  buttonTokenInput.addEventListener('click', () => {
15
15
  const token = prompt('Please enter your GitHub token:');
16
16
 
package/index.js CHANGED
@@ -214,7 +214,7 @@ module.exports = function(options = {}) {
214
214
  tocFirstLevel: 2,
215
215
  tocLastLevel: 4,
216
216
  tocCallback: (_md, _tokens, html) => toc = html,
217
- anchorLinkSymbol: '§',
217
+ anchorLinkSymbol: '#', // was: §
218
218
  anchorClassName: 'toc-anchor'
219
219
  })
220
220
  .use(require('@traptitech/markdown-it-katex'))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spec-up-t",
3
- "version": "1.0.26",
3
+ "version": "1.0.28",
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": {