spec-up-t 1.5.0 → 1.6.0-beta.1
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 +1 -0
- package/assets/compiled/head.css +3 -3
- package/assets/css/index.css +5 -4
- package/assets/css/refs.css +30 -0
- package/assets/css/terms-and-definitions.css +89 -1
- package/assets/js/insert-irefs.js +214 -0
- package/config/asset-map.json +2 -1
- package/package.json +1 -1
- package/src/create-docx.js +13 -6
- package/src/create-pdf.js +22 -18
- package/src/init.js +7 -3
- package/src/parsers/template-tag-parser.js +23 -1
- package/src/pipeline/references/collect-external-references.js +41 -14
- package/src/pipeline/references/external-references-service.js +60 -24
- package/src/pipeline/references/process-xtrefs-data.js +43 -19
- package/src/utils/logger.js +116 -9
- package/src/utils/regex-patterns.js +3 -1
- package/test/logger.test.js +290 -0
- package/assets/css/insert-trefs.css +0 -1
- package/src/utils/LOGGER.md +0 -81
package/assets/compiled/body.js
CHANGED
|
@@ -111,6 +111,7 @@ function showModal(e){const n=document.createElement("div");n.className="spec-up
|
|
|
111
111
|
function tokenInput(){document.querySelector(".button-token-input").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()}));
|
|
112
112
|
!function(){"use strict";const e=e=>document.querySelector(e);async function t(){const t=e(".service-menu");if(!t)return;const n=[{href:"./index.pdf",title:"Download this page as a PDF",cls:"button-pdf-download"},{href:"./index.docx",title:"Download this page as a DOCX",cls:"button-docx-download"}],o=await Promise.all(n.map((e=>{return t=e.href,fetch(t,{method:"HEAD"}).then((e=>e.ok)).catch((()=>!1));var t})));let r=t.firstElementChild;n.forEach(((n,a)=>{if(!o[a])return;if(s=n.cls,e(`.service-menu .${s}`))return;var s;const c=function(e,t,n){const o=document.createElement("a");return o.classList.add(n,"btn","d-block","btn-sm","btn-outline-secondary"),o.target="_blank",o.rel="noopener noreferrer",o.href=e,o.title=t,o.setAttribute("aria-label",t),o.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.5" class="me-1" viewBox="0 0 16 16"> <path d="M4 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V4.5L9.5 0H4zm0 1h5v4h4v9a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zm7 4h-1V2l3 3h-2z"/> </svg>',o}(n.href,n.title,n.cls);t.insertBefore(c,r),r=c}))}window.SpecUpDownloads={addButtons:t},document.addEventListener("DOMContentLoaded",t,{once:!1});try{document.dispatchEvent(new CustomEvent("specup-downloads-ready"))}catch(e){}}();
|
|
113
113
|
function insertTrefs(e){!function(e){const n=[];document.querySelectorAll("dl.terms-and-definitions-list dt span.term-external").forEach((e=>{const t=e.dataset.originalTerm,r=e.closest("dt");if(r){const e=r.nextElementSibling;if(e?.classList.contains("term-external")&&e.classList.contains("meta-info-content-wrapper"))return}n.push({element:e,textContent:t,dt:r,parent:r?.parentNode})}));const t=n.map((n=>{const{textContent:t,dt:r,parent:o}=n;if(!r||!o)return null;const i=e.xtrefs.find((e=>e.term===t)),a=document.createDocumentFragment(),s=document.createElement("dd");if(s.classList.add("term-external","meta-info-content-wrapper","collapsed"),i){const e=i.avatarUrl?``:"",n=i.owner||"Unknown",r=i.repo&&i.repoUrl?`[${i.repo}](${i.repoUrl})`:"Unknown",o=i.commitHash||"Unknown",d=i.ghPageUrl?new URL(`#term:${i.term}`,i.ghPageUrl).href:"Unknown",l=`\n| Property | Value |\n| -------- | ----- |\n| Original Term | ${t} |\n| Link | ${d} |\n| Owner | ${e} ${n} |\n| Repo | ${r} |\n| Commit hash | ${o} |\n `;s.innerHTML=md.render(l),a.appendChild(s);let c=i.content.split("\n").map((e=>e.replace(/^\s*~\s*/,""))).join("\n").replace(/\]\]/g,"");const m=document.createElement("div");m.innerHTML=md.render(c),m.querySelectorAll("a").forEach((e=>{const n=e=>{try{return null!==document.getElementById(e)}catch{return!1}};try{const t=new URL(e.href);if(t.hostname!==window.location.hostname)return;if(t.hash&&n(t.hash.slice(1)))return;e.replaceWith(...e.childNodes)}catch{if(e.href.startsWith("#")&&n(e.href.slice(1)))return;e.replaceWith(...e.childNodes)}})),c=m.innerHTML;const f=document.createElement("div");f.innerHTML=md.render(c);const p=f.querySelectorAll("dd");if(p.length>0)Array.from(p).forEach((e=>{const n=e.cloneNode(!0);n.classList.add("term-external","term-external-embedded"),a.appendChild(n)}));else{const e=document.createElement("dd");e.classList.add("term-external","term-external-embedded"),e.innerHTML=f.innerHTML,a.appendChild(e)}}else{s.innerHTML=md.render("\n| Property | Value |\n| -------- | ----- |\n| Owner | Unknown |\n| Repo | Unknown |\n| Commit hash | not found |\n "),a.appendChild(s);const e=document.createElement("dd");e.innerHTML="<p>This term was not found in the external repository.</p>",a.appendChild(e)}return{dt:r,parent:o,fragment:a}})).filter(Boolean);requestAnimationFrame((()=>{t.forEach((e=>{const{dt:n,parent:t,fragment:r}=e;t.insertBefore(r,n.nextSibling)})),document.dispatchEvent(new CustomEvent("trefs-inserted",{detail:{count:t.length}}))}))}(e)}function initializeOnTrefsInserted(e){let n=!1;document.addEventListener("trefs-inserted",(function(t){n||(n=!0,e(),t.detail&&console.log(`Collapsible definitions initialized after ${t.detail.count} xrefs were inserted`))})),setTimeout((()=>{n||(console.warn("trefs-inserted event was not received, initializing collapsible definitions anyway"),e(),n=!0)}),1e3)}document.addEventListener("DOMContentLoaded",(()=>{"undefined"!=typeof allXTrefs&&allXTrefs?.xtrefs?insertTrefs(allXTrefs):(console.error("allXTrefs is undefined or missing xtrefs property"),document.dispatchEvent(new CustomEvent("trefs-inserted",{detail:{count:0,error:"Missing xtrefs data"}})))}));
|
|
114
|
+
function insertIrefs(){!function(){const e=document.querySelectorAll("span.iref-placeholder");if(0===e.length)return void document.dispatchEvent(new CustomEvent("irefs-inserted",{detail:{count:0}}));const t=[];e.forEach((e=>{const n=e.dataset.irefTerm,r=e.dataset.irefOriginal;if(!n)return void console.warn("iref placeholder missing data-iref-term attribute",e);const i=document.querySelector(`dl.terms-and-definitions-list dt span#term\\:${n.replace(/:/g,"\\:")}`);if(!i){console.warn(`iref: term "${r}" (id: ${n}) not found in terms-and-definitions-list`);const i=document.createElement("div");i.className="iref-not-found",i.innerHTML=`<p class="text-warning"><em>[[iref: ${r}]] - Term not found in definitions list</em></p>`;const o=document.createDocumentFragment();return o.appendChild(i),void t.push({placeholder:e,fragment:o})}const o=i.closest("dt");if(!o)return void console.warn(`iref: could not find <dt> element for term "${r}"`);const d=document.createDocumentFragment(),l=document.createElement("div");l.className="iref-content";const s=document.createElement("dl");s.className="iref-definition-list";const c=o.cloneNode(!0);c.classList.add("iref-term"),c.classList.add("term-reference");const a=c.querySelector("a.toc-anchor");a&&a.remove();c.querySelectorAll("[id]").forEach((e=>{e.removeAttribute("id")}));const m=o.querySelector('[id^="term:"]');if(m){const e=m.getAttribute("id"),t=document.createElement("a");for(t.href=`#${e}`,t.className="iref-link-to-original",t.title=`Go to original definition of ${r}`;c.firstChild;)t.appendChild(c.firstChild);c.appendChild(t)}s.appendChild(c);let f=o.nextElementSibling;for(;f&&"dd"===f.tagName.toLowerCase();){const e=f.cloneNode(!0);e.classList.add("iref-definition"),s.appendChild(e),f=f.nextElementSibling}l.appendChild(s),d.appendChild(l),t.push({placeholder:e,fragment:d})})),requestAnimationFrame((()=>{t.forEach((e=>{const{placeholder:t,fragment:n}=e;t.parentNode.replaceChild(n,t)})),document.dispatchEvent(new CustomEvent("irefs-inserted",{detail:{count:t.length}})),console.log(`Inserted ${t.length} inline reference(s)`)}))}()}document.addEventListener("DOMContentLoaded",(()=>{document.querySelectorAll("span.iref-placeholder").length>0&&document.querySelectorAll("dl.terms-and-definitions-list dt.term-external").length>0?document.addEventListener("trefs-inserted",(()=>{insertIrefs()}),{once:!0}):insertIrefs()}));
|
|
114
115
|
function getOrCreateButtonContainer(t){let n=t.querySelector(".definition-buttons-container");return n||(n=document.createElement("div"),n.classList.add("definition-buttons-container"),t.appendChild(n)),n}function addButtonToContainer(t,n,e=!1){const i=getOrCreateButtonContainer(t);return e?i.insertBefore(n,i.firstChild):i.appendChild(n),i}
|
|
115
116
|
function collapseDefinitions(){let{dds:t,dts:e,regularDds:s,specialDds:a}=function(){const t=document.querySelectorAll("#content dl.terms-and-definitions-list > dd");return{dds:t,dts:document.querySelectorAll("#content dl.terms-and-definitions-list > dt"),regularDds:Array.from(t).filter((t=>!i(t.textContent.trim()))),specialDds:Array.from(t).filter((t=>i(t.textContent.trim())))}}();function i(t){return["Source","See also","More in","Also see","See:","See also","See more","See more in","See more about","See more on","See more at","More:","Note:","Paraphrased by","Beware:","eSSIF-Lab: ","W3C VC:","NIST:","Supporting definitions:"].some((e=>t.startsWith(e)))}a.forEach((t=>{t.classList.add("terms-def-extra-info")})),e.forEach((t=>{if(t.querySelector(".collapse-all-defs-button"))return;const e=document.createElement("button");e.classList.add("collapse-all-defs-button","btn-outline-secondary","d-print-none","btn","p-0","fs-5","d-flex","align-items-center","justify-content-center"),e.innerHTML='<span class="state-indicator" data-state="0">①</span><span class="state-indicator" data-state="1">②</span><span class="state-indicator" data-state="2">③</span>',e.setAttribute("id","toggleButton"),e.setAttribute("title","Change how much info is shown"),e.setAttribute("data-state","2"),e.querySelector('.state-indicator[data-state="2"]').classList.add("active"),addButtonToContainer(t,e)})),document.addEventListener("click",(e=>{if(e.target.classList.contains("collapse-all-defs-button")||e.target.classList.contains("state-indicator")){const i=e.target.classList.contains("collapse-all-defs-button")?e.target:e.target.closest(".collapse-all-defs-button"),n=i.getBoundingClientRect();document.documentElement.classList.add("definitions-transitioning"),i.style.position="fixed",i.style.top=`${n.top}px`,i.style.right=window.innerWidth-n.right+"px",i.style.zIndex="1000",function(){const e=document.querySelectorAll(".collapse-all-defs-button");switch((parseInt(e[0].dataset.state||0)+1)%3){case 0:t.forEach((t=>{t.classList.add("hidden"),t.classList.remove("visible")})),e.forEach((t=>{t.dataset.state=0,t.title="Show basic definitions",t.querySelectorAll(".state-indicator").forEach((t=>{0===parseInt(t.dataset.state)?t.classList.add("active"):t.classList.remove("active")}))})),document.querySelector("html").classList.add("defs-hidden");break;case 1:s.forEach((t=>{t.classList.remove("hidden"),t.classList.add("visible")})),a.forEach((t=>{t.classList.add("hidden"),t.classList.remove("visible")})),e.forEach((t=>{t.dataset.state=1,t.title="Show all definitions",t.querySelectorAll(".state-indicator").forEach((t=>{1===parseInt(t.dataset.state)?t.classList.add("active"):t.classList.remove("active")}))})),document.querySelector("html").classList.remove("defs-hidden");break;case 2:t.forEach((t=>{t.classList.remove("hidden"),t.classList.add("visible")})),a.forEach((t=>{t.classList.add("terms-def-extra-info")})),e.forEach((t=>{t.dataset.state=2,t.title="Hide all definitions",t.querySelectorAll(".state-indicator").forEach((t=>{2===parseInt(t.dataset.state)?t.classList.add("active"):t.classList.remove("active")}))})),document.querySelector("html").classList.remove("defs-hidden")}}(),requestAnimationFrame((()=>{i.style.position="",i.style.top="",i.style.right="",i.style.zIndex="",document.documentElement.classList.remove("definitions-transitioning");const t=i.getBoundingClientRect();window.scrollTo({top:window.scrollY+(t.top-n.top),behavior:"instant"})}))}}))}document.addEventListener("DOMContentLoaded",(function(){initializeOnTrefsInserted(collapseDefinitions)}));
|
|
116
117
|
function createToggleButton(e){const t=document.createElement("button");t.classList.add("meta-info-toggle-button","btn","fs-1","d-flex","align-items-center","justify-content-center"),t.innerHTML='<i class="bi bi-info-circle" style="margin-top: -0.5em;"></i>',t.title="Meta info",t.addEventListener("click",(function(t){t.preventDefault(),t.stopPropagation();e.classList.contains("collapsed")?(e.classList.remove("collapsed"),e.getBoundingClientRect()):e.classList.add("collapsed")}));let n=e.previousElementSibling;for(;n&&"DT"!==n.tagName;)n=n.previousElementSibling;n?addButtonToContainer(n,t,!0):e.insertBefore(t,e.firstChild)}function collapseMetaInfo(){document.querySelectorAll("dl > dd:has(table)").forEach((function(e){e.classList.add("meta-info-content-wrapper");const t=document.createElement("div");for(t.classList.add("meta-info-inner-wrapper");e.firstChild&&e.firstChild!==e.querySelector(".meta-info-toggle-button");)t.appendChild(e.firstChild);e.querySelector(".meta-info-toggle-button")||createToggleButton(e),e.appendChild(t),e.classList.add("collapsed")}))}document.addEventListener("DOMContentLoaded",(function(){initializeOnTrefsInserted(collapseMetaInfo)}));
|
package/assets/compiled/head.css
CHANGED
|
@@ -9,7 +9,7 @@ code[class*=language-],pre[class*=language-]{color:#000;background:0 0;text-shad
|
|
|
9
9
|
@keyframes chartjs-render-animation{from{opacity:.99}to{opacity:1}}.chartjs-render-monitor{animation:chartjs-render-animation 1ms}.chartjs-size-monitor,.chartjs-size-monitor-expand,.chartjs-size-monitor-shrink{position:absolute;direction:ltr;left:0;top:0;right:0;bottom:0;overflow:hidden;pointer-events:none;visibility:hidden;z-index:-1}.chartjs-size-monitor-expand>div{position:absolute;width:1000000px;height:1000000px;left:0;top:0}.chartjs-size-monitor-shrink>div{position:absolute;width:200%;height:200%;left:0;top:0}
|
|
10
10
|
#logo img{width:100px}.bi{display:inline-block;width:1.2rem;height:1.2rem}#header,#header *{background-color:var(--header-navbar-bg);color:var(--header-navbar-text)}[data-issue-count]:after{content:"(" attr(data-issue-count) ")";margin:0 0 0 .3em;padding:.1em 0 0}[data-issue-count=""][data-animate]{display:none;opacity:0}[data-issue-count][data-animate]:not([data-issue-count=""]){animation:display-show 1s}#header a:not(#logo),#header a:not(#logo) *,#header button,#header button *{background:#a9dde0}
|
|
11
11
|
.container{min-height:100vh}@media (min-width:768px){.sidebar{position:sticky;top:0;height:100vh;overflow-y:auto;z-index:100}}ul.toc{padding:1em 0 1.75em;font-size:.85em}ul.toc,ul.toc ul{margin:0;padding:0;list-style:none}ul.toc li a{display:block;padding:.4em .8em;text-decoration:none;color:var(--toc-text);transition:background .2s ease,padding-left .2s ease,border-left .2s ease;padding-left:.8em;border-left:3px solid transparent;border-bottom:1px solid rgba(0,0,0,.03)}ul.toc ul{margin-left:1.2em!important;margin-top:.3em}ul.toc a:hover{background:#f9f9f9;padding-left:1em;border-left:3px solid #007bff}ul.toc>li>ul>li>a{padding-left:1.5em}ul.toc>li>ul>li>ul>li>a{padding-left:2em}ul.toc a:focus{outline:2px solid #007bff;outline-offset:-2px;box-shadow:0 0 0 3px rgba(0,123,255,.25);position:relative;z-index:1}.spec-footer{font-size:.7em;text-align:center}ul.toc li a.active,ul.toc li a[aria-current=page]{border-left:3px solid #007bff;font-weight:500;background:#f0f0f0}ul.toc li:last-child a{border-bottom:none}#toc ul li{position:relative}#toc ul li.has-children{position:relative}.collapse-toggle{position:absolute;top:.35em;right:0;width:28px;height:28px;background:0 0;border:1px solid transparent;border-radius:3px;padding:0;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:background-color .2s,border-color .2s;z-index:2}.collapse-toggle:hover{background-color:rgba(0,0,0,.05)}.collapse-toggle:focus{outline:2px solid #007bff;outline-offset:1px;border-color:#007bff;box-shadow:0 0 0 3px rgba(0,123,255,.25)}.collapse-toggle::after{content:"";border-style:solid;border-width:.15em .15em 0 0;display:inline-block;height:.5em;width:.5em;position:relative;transform:rotate(135deg);transition:transform .2s ease}.collapse-toggle.collapsed::after{transform:rotate(45deg)}#toc ul li.has-children>ul{max-height:1000px;overflow:hidden;transition:max-height .3s ease-in-out,opacity .3s ease-in-out;opacity:1}#toc ul li.has-children.collapsed>ul{max-height:0;overflow:hidden;opacity:.6}.screen-reader-text{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.screen-reader-text:focus{width:auto;height:auto;clip:auto;display:block;padding:15px 23px 14px;background-color:#fff;color:#007bff;z-index:100000;font-size:1em;font-weight:700;text-decoration:none;line-height:normal;box-shadow:0 0 2px 2px rgba(0,0,0,.2)}
|
|
12
|
-
h2,h3,h4,h5,h6{margin-top:1.5em!important}#terminology-section-utility-container{margin:1em auto;width:100%}@media (min-width:576px){#terminology-section-utility-container{position:sticky;top:3.5em;z-index:10}}.toc-anchor{font-size:.875em;color:#73c2df;text-decoration:none;transition:opacity .3s ease}.toc-anchor:hover{opacity:1}dl.terms-and-definitions-list{margin:0;padding:0;position:relative;z-index:1}dl.terms-and-definitions-list>dt{font-weight:700;margin:0;background-color:var(--card-bg-dt);border:1px solid var(--card-border);padding:.5rem 1.25rem;border-radius:.375rem .375rem 0 0;color:var(--card-text);position:relative;line-height:1.5;font-size:1.05em;display:flex;flex-wrap:wrap;align-items:center;gap:.5rem;min-height:2.5rem}dl.terms-and-definitions-list>dt>span{flex:1 1 auto;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:all .2s ease-in-out}dl.terms-and-definitions-list>dt:focus>span,dl.terms-and-definitions-list>dt:hover>span,dl.terms-and-definitions-list>dt>span:focus,dl.terms-and-definitions-list>dt>span:hover{white-space:normal;overflow:visible;text-overflow:initial;word-wrap:break-word;line-height:1.4}dl.terms-and-definitions-list>dt:active>span,dl.terms-and-definitions-list>dt>span:active{white-space:normal;overflow:visible;text-overflow:initial;word-wrap:break-word;line-height:1.4}dl.terms-and-definitions-list>dt .btn{font-size:1.2em!important}dl.terms-and-definitions-list>dt:hover{background-color:var(--card-hover-bg);transition:background-color .2s ease-in-out}dl.terms-and-definitions-list>dd{margin:0;background-color:var(--card-bg);border:1px solid var(--card-border);border-top:none;padding:.5rem 2rem;color:var(--card-text);width:100%;position:relative}dl.terms-and-definitions-list dd p{margin:0;color:var(--card-text);padding-left:.5rem}dl.terms-and-definitions-list>dd::before{display:none}dl.terms-and-definitions-list dd table{margin:.5em 0;width:100%;border-collapse:collapse}dl.terms-and-definitions-list dd table td,dl.terms-and-definitions-list dd table th{padding:.5em;border:1px solid #ddd}dl.terms-and-definitions-list dd table th{background-color:#f5f5f5}dl>dd:has(table).meta-info-content-wrapper{display:block;font-size:.7em;position:relative;max-height:none;height:auto;overflow:visible;transition:all .3s ease-out}dl>dd:has(table).meta-info-content-wrapper td,dl>dd:has(table).meta-info-content-wrapper th{padding:.3em}dl>dd:has(table).collapsed.meta-info-content-wrapper{max-height:0;height:0;padding-top:0;padding-bottom:0;margin-top:0;margin-bottom:0;overflow:hidden;transition:all .3s ease-out;line-height:0}dl>dd:has(table).meta-info-content-wrapper>div{display:block;padding:inherit}.meta-info-toggle-button{position:relative;cursor:pointer}dl.terms-and-definitions-list dt+dd{border-bottom:none}dl.terms-and-definitions-list dd+dd{border-top:none;border-bottom:none}dl.terms-and-definitions-list dd+dt{margin-top:1rem}dl.terms-and-definitions-list dd.last-dd{border-radius:0 0 .375rem .375rem;border-bottom:1px solid var(--card-border)}html.dense-info dl.terms-and-definitions-list>dt{padding:.1rem 1.25rem;line-height:inherit;font-size:inherit;min-height:auto}html.dense-info dl.terms-and-definitions-list dd+dt{margin-top:.3rem}html.dense-info dl.terms-and-definitions-list>dt::before{display:none}html.dense-info dl.terms-and-definitions-list>dt>span{flex:1 1 auto;min-width:0}.term-external{position:relative}dl.terms-and-definitions-list>dd.term-external,dl.terms-and-definitions-list>dt.term-external{background:#a9dde03b}.term-local{position:relative}dl.terms-and-definitions-list>dd.term-local,dl.terms-and-definitions-list>dt.term-local{background:#f0f8ff}dl.terms-and-definitions-list .term-original-term{font-style:italic}dl.terms-and-definitions-list .term-external-parenthetical-terms{font-weight:400}dl.terms-and-definitions-list .term-local-original-term{font-style:italic}dl.terms-and-definitions-list .term-local-parenthetical-terms{font-weight:400}.btn{font-variant:small-caps;text-transform:uppercase;position:relative;z-index:5}.transclusion-heading{font-size:1.3em;font-weight:700;margin:.2em 0 .2em}dl.terms-and-definitions-list>dd.term-external-embedded{position:relative;padding-left:2.5rem;padding-top:.3rem;padding-bottom:.3rem}dl.terms-and-definitions-list span.term-external::after{content:"";position:absolute;top:50%;transform:translateY(-50%);background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' class='bi bi-box-arrow-right' viewBox='0 0 16 16' fill='currentColor'%3E%3Cpath fill-rule='evenodd' d='M10 12.5a.5.5 0 0 1-.5.5h-8a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5h8a.5.5 0 0 1 .5.5v2a.5.5 0 0 0 1 0v-2A1.5 1.5 0 0 0 9.5 2h-8A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h8a1.5 1.5 0 0 0 1.5-1.5v-2a.5.5 0 0 0-1 0v2z'/%3E%3Cpath fill-rule='evenodd' d='M15.854 8.354a.5.5 0 0 0 0-.708l-3-3a.5.5 0 0 0-.708.708L14.293 7.5H5.5a.5.5 0 0 0 0 1h8.793l-2.147 2.146a.5.5 0 0 0 .708.708l3-3z'/%3E%3C/svg%3E");background-size:contain;background-repeat:no-repeat;background-position:center;width:.8rem;height:.8rem;left:.2rem}dl.terms-and-definitions-list span.term-external{padding-left:1.5rem;display:inline-block}.placeholder-tref{display:none}.no-xref-found-message{background:#f8c481;color:#03365f;margin:0 .5em;padding:0 .8em;border-radius:.25rem;font-size:.8rem;font-variant:small-caps;text-transform:uppercase}
|
|
12
|
+
h2,h3,h4,h5,h6{margin-top:1.5em!important}#terminology-section-utility-container{margin:1em auto;width:100%}@media (min-width:576px){#terminology-section-utility-container{position:sticky;top:3.5em;z-index:10}}.toc-anchor{font-size:.875em;color:#73c2df;text-decoration:none;transition:opacity .3s ease}.toc-anchor:hover{opacity:1}dl.terms-and-definitions-list{margin:0;padding:0;position:relative;z-index:1}dl.terms-and-definitions-list>dt{font-weight:700;margin:0;background-color:var(--card-bg-dt);border:1px solid var(--card-border);padding:.5rem 1.25rem;border-radius:.375rem .375rem 0 0;color:var(--card-text);position:relative;line-height:1.5;font-size:1.05em;display:flex;flex-wrap:wrap;align-items:center;gap:.5rem;min-height:2.5rem}dl.terms-and-definitions-list>dt>span{flex:1 1 auto;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:all .2s ease-in-out}dl.terms-and-definitions-list>dt:focus>span,dl.terms-and-definitions-list>dt:hover>span,dl.terms-and-definitions-list>dt>span:focus,dl.terms-and-definitions-list>dt>span:hover{white-space:normal;overflow:visible;text-overflow:initial;word-wrap:break-word;line-height:1.4}dl.terms-and-definitions-list>dt:active>span,dl.terms-and-definitions-list>dt>span:active{white-space:normal;overflow:visible;text-overflow:initial;word-wrap:break-word;line-height:1.4}dl.terms-and-definitions-list>dt .btn{font-size:1.2em!important}dl.terms-and-definitions-list>dt:hover{background-color:var(--card-hover-bg);transition:background-color .2s ease-in-out}dl.terms-and-definitions-list>dd{margin:0;background-color:var(--card-bg);border:1px solid var(--card-border);border-top:none;padding:.5rem 2rem;color:var(--card-text);width:100%;position:relative}dl.terms-and-definitions-list dd p{margin:0;color:var(--card-text);padding-left:.5rem}dl.terms-and-definitions-list>dd::before{display:none}dl.terms-and-definitions-list dd table{margin:.5em 0;width:100%;border-collapse:collapse}dl.terms-and-definitions-list dd table td,dl.terms-and-definitions-list dd table th{padding:.5em;border:1px solid #ddd}dl.terms-and-definitions-list dd table th{background-color:#f5f5f5}dl>dd:has(table).meta-info-content-wrapper{display:block;font-size:.7em;position:relative;max-height:none;height:auto;overflow:visible;transition:all .3s ease-out}dl>dd:has(table).meta-info-content-wrapper td,dl>dd:has(table).meta-info-content-wrapper th{padding:.3em}dl>dd:has(table).collapsed.meta-info-content-wrapper{max-height:0;height:0;padding-top:0;padding-bottom:0;margin-top:0;margin-bottom:0;overflow:hidden;transition:all .3s ease-out;line-height:0}dl>dd:has(table).meta-info-content-wrapper>div{display:block;padding:inherit}.meta-info-toggle-button{position:relative;cursor:pointer}dl.terms-and-definitions-list dt+dd{border-bottom:none}dl.terms-and-definitions-list dd+dd{border-top:none;border-bottom:none}dl.terms-and-definitions-list dd+dt{margin-top:1rem}dl.terms-and-definitions-list dd.last-dd{border-radius:0 0 .375rem .375rem;border-bottom:1px solid var(--card-border)}html.dense-info dl.terms-and-definitions-list>dt{padding:.1rem 1.25rem;line-height:inherit;font-size:inherit;min-height:auto}html.dense-info dl.terms-and-definitions-list dd+dt{margin-top:.3rem}html.dense-info dl.terms-and-definitions-list>dt::before{display:none}html.dense-info dl.terms-and-definitions-list>dt>span{flex:1 1 auto;min-width:0}.term-external{position:relative}dl.terms-and-definitions-list>dd.term-external,dl.terms-and-definitions-list>dt.term-external{background:#a9dde03b}.term-local{position:relative}dl.terms-and-definitions-list>dd.term-local,dl.terms-and-definitions-list>dt.term-local{background:#f0f8ff}dl.terms-and-definitions-list .term-original-term{font-style:italic}dl.terms-and-definitions-list .term-external-parenthetical-terms{font-weight:400}dl.terms-and-definitions-list .term-local-original-term{font-style:italic}dl.terms-and-definitions-list .term-local-parenthetical-terms{font-weight:400}.btn{font-variant:small-caps;text-transform:uppercase;position:relative;z-index:5}.transclusion-heading{font-size:1.3em;font-weight:700;margin:.2em 0 .2em}dl.terms-and-definitions-list>dd.term-external-embedded{position:relative;padding-left:2.5rem;padding-top:.3rem;padding-bottom:.3rem}dl.terms-and-definitions-list span.term-external::after{content:"";position:absolute;top:50%;transform:translateY(-50%);background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' class='bi bi-box-arrow-right' viewBox='0 0 16 16' fill='currentColor'%3E%3Cpath fill-rule='evenodd' d='M10 12.5a.5.5 0 0 1-.5.5h-8a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5h8a.5.5 0 0 1 .5.5v2a.5.5 0 0 0 1 0v-2A1.5 1.5 0 0 0 9.5 2h-8A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h8a1.5 1.5 0 0 0 1.5-1.5v-2a.5.5 0 0 0-1 0v2z'/%3E%3Cpath fill-rule='evenodd' d='M15.854 8.354a.5.5 0 0 0 0-.708l-3-3a.5.5 0 0 0-.708.708L14.293 7.5H5.5a.5.5 0 0 0 0 1h8.793l-2.147 2.146a.5.5 0 0 0 .708.708l3-3z'/%3E%3C/svg%3E");background-size:contain;background-repeat:no-repeat;background-position:center;width:.8rem;height:.8rem;left:.2rem}dl.terms-and-definitions-list span.term-external{padding-left:1.5rem;display:inline-block}.placeholder-tref{display:none}.no-xref-found-message{background:#f8c481;color:#03365f;margin:0 .5em;padding:0 .8em;border-radius:.25rem;font-size:.8rem;font-variant:small-caps;text-transform:uppercase}.iref-content{margin:1rem 0}dl.iref-definition-list{margin:0;padding:0}dl.iref-definition-list>dt.iref-term{font-weight:700;margin:0;background-color:var(--card-bg-dt);border:1px solid var(--card-border);padding:.5rem 1.25rem;border-radius:.375rem .375rem 0 0;color:var(--card-text);position:relative;line-height:1.5;font-size:1.05em;display:flex;flex-wrap:wrap;align-items:center;gap:.5rem;min-height:2.5rem;opacity:.95}dl.iref-definition-list>dd.iref-definition{margin:0;background-color:var(--card-bg);border:1px solid var(--card-border);border-top:none;padding:.5rem 2rem;color:var(--card-text);width:100%;position:relative;opacity:.95}dl.iref-definition-list>dd.iref-definition+dd.iref-definition{border-top:1px dashed var(--card-border)}dl.iref-definition-list>dd.iref-definition:last-child{border-radius:0 0 .375rem .375rem}dl.iref-definition-list dd.iref-definition p{margin:0;color:var(--card-text);padding-left:.5rem}a.iref-link-to-original{color:inherit;text-decoration:none;display:block;width:100%;transition:opacity .2s ease-in-out}a.iref-link-to-original:hover{opacity:.8;text-decoration:underline}.iref-not-found{margin:.5rem 0;padding:.5rem 1rem;background-color:#fff3cd;border:1px solid #ffc107;border-radius:.375rem;color:#856404}
|
|
13
13
|
.btn{font-size:.7em!important;margin:0 0 0 .5em!important}
|
|
14
14
|
.highlight-matches-search{font-size:1em;outline:3px solid #1d6dae39;outline-offset:5px;transition:outline .3s ease-in-out}.highlight-matches-search.active{outline:3px solid #1d6dae;transition:outline .3s ease-in-out}.highlight-matches-DIF-search{background-color:#1d6dae11}.highlight-matches-ToIP-search{background-color:#a9dde0b0}.highlight-matches-BTC-search{background-color:#f19019a1}.highlight-matches-KERI-search{background-color:#b5d070d5}.highlight-matches-SSI-search{background-color:#ff0}.highlight-matches-GLEIF-search{background-color:#52dac6a6}
|
|
15
15
|
.highlight-cfib41dyhcd99sm{background-color:#1d6dae11}
|
|
@@ -30,5 +30,5 @@ article a[href^="https://"]:not(.btn)::after,article a[href^=http]:not(.btn)::af
|
|
|
30
30
|
#content .figure:has(.scrollHintImage){padding:0;margin:0;width:auto;height:auto}
|
|
31
31
|
.highlight2{padding-left:1em;padding-right:1em;border:1px dashed #71bbe6;background:#a9dde03b}
|
|
32
32
|
#toc ul.toc{counter-reset:toc-section}#toc ul.toc>li{counter-reset:toc-subsection}#toc ul.toc>li>ul>li{counter-reset:toc-subsubsection}#toc ul.toc>li>a::before{counter-increment:toc-section;content:counter(toc-section) ". ";font-weight:700;margin-right:.5em}#toc ul.toc>li>ul>li>a::before{counter-increment:toc-subsection;content:counter(toc-section) "." counter(toc-subsection) " ";font-weight:700;margin-right:.5em}#toc ul.toc>li>ul>li>ul>li>a::before{counter-increment:toc-subsubsection;content:counter(toc-section) "." counter(toc-subsection) "." counter(toc-subsubsection) " ";font-weight:700;margin-right:.5em}main article{counter-reset:main-section}main article h2{counter-reset:main-subsection}main article h3{counter-reset:main-subsubsection}main article h2 .toc-anchor::after{counter-increment:main-section;content:" " counter(main-section) ".";font-weight:700}main article h3 .toc-anchor::after{counter-increment:main-subsection;content:" " counter(main-section) "." counter(main-subsection);font-weight:700}main article h4 .toc-anchor::after{counter-increment:main-subsubsection;content:" " counter(main-section) "." counter(main-subsection) "." counter(main-subsubsection);font-weight:700}main article h5::before,main article h6::before{font-weight:700;margin-right:.5em}@media print{#toc ul.toc>li>a::before,#toc ul.toc>li>ul>li>a::before,#toc ul.toc>li>ul>li>ul>li>a::before,main article h2 .toc-anchor::after,main article h3 .toc-anchor::after,main article h4 .toc-anchor::after{color:#000!important}}
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
.term-reference{padding:3px;background-color:#eaf5fb;border-radius:7px;position:relative;padding-left:1.5em;text-decoration:none;box-shadow:inset 0 0 0 1px #a9d9f5;transition:box-shadow .3s ease-in-out}.term-reference:hover{box-shadow:inset 0 0 0 3px #a9d9f5}.term-reference::after{content:"";position:absolute;top:50%;transform:translateY(-50%);background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' class='bi bi-box-arrow-right' viewBox='0 0 16 16' fill='currentColor'%3E%3Cpath fill-rule='evenodd' d='M10 12.5a.5.5 0 0 1-.5.5h-8a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5h8a.5.5 0 0 1 .5.5v2a.5.5 0 0 0 1 0v-2A1.5 1.5 0 0 0 9.5 2h-8A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h8a1.5 1.5 0 0 0 1.5-1.5v-2a.5.5 0 0 0-1 0v2z'/%3E%3Cpath fill-rule='evenodd' d='M15.854 8.354a.5.5 0 0 0 0-.708l-3-3a.5.5 0 0 0-.708.708L14.293 7.5H5.5a.5.5 0 0 0 0 1h8.793l-2.147 2.146a.5.5 0 0 0 .708.708l3-3z'/%3E%3C/svg%3E");background-size:contain;background-repeat:no-repeat;background-position:center;width:.8rem;height:.8rem;left:.2rem}
|
|
34
|
+
html{scroll-behavior:smooth;scroll-padding-top:50vh}body:not([hashscroll]) :target{animation:highlight-target 3.5s .25s ease}body:not([hashscroll]) dt:has(:target){animation:highlight-target-parent-dt 3.5s .25s ease}dl.terms-and-definitions-list>.highlight{background-color:#ff0!important;transition:background-color .3s ease-in-out}svg[icon]{width:1.25em;height:1.25em;vertical-align:text-top}@keyframes highlight-target{50%{background-color:#ff0}}@keyframes highlight-target-parent-dt{50%{background-color:#ff0;border:1px solid #00c8ff}}#svg{display:none}main *{overflow-wrap:anywhere;word-break:normal}.table-responsive{overflow-x:auto!important;-webkit-overflow-scrolling:touch;width:100%;max-width:100%}.table-responsive *{overflow-wrap:normal!important;word-break:normal!important;white-space:nowrap!important}dd td img{max-width:30px}.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,sans-serif}.example pre[class*=language-]{padding:0;border-radius:0}.todo{background:#fbe4ff;border-color:#9700e2}.todo .notice-link{display:block;color:#6d00a2}.alert-primary{background-color:#f9fcff;border-color:#b2ebf2;color:#00838f}.alert-secondary{background-color:#f5f5f5;border-color:#e0e0e0;color:#616161}.alert-success{background-color:#e8f5e9;border-color:#c8e6c9;color:#388e3c}.alert-danger{background-color:#ffebee;border-color:#ef9a9a;color:#d32f2f}.alert-warning{background-color:#fffde7;border-color:#fff9c4;color:#f9a825}.alert-info{background-color:#e1f5fe;border-color:#b3e5fc;color:#0288d1}.alert-light{background-color:#f9f9f9;border-color:#eee;color:#424242}.alert-dark{background-color:#e0e0e0;border-color:#bdbdbd;color:#212121}.alert a{color:inherit;font-weight:700}.alert-primary a{color:#006064}.alert-success a{color:#2e7d32}.alert-danger a{color:#b71c1c}.alert-warning a{color:#f57f17}.alert-info a{color:#01579b}.alert-dark a{color:#000}[data-bs-theme=dark] .alert-primary{background-color:#004d40;border-color:#00695c;color:#b2dfdb}[data-bs-theme=dark] .alert-secondary{background-color:#424242;border-color:#616161;color:#e0e0e0}[data-bs-theme=dark] .alert-success{background-color:#1b5e20;border-color:#2e7d32;color:#a5d6a7}[data-bs-theme=dark] .alert-danger{background-color:#b71c1c;border-color:#c62828;color:#ef9a9a}[data-bs-theme=dark] .alert-warning{background-color:#f57f17;border-color:#ffb300;color:#ffe082}[data-bs-theme=dark] .alert-info{background-color:#01579b;border-color:#0277bd;color:#81d4fa}[data-bs-theme=dark] .alert-light{background-color:#303030;border-color:#424242;color:#e0e0e0}[data-bs-theme=dark] .alert-dark{background-color:#212121;border-color:#424242;color:#bdbdbd}[data-bs-theme=dark] .alert a{color:inherit;font-weight:700}[data-bs-theme=dark] .alert-primary a{color:#80cbc4}[data-bs-theme=dark] .alert-success a{color:#81c784}[data-bs-theme=dark] .alert-danger a{color:#ef5350}[data-bs-theme=dark] .alert-warning a{color:#ffca28}[data-bs-theme=dark] .alert-info a{color:#4fc3f7}[data-bs-theme=dark] .alert-dark a{color:#9e9e9e}#offcanvasSettings .btn-menu-item{border-radius:unset;width:100%;text-align:left;border:1px solid #dee2e6;background-color:var(--card-bg);color:var(--card-text);padding:10px 15px;margin-bottom:5px;transition:background-color .2s ease}#offcanvasSettings .btn-menu-item:hover{background-color:#e9ecef}
|
package/assets/css/index.css
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
scroll-
|
|
3
|
-
/*
|
|
1
|
+
html {
|
|
2
|
+
scroll-behavior: smooth;
|
|
3
|
+
/* This creates a padding zone at the top for anchor scroll calculations *
|
|
4
|
+
* Elements will be scrolled so they appear 50vh from the top of viewport */
|
|
5
|
+
scroll-padding-top: 50vh;
|
|
4
6
|
}
|
|
5
7
|
|
|
6
|
-
|
|
7
8
|
/*
|
|
8
9
|
- When a URL fragment targets an element,
|
|
9
10
|
the `:target` pseudo-class triggers the corresponding CSS rules.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
.term-reference {
|
|
2
|
+
padding: 3px;
|
|
3
|
+
background-color: #eaf5fb;
|
|
4
|
+
border-radius: 7px;
|
|
5
|
+
position: relative;
|
|
6
|
+
padding-left: 1.5em;
|
|
7
|
+
text-decoration: none;
|
|
8
|
+
box-shadow: inset 0 0 0 1px #a9d9f5;
|
|
9
|
+
transition: box-shadow 0.3s ease-in-out;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.term-reference:hover {
|
|
13
|
+
box-shadow: inset 0 0 0 3px #a9d9f5;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/* Arrow styling for term references */
|
|
17
|
+
.term-reference::after {
|
|
18
|
+
content: "";
|
|
19
|
+
position: absolute;
|
|
20
|
+
top: 50%;
|
|
21
|
+
transform: translateY(-50%);
|
|
22
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' class='bi bi-box-arrow-right' viewBox='0 0 16 16' fill='currentColor'%3E%3Cpath fill-rule='evenodd' d='M10 12.5a.5.5 0 0 1-.5.5h-8a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5h8a.5.5 0 0 1 .5.5v2a.5.5 0 0 0 1 0v-2A1.5 1.5 0 0 0 9.5 2h-8A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h8a1.5 1.5 0 0 0 1.5-1.5v-2a.5.5 0 0 0-1 0v2z'/%3E%3Cpath fill-rule='evenodd' d='M15.854 8.354a.5.5 0 0 0 0-.708l-3-3a.5.5 0 0 0-.708.708L14.293 7.5H5.5a.5.5 0 0 0 0 1h8.793l-2.147 2.146a.5.5 0 0 0 .708.708l3-3z'/%3E%3C/svg%3E");
|
|
23
|
+
background-size: contain;
|
|
24
|
+
background-repeat: no-repeat;
|
|
25
|
+
background-position: center;
|
|
26
|
+
width: 0.8rem;
|
|
27
|
+
height: 0.8rem;
|
|
28
|
+
left: 0.2rem;
|
|
29
|
+
|
|
30
|
+
}
|
|
@@ -359,4 +359,92 @@ dl.terms-and-definitions-list span.term-external {
|
|
|
359
359
|
font-size: 0.8rem;
|
|
360
360
|
font-variant: small-caps;
|
|
361
361
|
text-transform: uppercase;
|
|
362
|
-
}
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
/* ====== INLINE REFERENCE (IREF) STYLING ====== */
|
|
365
|
+
/* Wrapper for iref content */
|
|
366
|
+
.iref-content {
|
|
367
|
+
margin: 1rem 0;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
/* Definition list within iref - use similar styling to main terms list */
|
|
371
|
+
dl.iref-definition-list {
|
|
372
|
+
margin: 0;
|
|
373
|
+
padding: 0;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
/* Term styling for iref */
|
|
377
|
+
dl.iref-definition-list > dt.iref-term {
|
|
378
|
+
font-weight: 700;
|
|
379
|
+
margin: 0;
|
|
380
|
+
background-color: var(--card-bg-dt);
|
|
381
|
+
border: 1px solid var(--card-border);
|
|
382
|
+
padding: 0.5rem 1.25rem;
|
|
383
|
+
border-radius: 0.375rem 0.375rem 0 0;
|
|
384
|
+
color: var(--card-text);
|
|
385
|
+
position: relative;
|
|
386
|
+
line-height: 1.5;
|
|
387
|
+
font-size: 1.05em;
|
|
388
|
+
display: flex;
|
|
389
|
+
flex-wrap: wrap;
|
|
390
|
+
align-items: center;
|
|
391
|
+
gap: 0.5rem;
|
|
392
|
+
min-height: 2.5rem;
|
|
393
|
+
opacity: 0.95;
|
|
394
|
+
/* Slightly transparent to show it's a copy */
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
/* Definition styling for iref */
|
|
398
|
+
dl.iref-definition-list > dd.iref-definition {
|
|
399
|
+
margin: 0;
|
|
400
|
+
background-color: var(--card-bg);
|
|
401
|
+
border: 1px solid var(--card-border);
|
|
402
|
+
border-top: none;
|
|
403
|
+
padding: 0.5rem 2rem;
|
|
404
|
+
color: var(--card-text);
|
|
405
|
+
width: 100%;
|
|
406
|
+
position: relative;
|
|
407
|
+
opacity: 0.95;
|
|
408
|
+
/* Slightly transparent to show it's a copy */
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
/* Add spacing between consecutive iref dd elements */
|
|
412
|
+
dl.iref-definition-list > dd.iref-definition + dd.iref-definition {
|
|
413
|
+
border-top: 1px dashed var(--card-border);
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
/* Last dd in iref gets rounded bottom corners */
|
|
417
|
+
dl.iref-definition-list > dd.iref-definition:last-child {
|
|
418
|
+
border-radius: 0 0 0.375rem 0.375rem;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
/* Style paragraphs inside iref dd */
|
|
422
|
+
dl.iref-definition-list dd.iref-definition p {
|
|
423
|
+
margin: 0;
|
|
424
|
+
color: var(--card-text);
|
|
425
|
+
padding-left: 0.5rem;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
/* Link to original term in iref dt */
|
|
429
|
+
a.iref-link-to-original {
|
|
430
|
+
color: inherit;
|
|
431
|
+
text-decoration: none;
|
|
432
|
+
display: block;
|
|
433
|
+
width: 100%;
|
|
434
|
+
transition: opacity 0.2s ease-in-out;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
a.iref-link-to-original:hover {
|
|
438
|
+
opacity: 0.8;
|
|
439
|
+
text-decoration: underline;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
/* iref not found message */
|
|
443
|
+
.iref-not-found {
|
|
444
|
+
margin: 0.5rem 0;
|
|
445
|
+
padding: 0.5rem 1rem;
|
|
446
|
+
background-color: #fff3cd;
|
|
447
|
+
border: 1px solid #ffc107;
|
|
448
|
+
border-radius: 0.375rem;
|
|
449
|
+
color: #856404;
|
|
450
|
+
}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Handles the insertion of inline reference copies (irefs) into HTML documentation.
|
|
3
|
+
* This script processes [[iref: term]] placeholders and replaces them with copies of existing
|
|
4
|
+
* term definitions from the terms-and-definitions-list. The copied terms maintain their
|
|
5
|
+
* original structure including all <dd> elements.
|
|
6
|
+
*
|
|
7
|
+
* The iref functionality allows you to display a term definition inline wherever you need it,
|
|
8
|
+
* without creating a link. It creates a DOM copy of the term's <dt> and <dd> elements.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Inserts inline reference copies (irefs) into the document.
|
|
13
|
+
* This function finds all iref placeholders and replaces them with copies of the
|
|
14
|
+
* corresponding term definitions from the terms-and-definitions-list.
|
|
15
|
+
*
|
|
16
|
+
* @returns {void}
|
|
17
|
+
*/
|
|
18
|
+
function insertIrefs() {
|
|
19
|
+
/**
|
|
20
|
+
* Processes all iref placeholders found in the document.
|
|
21
|
+
* Collects DOM changes before applying them in batch to improve performance.
|
|
22
|
+
*
|
|
23
|
+
* @returns {void} - Dispatches an 'irefs-inserted' event when complete
|
|
24
|
+
*/
|
|
25
|
+
function processIrefPlaceholders() {
|
|
26
|
+
/**
|
|
27
|
+
* Find all iref placeholder elements in the document
|
|
28
|
+
* @type {NodeListOf<Element>}
|
|
29
|
+
*/
|
|
30
|
+
const placeholders = document.querySelectorAll('span.iref-placeholder');
|
|
31
|
+
|
|
32
|
+
if (placeholders.length === 0) {
|
|
33
|
+
// No placeholders found, dispatch event and return
|
|
34
|
+
document.dispatchEvent(new CustomEvent('irefs-inserted', {
|
|
35
|
+
detail: { count: 0 }
|
|
36
|
+
}));
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Prepare all DOM changes before applying them
|
|
42
|
+
* Each item contains the placeholder and the fragment to replace it with
|
|
43
|
+
* @type {Array<{placeholder: Element, fragment: DocumentFragment}>}
|
|
44
|
+
*/
|
|
45
|
+
const domChanges = [];
|
|
46
|
+
|
|
47
|
+
placeholders.forEach((placeholder) => {
|
|
48
|
+
// Extract the term ID from the placeholder's data attribute
|
|
49
|
+
const termId = placeholder.dataset.irefTerm;
|
|
50
|
+
const originalTerm = placeholder.dataset.irefOriginal;
|
|
51
|
+
|
|
52
|
+
if (!termId) {
|
|
53
|
+
console.warn('iref placeholder missing data-iref-term attribute', placeholder);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Find the term in the terms-and-definitions-list by its ID
|
|
58
|
+
// The term ID is in the format "term:term-name"
|
|
59
|
+
const termElement = document.querySelector(
|
|
60
|
+
`dl.terms-and-definitions-list dt span#term\\:${termId.replace(/:/g, '\\:')}`
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
if (!termElement) {
|
|
64
|
+
console.warn(`iref: term "${originalTerm}" (id: ${termId}) not found in terms-and-definitions-list`);
|
|
65
|
+
|
|
66
|
+
// Create a "not found" message element
|
|
67
|
+
const notFoundEl = document.createElement('div');
|
|
68
|
+
notFoundEl.className = 'iref-not-found';
|
|
69
|
+
notFoundEl.innerHTML = `<p class="text-warning"><em>[[iref: ${originalTerm}]] - Term not found in definitions list</em></p>`;
|
|
70
|
+
|
|
71
|
+
const fragment = document.createDocumentFragment();
|
|
72
|
+
fragment.appendChild(notFoundEl);
|
|
73
|
+
|
|
74
|
+
domChanges.push({
|
|
75
|
+
placeholder: placeholder,
|
|
76
|
+
fragment: fragment
|
|
77
|
+
});
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// Find the <dt> element containing this term
|
|
82
|
+
const dtElement = termElement.closest('dt');
|
|
83
|
+
if (!dtElement) {
|
|
84
|
+
console.warn(`iref: could not find <dt> element for term "${originalTerm}"`);
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// Create a DocumentFragment to hold the copied elements
|
|
89
|
+
const fragment = document.createDocumentFragment();
|
|
90
|
+
|
|
91
|
+
// Create a wrapper div for the iref content
|
|
92
|
+
const wrapperDiv = document.createElement('div');
|
|
93
|
+
wrapperDiv.className = 'iref-content';
|
|
94
|
+
|
|
95
|
+
// Create a definition list to hold the copied term
|
|
96
|
+
const dl = document.createElement('dl');
|
|
97
|
+
dl.className = 'iref-definition-list';
|
|
98
|
+
|
|
99
|
+
// Clone the <dt> element
|
|
100
|
+
const clonedDt = dtElement.cloneNode(true);
|
|
101
|
+
clonedDt.classList.add('iref-term');
|
|
102
|
+
clonedDt.classList.add('term-reference');
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
// Remove the § anchor element from the cloned dt
|
|
106
|
+
const tocAnchor = clonedDt.querySelector('a.toc-anchor');
|
|
107
|
+
if (tocAnchor) {
|
|
108
|
+
tocAnchor.remove();
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// Remove all id attributes from the cloned dt to prevent duplicate IDs
|
|
112
|
+
// This is crucial so the link points to the ORIGINAL, not the clone
|
|
113
|
+
const elementsWithIds = clonedDt.querySelectorAll('[id]');
|
|
114
|
+
elementsWithIds.forEach(element => {
|
|
115
|
+
element.removeAttribute('id');
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
// Make the entire dt a link to the original term
|
|
119
|
+
// Find the term ID from the original dt element (not the clone)
|
|
120
|
+
const termIdSpan = dtElement.querySelector('[id^="term:"]');
|
|
121
|
+
if (termIdSpan) {
|
|
122
|
+
const termIdAttr = termIdSpan.getAttribute('id');
|
|
123
|
+
|
|
124
|
+
// Wrap the cloned dt content in a link
|
|
125
|
+
const link = document.createElement('a');
|
|
126
|
+
link.href = `#${termIdAttr}`;
|
|
127
|
+
link.className = 'iref-link-to-original';
|
|
128
|
+
link.title = `Go to original definition of ${originalTerm}`;
|
|
129
|
+
|
|
130
|
+
// Move all child nodes of clonedDt into the link
|
|
131
|
+
while (clonedDt.firstChild) {
|
|
132
|
+
link.appendChild(clonedDt.firstChild);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// Add the link back to the clonedDt
|
|
136
|
+
clonedDt.appendChild(link);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
dl.appendChild(clonedDt);
|
|
140
|
+
|
|
141
|
+
// Find and clone all associated <dd> elements
|
|
142
|
+
// Walk through siblings until we hit another <dt> or run out of elements
|
|
143
|
+
let nextElement = dtElement.nextElementSibling;
|
|
144
|
+
|
|
145
|
+
while (nextElement && nextElement.tagName.toLowerCase() === 'dd') {
|
|
146
|
+
const clonedDd = nextElement.cloneNode(true);
|
|
147
|
+
clonedDd.classList.add('iref-definition');
|
|
148
|
+
dl.appendChild(clonedDd);
|
|
149
|
+
nextElement = nextElement.nextElementSibling;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// Add the definition list to the wrapper
|
|
153
|
+
wrapperDiv.appendChild(dl);
|
|
154
|
+
|
|
155
|
+
// Add the wrapper to the fragment
|
|
156
|
+
fragment.appendChild(wrapperDiv);
|
|
157
|
+
|
|
158
|
+
// Store this change for batch processing
|
|
159
|
+
domChanges.push({
|
|
160
|
+
placeholder: placeholder,
|
|
161
|
+
fragment: fragment
|
|
162
|
+
});
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Perform all DOM replacements in a single batch using requestAnimationFrame
|
|
167
|
+
* to optimize browser rendering and prevent layout thrashing
|
|
168
|
+
*/
|
|
169
|
+
requestAnimationFrame(() => {
|
|
170
|
+
domChanges.forEach(change => {
|
|
171
|
+
const { placeholder, fragment } = change;
|
|
172
|
+
|
|
173
|
+
// Replace the placeholder with the fragment
|
|
174
|
+
placeholder.parentNode.replaceChild(fragment, placeholder);
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Dispatch a custom event when all DOM modifications are complete
|
|
179
|
+
* This allows other scripts to know when iref processing is done
|
|
180
|
+
* @fires irefs-inserted
|
|
181
|
+
*/
|
|
182
|
+
document.dispatchEvent(new CustomEvent('irefs-inserted', {
|
|
183
|
+
detail: { count: domChanges.length }
|
|
184
|
+
}));
|
|
185
|
+
|
|
186
|
+
console.log(`Inserted ${domChanges.length} inline reference(s)`);
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
processIrefPlaceholders();
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Initialize the inline references when the DOM is fully loaded.
|
|
195
|
+
* For external terms (trefs), we need to wait until insert-trefs.js has populated them.
|
|
196
|
+
* This event listener ensures that the DOM is ready before attempting to process irefs.
|
|
197
|
+
* @listens DOMContentLoaded
|
|
198
|
+
* @listens trefs-inserted
|
|
199
|
+
*/
|
|
200
|
+
document.addEventListener('DOMContentLoaded', () => {
|
|
201
|
+
// Check if there are any external terms that need to be populated first
|
|
202
|
+
const hasExternalTerms = document.querySelectorAll('span.iref-placeholder').length > 0 &&
|
|
203
|
+
document.querySelectorAll('dl.terms-and-definitions-list dt.term-external').length > 0;
|
|
204
|
+
|
|
205
|
+
if (hasExternalTerms) {
|
|
206
|
+
// Wait for trefs to be inserted first (they populate external term definitions)
|
|
207
|
+
document.addEventListener('trefs-inserted', () => {
|
|
208
|
+
insertIrefs();
|
|
209
|
+
}, { once: true }); // Use once: true to automatically remove listener after firing
|
|
210
|
+
} else {
|
|
211
|
+
// No external terms, can insert irefs immediately
|
|
212
|
+
insertIrefs();
|
|
213
|
+
}
|
|
214
|
+
});
|
package/config/asset-map.json
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"assets/css/horizontal-scroll-hint.css",
|
|
30
30
|
"assets/css/highlight-heading-plus-sibling-nodes.css",
|
|
31
31
|
"assets/css/counter.css",
|
|
32
|
-
"assets/css/
|
|
32
|
+
"assets/css/refs.css",
|
|
33
33
|
"assets/css/index.css"
|
|
34
34
|
],
|
|
35
35
|
"js": [
|
|
@@ -66,6 +66,7 @@
|
|
|
66
66
|
"assets/js/token-input.js",
|
|
67
67
|
"assets/js/download-pdf-docx.js",
|
|
68
68
|
"assets/js/insert-trefs.js",
|
|
69
|
+
"assets/js/insert-irefs.js",
|
|
69
70
|
"assets/js/definition-button-container-utils.js",
|
|
70
71
|
"assets/js/collapse-definitions.js",
|
|
71
72
|
"assets/js/collapse-meta-info.js",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "spec-up-t",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0-beta.1",
|
|
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": {
|
package/src/create-docx.js
CHANGED
|
@@ -173,7 +173,7 @@ function processInlineElements(node, textRuns) {
|
|
|
173
173
|
} else if (child.nodeType === 1) { // Element node
|
|
174
174
|
const tagName = child.tagName.toLowerCase();
|
|
175
175
|
const text = child.textContent.trim();
|
|
176
|
-
|
|
176
|
+
|
|
177
177
|
if (text) {
|
|
178
178
|
switch (tagName) {
|
|
179
179
|
case 'strong':
|
|
@@ -262,8 +262,11 @@ function createTitlePage(config) {
|
|
|
262
262
|
|
|
263
263
|
// Check if HTML file exists
|
|
264
264
|
if (!fs.existsSync(filePath)) {
|
|
265
|
-
Logger.error(
|
|
266
|
-
|
|
265
|
+
Logger.error('HTML file not found', {
|
|
266
|
+
context: 'Cannot generate DOCX without rendered HTML',
|
|
267
|
+
hint: 'Run "npm run render" first to generate the HTML file, then run "npm run docx"',
|
|
268
|
+
details: `Expected file: ${filePath}`
|
|
269
|
+
});
|
|
267
270
|
return;
|
|
268
271
|
}
|
|
269
272
|
|
|
@@ -325,9 +328,13 @@ function createTitlePage(config) {
|
|
|
325
328
|
// Write the DOCX file
|
|
326
329
|
fs.writeFileSync(docxPath, buffer);
|
|
327
330
|
|
|
328
|
-
|
|
331
|
+
Logger.success('DOCX generated successfully! Find the DOCX file in the docs directory.');
|
|
329
332
|
} catch (error) {
|
|
330
|
-
|
|
331
|
-
|
|
333
|
+
Logger.error('Error generating DOCX', {
|
|
334
|
+
context: 'Failed during DOCX document generation',
|
|
335
|
+
hint: 'Ensure the HTML file is valid and all dependencies are installed. Check that you have write permissions for the output directory',
|
|
336
|
+
details: error.message
|
|
337
|
+
});
|
|
338
|
+
process.exit(1);
|
|
332
339
|
}
|
|
333
340
|
})();
|
package/src/create-pdf.js
CHANGED
|
@@ -198,7 +198,7 @@ async function createTOCIfNeeded(page, logo, logoLink, title, description) {
|
|
|
198
198
|
// Insert the TOC after the title section
|
|
199
199
|
document.body.insertBefore(tocContainer, titleWrapper.nextSibling);
|
|
200
200
|
|
|
201
|
-
|
|
201
|
+
console.log('Generated a Table of Contents with ' + headings.length + ' entries.');
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
}, logo, logoLink, title, description);
|
|
@@ -254,7 +254,7 @@ async function createTOCIfNeeded(page, logo, logoLink, title, description) {
|
|
|
254
254
|
|
|
255
255
|
// If TOC doesn't exist, we'll need to create one
|
|
256
256
|
if (!document.getElementById('toc')) {
|
|
257
|
-
|
|
257
|
+
console.log('No TOC found in the document. Will create one.');
|
|
258
258
|
}
|
|
259
259
|
});
|
|
260
260
|
|
|
@@ -508,7 +508,7 @@ async function createTOCIfNeeded(page, logo, logoLink, title, description) {
|
|
|
508
508
|
}
|
|
509
509
|
});
|
|
510
510
|
|
|
511
|
-
|
|
511
|
+
Logger.process('Generating PDF with proper TOC page numbers...');
|
|
512
512
|
|
|
513
513
|
// First, generate a draft PDF to calculate the page positions of each heading
|
|
514
514
|
const draftPdfBuffer = await page.pdf({
|
|
@@ -530,28 +530,28 @@ async function createTOCIfNeeded(page, logo, logoLink, title, description) {
|
|
|
530
530
|
// Find the PDF TOC
|
|
531
531
|
const pdfToc = document.getElementById('pdf-toc');
|
|
532
532
|
if (!pdfToc) return;
|
|
533
|
-
|
|
533
|
+
|
|
534
534
|
const tocEntries = pdfToc.querySelectorAll('.toc-page-number');
|
|
535
535
|
const originalToc = document.getElementById('toc');
|
|
536
|
-
|
|
536
|
+
|
|
537
537
|
if (originalToc) {
|
|
538
538
|
// Get all links from the original TOC that have tooltip data
|
|
539
539
|
const originalLinks = originalToc.querySelectorAll('a[title], a[data-bs-title]');
|
|
540
|
-
|
|
540
|
+
|
|
541
541
|
// Create a mapping from heading IDs to page numbers based on tooltips
|
|
542
542
|
const idToPageMap = {};
|
|
543
|
-
|
|
543
|
+
|
|
544
544
|
originalLinks.forEach(link => {
|
|
545
545
|
// Extract the heading ID from href
|
|
546
546
|
const href = link.getAttribute('href');
|
|
547
547
|
if (!href || !href.startsWith('#')) return;
|
|
548
|
-
|
|
548
|
+
|
|
549
549
|
const headingId = href.substring(1);
|
|
550
|
-
|
|
550
|
+
|
|
551
551
|
// Extract page number from tooltip text (e.g., "Go to page 5")
|
|
552
552
|
const tooltipText = link.getAttribute('title') || link.getAttribute('data-bs-title');
|
|
553
553
|
if (!tooltipText) return;
|
|
554
|
-
|
|
554
|
+
|
|
555
555
|
const pageNumberMatch = tooltipText.match(/Go to page (\d+)/i);
|
|
556
556
|
if (pageNumberMatch && pageNumberMatch[1]) {
|
|
557
557
|
const pageNumber = parseInt(pageNumberMatch[1], 10);
|
|
@@ -560,7 +560,7 @@ async function createTOCIfNeeded(page, logo, logoLink, title, description) {
|
|
|
560
560
|
}
|
|
561
561
|
}
|
|
562
562
|
});
|
|
563
|
-
|
|
563
|
+
|
|
564
564
|
// Now update the TOC page numbers using the extracted values
|
|
565
565
|
tocEntries.forEach(entry => {
|
|
566
566
|
const targetId = entry.getAttribute('data-for-id');
|
|
@@ -578,10 +578,10 @@ async function createTOCIfNeeded(page, logo, logoLink, title, description) {
|
|
|
578
578
|
} else {
|
|
579
579
|
// Fallback to old estimation method if original TOC is not available
|
|
580
580
|
console.log('Original TOC not found, using page number estimation method');
|
|
581
|
-
|
|
581
|
+
|
|
582
582
|
// Find all headings with IDs (potential TOC targets)
|
|
583
583
|
const headingsWithIds = Array.from(document.querySelectorAll('h1, h2, h3, h4, h5, h6')).filter(h => h.id);
|
|
584
|
-
|
|
584
|
+
|
|
585
585
|
// Use real offsets for more accurate page numbers
|
|
586
586
|
const idToPosition = {};
|
|
587
587
|
|
|
@@ -643,12 +643,12 @@ async function createTOCIfNeeded(page, logo, logoLink, title, description) {
|
|
|
643
643
|
|
|
644
644
|
await browser.close();
|
|
645
645
|
|
|
646
|
-
|
|
646
|
+
Logger.success('PDF generated by Puppeteer. Processing with pdf-lib for ISO compliance...');
|
|
647
647
|
|
|
648
648
|
// Optimize PDF with pdf-lib for ISO compliance
|
|
649
649
|
try {
|
|
650
650
|
const pdfDoc = await pdfLib.PDFDocument.load(pdfBuffer);
|
|
651
|
-
|
|
651
|
+
|
|
652
652
|
// Set ISO-compliant metadata (this is safer than XMP embedding)
|
|
653
653
|
pdfDoc.setTitle(metadata.title);
|
|
654
654
|
pdfDoc.setAuthor(metadata.author);
|
|
@@ -666,7 +666,7 @@ async function createTOCIfNeeded(page, logo, logoLink, title, description) {
|
|
|
666
666
|
useObjectStreams: false, // Required for PDF/A compliance
|
|
667
667
|
addDefaultPage: false
|
|
668
668
|
});
|
|
669
|
-
|
|
669
|
+
|
|
670
670
|
fs.writeFileSync('docs/index.pdf', optimizedPdfBytes);
|
|
671
671
|
Logger.success('PDF saved with ISO compliance features.');
|
|
672
672
|
} catch (pdfError) {
|
|
@@ -675,8 +675,12 @@ async function createTOCIfNeeded(page, logo, logoLink, title, description) {
|
|
|
675
675
|
fs.writeFileSync('docs/index.pdf', pdfBuffer);
|
|
676
676
|
}
|
|
677
677
|
|
|
678
|
-
|
|
678
|
+
Logger.success('PDF generated successfully! Find the PDF in the docs directory.');
|
|
679
679
|
} catch (error) {
|
|
680
|
-
Logger.error('Error generating PDF
|
|
680
|
+
Logger.error('Error generating PDF', {
|
|
681
|
+
context: 'Failed during PDF document generation',
|
|
682
|
+
hint: 'Ensure the HTML file exists (run "npm run render" first), Puppeteer is installed, and you have write permissions',
|
|
683
|
+
details: error.message || error
|
|
684
|
+
});
|
|
681
685
|
}
|
|
682
686
|
})();
|