spec-up-t 1.0.74 → 1.0.76

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.
@@ -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}.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}
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.terms-and-definitions-list{margin:0;padding:0}dl.terms-and-definitions-list dt{font-weight:700;margin:0;background-color:#f0f0f0;border:1px solid #ccc;padding:10px;border-radius:5px 5px 0 0}dl.terms-and-definitions-list dd{margin:0;background-color:#f9f9f9;border:1px solid #ccc;border-top:none;padding:.5em 2em;border-bottom:none}dl.terms-and-definitions-list dd p{margin:0}dl.terms-and-definitions-list dd+dd{border-bottom:none}dl.terms-and-definitions-list dd+dt{margin-top:2em}dl.terms-and-definitions-list 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}
@@ -227,12 +227,13 @@ ol, ul {
227
227
  padding: 0 0 0 1.2em;
228
228
  }
229
229
 
230
- dl {
230
+ /* START: Definition list for terms */
231
+ dl.terms-and-definitions-list {
231
232
  margin: 0;
232
233
  padding: 0;
233
234
  }
234
235
 
235
- dt {
236
+ dl.terms-and-definitions-list dt {
236
237
  font-weight: bold;
237
238
  margin: 0;
238
239
  background-color: #f0f0f0;
@@ -241,7 +242,7 @@ dt {
241
242
  border-radius: 5px 5px 0 0;
242
243
  }
243
244
 
244
- dd {
245
+ dl.terms-and-definitions-list dd {
245
246
  margin: 0;
246
247
  background-color: #f9f9f9;
247
248
  border: 1px solid #ccc;
@@ -252,24 +253,26 @@ dd {
252
253
  /* Remove bottom borders for all dd's by default */
253
254
  }
254
255
 
255
- dd p {
256
+ dl.terms-and-definitions-list dd p {
256
257
  margin: 0;
257
258
  }
258
259
 
259
260
  /* Remove borders between consecutive <dd> elements */
260
- dd+dd {
261
+ dl.terms-and-definitions-list dd+dd {
261
262
  border-bottom: none;
262
263
  }
263
264
 
264
265
  /* Add a margin between the last <dd> and the next <dt> */
265
- dd+dt {
266
+ dl.terms-and-definitions-list dd+dt {
266
267
  margin-top: 2em;
267
268
  }
268
269
 
269
- dd.last-dd {
270
+ dl.terms-and-definitions-list dd.last-dd {
270
271
  border-radius: 0 0 5px 5px;
271
272
  border-bottom: 1px solid #ccc;
272
273
  }
274
+ /* END: Definition list for terms */
275
+
273
276
 
274
277
  main {
275
278
  box-sizing: border-box;
package/index.js CHANGED
@@ -2,6 +2,7 @@
2
2
  module.exports = function (options = {}) {
3
3
  const fs = require('fs-extra');
4
4
  const path = require('path');
5
+ const gulp = require('gulp');
5
6
 
6
7
  const {
7
8
  fetchExternalSpecs,
@@ -21,7 +22,6 @@ module.exports = function (options = {}) {
21
22
  const { insertTermIndex } = require('./src/insert-term-index.js');
22
23
  insertTermIndex();
23
24
 
24
- const gulp = require('gulp');
25
25
  const findPkgDir = require('find-pkg-dir');
26
26
  const modulePath = findPkgDir(__dirname);
27
27
  let config = fs.readJsonSync('./output/specs-generated.json');
@@ -29,6 +29,8 @@ module.exports = function (options = {}) {
29
29
  const createVersionsIndex = require('./src/create-versions-index.js');
30
30
  createVersionsIndex(config.specs[0].output_path);
31
31
 
32
+ const { fixMarkdownFiles } = require('./src/fix-markdown-files.js');
33
+
32
34
  let template = fs.readFileSync(path.join(modulePath, 'templates/template.html'), 'utf8');
33
35
  let assets = fs.readJsonSync(modulePath + '/src/asset-map.json');
34
36
  let externalReferences;
@@ -46,20 +48,24 @@ module.exports = function (options = {}) {
46
48
  return fs.readFileSync(path, 'utf8');
47
49
  }
48
50
  }
49
- ];
50
-
51
- const { processMarkdownFiles } = require('./src/fix-markdown-files.js');
51
+ ];
52
52
 
53
- // Synchonously process markdown files
54
- processMarkdownFiles(path.join(config.specs[0].spec_directory, config.specs[0].spec_terms_directory));
53
+ // Synchronously process markdown files
54
+ fixMarkdownFiles(path.join(config.specs[0].spec_directory, config.specs[0].spec_terms_directory));
55
+
56
+ function createScriptElementWithXrefDataForEmbeddingInHtml() {
57
+ // Test if xrefs-data.js exists, else make it an empty string
58
+ const inputPath = 'output/xrefs-data.js';
59
+ let xrefsData = "";
60
+ if (fs.existsSync(inputPath)) {
61
+ xrefsData = '<script>' + fs.readFileSync(inputPath, 'utf8') + '</script>';
62
+ }
55
63
 
56
- // Test if xrefs-data.js exists, else make it an empty string
57
- const inputPath = 'output/xrefs-data.js';
58
- let xrefsData = "";
59
- if (fs.existsSync(inputPath)) {
60
- xrefsData = '<script>' + fs.readFileSync(inputPath, 'utf8') + '</script>';
64
+ return xrefsData;
61
65
  }
62
66
 
67
+ const xrefsData = createScriptElementWithXrefDataForEmbeddingInHtml();
68
+
63
69
  function applyReplacers(doc) {
64
70
  return doc.replace(replacerRegex, function (match, type, args) {
65
71
  let replacer = replacers.find(r => type.trim().match(r.test));
@@ -101,6 +107,74 @@ module.exports = function (options = {}) {
101
107
  throw Error("katex distribution could not be located");
102
108
  }
103
109
 
110
+ // Custom plugin to add class to <dl> and the last <dd> in each series after a <dt>
111
+ function addClassToDefinitionList(md) {
112
+ const originalRender = md.renderer.rules.dl_open || function (tokens, idx, options, env, self) {
113
+ return self.renderToken(tokens, idx, options);
114
+ };
115
+
116
+ // Variable to keep track of whether the class has been added to the first <dl> after the target HTML
117
+ let classAdded = false;
118
+
119
+ md.renderer.rules.dl_open = function (tokens, idx, options, env, self) {
120
+
121
+ const targetHtml = 'terminology-section-start-h7vc6omi2hr2880';
122
+ let targetIndex = -1;
123
+
124
+ // Find the index of the target HTML
125
+ for (let i = 0; i < tokens.length; i++) {
126
+ if (tokens[i].content && tokens[i].content.includes(targetHtml)) {
127
+ targetIndex = i;
128
+ break;
129
+ }
130
+ }
131
+
132
+ // Add class to the first <dl> only if it comes after the target HTML
133
+ if (targetIndex !== -1 && idx > targetIndex && !classAdded) {
134
+ tokens[idx].attrPush(['class', 'terms-and-definitions-list']);
135
+ classAdded = true;
136
+ }
137
+
138
+ let lastDdIndex = -1;
139
+
140
+ for (let i = idx + 1; i < tokens.length; i++) {
141
+ if (tokens[i].type === 'dl_close') {
142
+ // Add class to the last <dd> before closing <dl>
143
+ if (lastDdIndex !== -1) {
144
+ const ddToken = tokens[lastDdIndex];
145
+ const classIndex = ddToken.attrIndex('class');
146
+ if (classIndex < 0) {
147
+ ddToken.attrPush(['class', 'last-dd']);
148
+ } else {
149
+ ddToken.attrs[classIndex][1] += ' last-dd';
150
+ }
151
+ }
152
+ break;
153
+ }
154
+
155
+ if (tokens[i].type === 'dt_open') {
156
+ // Add class to the last <dd> before a new <dt>
157
+ if (lastDdIndex !== -1) {
158
+ const ddToken = tokens[lastDdIndex];
159
+ const classIndex = ddToken.attrIndex('class');
160
+ if (classIndex < 0) {
161
+ ddToken.attrPush(['class', 'last-dd']);
162
+ } else {
163
+ ddToken.attrs[classIndex][1] += ' last-dd';
164
+ }
165
+ lastDdIndex = -1; // Reset for the next series
166
+ }
167
+ }
168
+
169
+ if (tokens[i].type === 'dd_open') {
170
+ lastDdIndex = i;
171
+ }
172
+ }
173
+
174
+ return originalRender(tokens, idx, options, env, self);
175
+ };
176
+ }
177
+
104
178
  try {
105
179
 
106
180
  var toc;
@@ -218,55 +292,7 @@ module.exports = function (options = {}) {
218
292
  })
219
293
  .use(require('@traptitech/markdown-it-katex'))
220
294
 
221
- // Custom plugin to add class to <dl> and the last <dd> in each series after a <dt>
222
- function addClassToDefinitionList(md) {
223
- const originalRender = md.renderer.rules.dl_open || function (tokens, idx, options, env, self) {
224
- return self.renderToken(tokens, idx, options);
225
- };
226
295
 
227
- md.renderer.rules.dl_open = function (tokens, idx, options, env, self) {
228
- // Add class to <dl>
229
- tokens[idx].attrPush(['class', 'terms-and-definitions-list']);
230
-
231
- let lastDdIndex = -1;
232
-
233
- for (let i = idx + 1; i < tokens.length; i++) {
234
- if (tokens[i].type === 'dl_close') {
235
- // Add class to the last <dd> before closing <dl>
236
- if (lastDdIndex !== -1) {
237
- const ddToken = tokens[lastDdIndex];
238
- const classIndex = ddToken.attrIndex('class');
239
- if (classIndex < 0) {
240
- ddToken.attrPush(['class', 'last-dd']);
241
- } else {
242
- ddToken.attrs[classIndex][1] += ' last-dd';
243
- }
244
- }
245
- break;
246
- }
247
-
248
- if (tokens[i].type === 'dt_open') {
249
- // Add class to the last <dd> before a new <dt>
250
- if (lastDdIndex !== -1) {
251
- const ddToken = tokens[lastDdIndex];
252
- const classIndex = ddToken.attrIndex('class');
253
- if (classIndex < 0) {
254
- ddToken.attrPush(['class', 'last-dd']);
255
- } else {
256
- ddToken.attrs[classIndex][1] += ' last-dd';
257
- }
258
- lastDdIndex = -1; // Reset for the next series
259
- }
260
- }
261
-
262
- if (tokens[i].type === 'dd_open') {
263
- lastDdIndex = i;
264
- }
265
- }
266
-
267
- return originalRender(tokens, idx, options, env, self);
268
- };
269
- }
270
296
 
271
297
  md.use(addClassToDefinitionList);
272
298
 
@@ -288,6 +314,14 @@ module.exports = function (options = {}) {
288
314
  if (spec.external_specs && !externalReferences) {
289
315
  externalReferences = await fetchExternalSpecs(spec);
290
316
  }
317
+
318
+ // Find the index of the terms-and-definitions-intro.md file
319
+ const termsIndex = (spec.markdown_paths || ['spec.md']).indexOf('terms-and-definitions-intro.md');
320
+ if (termsIndex !== -1) {
321
+ // Append the HTML string to the content of terms-and-definitions-intro.md. This string is used to create a div that is used to insert an alphabet index, and a div that is used as the starting point of the terminology index. The newlines are essential for the correct rendering of the markdown.
322
+ docs[termsIndex] += '\n\n<div id="alphabet-index-h7vc6omi2hr2880"></div>\n\n<div id="terminology-section-start-h7vc6omi2hr2880"></div>\n\n<hr>\n\n';
323
+ }
324
+
291
325
  let doc = docs.join("\n");
292
326
  doc = applyReplacers(doc);
293
327
  md[spec.katex ? "enable" : "disable"](katexRules);
@@ -0,0 +1,366 @@
1
+
2
+ module.exports = function (options = {}) {
3
+
4
+ const {
5
+ fetchExternalSpecs,
6
+ validateReferences,
7
+ findExternalSpecByKey
8
+ } = require('./references.js');
9
+ const gulp = require('gulp');
10
+ const fs = require('fs-extra');
11
+ const path = require('path');
12
+ const findPkgDir = require('find-pkg-dir');
13
+ const modulePath = findPkgDir(__dirname);
14
+ let config = fs.readJsonSync('./specs.json');
15
+ let assets = fs.readJsonSync(modulePath + '/src/asset-map.json');
16
+ let externalReferences;
17
+ let references = [];
18
+ let definitions = [];
19
+
20
+ const katexRules = ['math_block', 'math_inline']
21
+ const replacerRegex = /\[\[\s*([^\s\[\]:]+):?\s*([^\]\n]+)?\]\]/img;
22
+ const replacerArgsRegex = /\s*,+\s*/;
23
+ const replacers = [
24
+ {
25
+ test: 'insert',
26
+ transform: function (path) {
27
+ if (!path) return '';
28
+ return fs.readFileSync(path, 'utf8');
29
+ }
30
+ }
31
+ ];
32
+
33
+ function applyReplacers(doc) {
34
+ return doc.replace(replacerRegex, function (match, type, args) {
35
+ let replacer = replacers.find(r => type.trim().match(r.test));
36
+ return replacer ? replacer.transform(...args.trim().split(replacerArgsRegex)) : match;
37
+ });
38
+ }
39
+
40
+ function normalizePath(path) {
41
+ return path.trim().replace(/\/$/g, '') + '/';
42
+ }
43
+
44
+ function renderRefGroup(type) {
45
+ let group = specGroups[type];
46
+ if (!group) return '';
47
+ let html = Object.keys(group).sort().reduce((html, name) => {
48
+ let ref = group[name];
49
+ return html += `
50
+ <dt id="ref:${name}">${name}</dt>
51
+ <dd>
52
+ <cite><a href="${ref.href}">${ref.title}</a></cite>.
53
+ ${ref.authors.join('; ')}; ${ref.rawDate}. <span class="reference-status">Status: ${ref.status}</span>.
54
+ </dd>
55
+ `;
56
+ }, '<dl class="reference-list">')
57
+ return `\n${html}\n</dl>\n`;
58
+ }
59
+
60
+ function findKatexDist() {
61
+ const relpath = "node_modules/katex/dist";
62
+ const paths = [
63
+ path.join(process.cwd(), relpath),
64
+ path.join(__dirname, relpath),
65
+ ];
66
+ for (const abspath of paths) {
67
+ if (fs.existsSync(abspath)) {
68
+ return abspath
69
+ }
70
+ }
71
+ throw Error("katex distribution could not be located");
72
+ }
73
+
74
+ try {
75
+
76
+ var toc;
77
+ var specGroups = {};
78
+ const noticeTypes = {
79
+ note: 1,
80
+ issue: 1,
81
+ example: 1,
82
+ warning: 1,
83
+ todo: 1
84
+ };
85
+ const spaceRegex = /\s+/g;
86
+ const specNameRegex = /^spec$|^spec[-]*\w+$/i;
87
+ const terminologyRegex = /^def$|^ref$|^xref/i;
88
+ const specCorpus = fs.readJsonSync(modulePath + '/assets/compiled/refs.json');
89
+ const containers = require('markdown-it-container');
90
+ const md = require('markdown-it')({
91
+ html: true,
92
+ linkify: true,
93
+ typographer: true
94
+ })
95
+ .use(require('./src/markdown-it-extensions.js'), [
96
+ {
97
+ filter: type => type.match(terminologyRegex),
98
+ parse(token, type, primary) {
99
+ if (!primary) return;
100
+ if (type === 'def') {
101
+ definitions.push(token.info.args);
102
+ return token.info.args.reduce((acc, syn) => {
103
+ return `<span id="term:${syn.replace(spaceRegex, '-').toLowerCase()}">${acc}</span>`;
104
+ }, primary);
105
+ }
106
+ else if (type === 'xref') {
107
+ const url = findExternalSpecByKey(config, token.info.args[0]);
108
+ const term = token.info.args[1].replace(spaceRegex, '-').toLowerCase();
109
+ return `<a class="term-reference" data-local-href="#term:${token.info.args[0]}:${term}"
110
+ href="${url}#term:${term}">${token.info.args[1]}</a>`;
111
+ }
112
+ else {
113
+ references.push(primary);
114
+ return `<a class="term-reference" href="#term:${primary.replace(spaceRegex, '-').toLowerCase()}">${primary}</a>`;
115
+ }
116
+ }
117
+ },
118
+ {
119
+ filter: type => type.match(specNameRegex),
120
+ parse(token, type, name) {
121
+ if (name) {
122
+ let _name = name.replace(spaceRegex, '-').toUpperCase();
123
+ let spec = specCorpus[_name] ||
124
+ specCorpus[_name.toLowerCase()] ||
125
+ specCorpus[name.toLowerCase()] ||
126
+ specCorpus[name];
127
+ if (spec) {
128
+ spec._name = _name;
129
+ let group = specGroups[type] = specGroups[type] || {};
130
+ token.info.spec = group[_name] = spec;
131
+ }
132
+ }
133
+ },
134
+ render(token, type, name) {
135
+ if (name) {
136
+ let spec = token.info.spec;
137
+ if (spec) return `[<a class="spec-reference" href="#ref:${spec._name}">${spec._name}</a>]`;
138
+ }
139
+ else return renderRefGroup(type);
140
+ }
141
+ }
142
+ ])
143
+ .use(require('markdown-it-attrs'))
144
+ .use(require('markdown-it-chart').default)
145
+ .use(require('markdown-it-deflist'))
146
+ .use(require('markdown-it-references'))
147
+ .use(require('markdown-it-icons').default, 'font-awesome')
148
+ .use(require('markdown-it-ins'))
149
+ .use(require('markdown-it-mark'))
150
+ .use(require('markdown-it-textual-uml'))
151
+ .use(require('markdown-it-sub'))
152
+ .use(require('markdown-it-sup'))
153
+ .use(require('markdown-it-task-lists'))
154
+ .use(require('markdown-it-multimd-table'), {
155
+ multiline: true,
156
+ rowspan: true,
157
+ headerless: true
158
+ })
159
+ .use(containers, 'notice', {
160
+ validate: function (params) {
161
+ let matches = params.match(/(\w+)\s?(.*)?/);
162
+ return matches && noticeTypes[matches[1]];
163
+ },
164
+ render: function (tokens, idx) {
165
+ let matches = tokens[idx].info.match(/(\w+)\s?(.*)?/);
166
+ if (matches && tokens[idx].nesting === 1) {
167
+ let id;
168
+ let type = matches[1];
169
+ if (matches[2]) {
170
+ id = matches[2].trim().replace(/\s+/g, '-').toLowerCase();
171
+ if (noticeTitles[id]) id += '-' + noticeTitles[id]++;
172
+ else noticeTitles[id] = 1;
173
+ }
174
+ else id = type + '-' + noticeTypes[type]++;
175
+ return `<div id="${id}" class="notice ${type}"><a class="notice-link" href="#${id}">${type.toUpperCase()}</a>`;
176
+ }
177
+ else return '</div>\n';
178
+ }
179
+ })
180
+ .use(require('markdown-it-prism'))
181
+ .use(require('markdown-it-toc-and-anchor').default, {
182
+ tocClassName: 'toc',
183
+ tocFirstLevel: 2,
184
+ tocLastLevel: 4,
185
+ tocCallback: (_md, _tokens, html) => toc = html,
186
+ anchorLinkSymbol: '§',
187
+ anchorClassName: 'toc-anchor'
188
+ })
189
+ .use(require('@traptitech/markdown-it-katex'))
190
+
191
+ async function render(spec, assets) {
192
+ try {
193
+ noticeTitles = {};
194
+ specGroups = {};
195
+ console.log('Rendering: ' + spec.title);
196
+ return new Promise(async (resolve, reject) => {
197
+ Promise.all((spec.markdown_paths || ['spec.md']).map(_path => {
198
+ return fs.readFile(spec.spec_directory + _path, 'utf8').catch(e => reject(e))
199
+ })).then(async docs => {
200
+ const features = (({ source, logo }) => ({ source, logo }))(spec);
201
+ if (spec.external_specs && !externalReferences) {
202
+ externalReferences = await fetchExternalSpecs(spec);
203
+ }
204
+ let doc = docs.join("\n");
205
+ doc = applyReplacers(doc);
206
+ md[spec.katex ? "enable" : "disable"](katexRules);
207
+ const render = md.render(doc);
208
+ fs.writeFile(path.join(spec.destination, 'index.html'), `
209
+ <!DOCTYPE html>
210
+ <html lang="en">
211
+ <head>
212
+ <meta charset="utf-8">
213
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
214
+ <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
215
+
216
+ <title>${spec.title}</title>
217
+
218
+ <link href="https://fonts.googleapis.com/css2?family=Heebo:wght@300;400&display=swap" rel="stylesheet">
219
+
220
+ ${assets.head}
221
+ </head>
222
+ <body features="${Object.keys(features).join(' ')}">
223
+
224
+ ${assets.svg}
225
+
226
+ <main>
227
+
228
+ <header id="header" class="panel-header">
229
+ <span id="toc_toggle" panel-toggle="toc">
230
+ <svg icon><use xlink:href="#svg-nested-list"></use></svg>
231
+ </span>
232
+ <a id="logo" href="${spec.logo_link ? spec.logo_link : '#_'}">
233
+ <img src="${spec.logo}" />
234
+ </a>
235
+ <span issue-count animate panel-toggle="repo_issues">
236
+ <svg icon><use xlink:href="#svg-github"></use></svg>
237
+ </span>
238
+ </header>
239
+
240
+ <article id="content">
241
+ ${render}
242
+ </article>
243
+
244
+ </main>
245
+
246
+ <slide-panels id="slidepanels">
247
+ <slide-panel id="repo_issues" options="right">
248
+ <header class="panel-header">
249
+ <span>
250
+ <svg icon><use xlink:href="#svg-github"></use></svg>
251
+ <span issue-count></span>
252
+ </span>
253
+ <span class="repo-issue-toggle" panel-toggle="repo_issues">✕</span>
254
+ </header>
255
+ <ul id="repo_issue_list"></ul>
256
+ </slide-panel>
257
+
258
+ <slide-panel id="toc">
259
+ <header class="panel-header">
260
+ <span>Table of Contents</span>
261
+ <span panel-toggle="toc">✕</span>
262
+ </header>
263
+ <div id="toc_list">
264
+ ${toc}
265
+ </div>
266
+ </slide-panel>
267
+
268
+ </slide-panels>
269
+ <div style="display: none;">
270
+ ${externalReferences}
271
+ </div>
272
+ </body>
273
+ <script>window.specConfig = ${JSON.stringify(spec)}</script>
274
+ ${assets.body}
275
+ </html>
276
+ `, function (err, data) {
277
+ if (err) {
278
+ reject(err);
279
+ }
280
+ else {
281
+ resolve();
282
+ }
283
+ });
284
+ validateReferences(references, definitions, render);
285
+ references = [];
286
+ definitions = [];
287
+ });
288
+ });
289
+ }
290
+ catch (e) {
291
+ console.error(e);
292
+ }
293
+ }
294
+
295
+ config.specs.forEach(spec => {
296
+ spec.spec_directory = normalizePath(spec.spec_directory);
297
+ spec.destination = normalizePath(spec.output_path || spec.spec_directory);
298
+
299
+ fs.ensureDirSync(spec.destination);
300
+
301
+ let assetTags = {
302
+ svg: fs.readFileSync(modulePath + '/assets/icons.svg', 'utf8') || ''
303
+ };
304
+
305
+ let customAssets = (spec.assets || []).reduce((assets, asset) => {
306
+ let ext = asset.path.split('.').pop();
307
+ if (ext === 'css') {
308
+ assets.css += `<link href="${asset.path}" rel="stylesheet"/>`;
309
+ }
310
+ if (ext === 'js') {
311
+ assets.js[asset.inject || 'body'] += `<script src="${asset.path}" ${asset.module ? 'type="module"' : ''} ></script>`;
312
+ }
313
+ return assets;
314
+ }, {
315
+ css: '',
316
+ js: { head: '', body: '' }
317
+ });
318
+
319
+ if (options.dev) {
320
+ assetTags.head = assets.head.css.map(_path => `<link href="${_path}" rel="stylesheet"/>`).join('') +
321
+ customAssets.css +
322
+ assets.head.js.map(_path => `<script src="${_path}"></script>`).join('') +
323
+ customAssets.js.head;
324
+ assetTags.body = assets.body.js.map(_path => `<script src="${_path}" data-manual></script>`).join('') +
325
+ customAssets.js.body;
326
+ }
327
+ else {
328
+ assetTags.head = `
329
+ <style>${fs.readFileSync(modulePath + '/assets/compiled/head.css', 'utf8')}</style>
330
+ ${customAssets.css}
331
+ <script>${fs.readFileSync(modulePath + '/assets/compiled/head.js', 'utf8')}</script>
332
+ ${customAssets.js.head}
333
+ `;
334
+ assetTags.body = `<script>${fs.readFileSync(modulePath + '/assets/compiled/body.js', 'utf8')}</script>
335
+ ${customAssets.js.body}`;
336
+ }
337
+
338
+ if (spec.katex) {
339
+ const katexDist = findKatexDist();
340
+ assetTags.body += `<script>/* katex */${fs.readFileSync(path.join(katexDist, 'katex.min.js'),
341
+ 'utf8')}</script>`;
342
+ assetTags.body += `<style>/* katex */${fs.readFileSync(path.join(katexDist, 'katex.min.css'),
343
+ 'utf8')}</style>`;
344
+
345
+ fs.copySync(path.join(katexDist, 'fonts'), path.join(spec.destination, 'fonts'));
346
+ }
347
+
348
+ if (!options.nowatch) {
349
+ gulp.watch(
350
+ [spec.spec_directory + '**/*', '!' + path.join(spec.destination, 'index.html')],
351
+ render.bind(null, spec, assetTags)
352
+ )
353
+ }
354
+
355
+ render(spec, assetTags).then(() => {
356
+ if (options.nowatch) process.exit(0)
357
+ }).catch(() => process.exit(1));
358
+
359
+ });
360
+
361
+ }
362
+ catch (e) {
363
+ console.error(e);
364
+ }
365
+
366
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spec-up-t",
3
- "version": "1.0.74",
3
+ "version": "1.0.76",
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": {
@@ -2,7 +2,7 @@ const fs = require('fs');
2
2
  const path = require('path');
3
3
 
4
4
  // Function to process markdown files in a directory recursively
5
- function processMarkdownFiles(directory) {
5
+ function fixMarkdownFiles(directory) {
6
6
  // Helper function to process a directory
7
7
  function processDirectory(directory) {
8
8
  try {
@@ -92,5 +92,5 @@ function processMarkdownFiles(directory) {
92
92
  }
93
93
 
94
94
  module.exports = {
95
- processMarkdownFiles
95
+ fixMarkdownFiles
96
96
  };
@@ -1,5 +1,10 @@
1
1
  /**
2
- * @file This file creates a JavaScript file with the data for the xrefs. It fetches the latest commit hash of the term files from the GitHub API and stores the data in a JavaScript file that is included in the HTML output of the specification. The outputted JS file serves as a source for the JS code that will be included in the html file.
2
+ * @file This script is responsible for fetching the latest commit hash of term files from the GitHub API and generating both a JavaScript file and a JSON file containing the data for the cross-references (xrefs).
3
+ *
4
+ * The generated JavaScript file is included in the HTML output of the specification, serving as a data source for the JavaScript code embedded in the HTML file.
5
+ *
6
+ * Additionally, the data is written to a JSON file for further processing or usage. This ensures that the xref data is available in both JavaScript and JSON formats, providing flexibility for different use cases.
7
+ *
3
8
  * @author Kor Dwarshuis
4
9
  * @version 1.0.0
5
10
  * @since 2024-06-09
@@ -1,8 +1,10 @@
1
1
  /**
2
- * Inserts term index into the specification.
2
+ * Inserts term index into the specification.
3
3
  *
4
- * This function inserts the entries in term-index.json
5
- * term directories, and updates the specification with the term index.
4
+ * This function reads the entries from term-index.json,
5
+ * processes the term directories, and updates the specification with the term index.
6
+ * It modifies the markdown paths in the specification and saves the updated specification
7
+ * to a JSON file in the output directory.
6
8
  *
7
9
  * @function
8
10
  * @name insertTermIndex
@@ -22,7 +24,10 @@ function insertTermIndex() {
22
24
  let specGenerated = config;
23
25
  let markdownPaths = specGenerated.specs[0].markdown_paths;
24
26
 
27
+ // Find the index of the "terms-and-definitions-intro.md" file in the markdown paths
25
28
  const index = markdownPaths.indexOf('terms-and-definitions-intro.md');
29
+
30
+ //
26
31
  if (index !== -1) {
27
32
  // Insert the items of the "terms" array after the found index
28
33
  markdownPaths.splice(index + 1, 0, ...terms);
@@ -0,0 +1,7 @@
1
+ function prepareTref(tref) {
2
+
3
+
4
+
5
+ }
6
+
7
+ module.export = { prepareTref };