spec-up-t 1.0.10 → 1.0.12
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 +2 -1
- package/assets/js/edit-term-buttons.js +1 -1
- package/assets/js/help-buttons.js +38 -0
- package/package.json +1 -1
- package/src/asset-map.json +1 -0
- package/src/create-pdf.js +9 -1
- package/src/freeze.js +54 -0
- package/multi-file-test/abstract.md +0 -3
- package/multi-file-test/features.md +0 -132
- package/multi-file-test/getting-started.md +0 -21
- package/multi-file-test/header.md +0 -17
- package/multi-file-test/index.html +0 -289
- package/single-file-test/assets/test.json +0 -5
- package/single-file-test/assets/test.text +0 -1
- package/single-file-test/spec.md +0 -536
package/assets/compiled/body.js
CHANGED
|
@@ -87,7 +87,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
87
87
|
* @license MIT
|
|
88
88
|
* @since 2024-06-09
|
|
89
89
|
*/
|
|
90
|
-
function editTermButtons(){const t=((e=specConfig.spec_directory).startsWith("./")?e=e.substring(2):e.startsWith("/")&&(e=e.substring(1)),e.endsWith("/")&&(e=e.slice(0,-1)),e);var e;document.querySelectorAll('dt:has(> span[id^="term:"])').forEach(e=>{const
|
|
90
|
+
function editTermButtons(){const t=((e=specConfig.spec_directory).startsWith("./")?e=e.substring(2):e.startsWith("/")&&(e=e.substring(1)),e.endsWith("/")&&(e=e.slice(0,-1)),e);var e;document.querySelectorAll('dt:has(> span[id^="term:"])').forEach(e=>{const s=function(t){let e=t;for(;e.querySelector('span[id^="term:"]');)e=e.querySelector('span[id^="term:"]');return e}(e),n=s.getAttribute("id").split(":")[1];s.innerHTML+=`<a title="Link to the term file in the Github repo in a new tab" target="_blank" rel="noopener" href="https://github.com/${specConfig.source.account}/${specConfig.source.repo}/blob/main/${t}/${specConfig.spec_terms_directory}/${n}.md" class="edit-term-button btn"><svg icon><use xlink:href="#svg-github"></use></svg> Edit</a><a title="Link to a GitHub page that shows a history of the edits in a new tab" target="_blank" rel="noopener" href="https://github.com/${specConfig.source.account}/${specConfig.source.repo}/commits/main/${t}/${specConfig.spec_terms_directory}/${n}.md" class="history-term-button btn"><svg icon><use xlink:href="#svg-github"></use></svg> History</a>`})}document.addEventListener("DOMContentLoaded",(function(){editTermButtons()}));
|
|
91
91
|
function inPageSearch(){const e=document.querySelector("span[issue-count]"),t=specConfig.searchHighlightStyle||"ssi",n="search-h7vc6omi2hr2880",i=document.querySelector("main article");let c=document.createElement("div");c.setAttribute("id","container-"+n),c.setAttribute("class","container-"+n),e.after(c);let o=document.createElement("input");o.setAttribute("type","text"),o.setAttribute("id",n),o.setAttribute("placeholder","🔍"),c.appendChild(o),setTimeout(()=>{o.focus()},1e3);const r=document.createElement("div");r.setAttribute("id","back-and-forth-buttons-container-"+n);const a=document.createElement("button");a.setAttribute("id","one-match-backward-"+n),a.setAttribute("disabled","disabled"),a.setAttribute("title","Go to previous match. Shortcut key: Left Arrow"),a.textContent="▲",r.appendChild(a);const s=document.createElement("button");s.setAttribute("id","one-match-forward-"+n),s.setAttribute("disabled","disabled"),s.setAttribute("title","Go to next match. Shortcut key: Right Arrow"),s.textContent="▼",r.appendChild(s),c.appendChild(r);const d=document.createElement("span");d.setAttribute("id","total-matches-"+n),d.innerHTML="0 matches",c.appendChild(d),o.addEventListener("input",(function(){f(o.value)}));const h="highlight-matches-"+n,l={dif:"highlight-matches-DIF-search-h7vc6omi2hr2880",toip:"highlight-matches-ToIP-search-h7vc6omi2hr2880",btc:"highlight-matches-BTC-search-h7vc6omi2hr2880",keri:"highlight-matches-KERI-search-h7vc6omi2hr2880",ssi:"highlight-matches-SSI-search-h7vc6omi2hr2880",gleif:"highlight-matches-GLEIF-search-h7vc6omi2hr2880"}[t.toLowerCase()];let u=0,m=-1;function b(e){e.scrollIntoView({behavior:"smooth",block:"start"});const t=e.getBoundingClientRect(),n=t.top+window.pageYOffset-(window.innerHeight-t.height)/2;window.scrollTo({top:n,behavior:"smooth"})}function p(){m<=0?document.getElementById("one-match-backward-"+n).setAttribute("disabled","disabled"):document.getElementById("one-match-backward-"+n).removeAttribute("disabled"),m>=u-1?document.getElementById("one-match-forward-"+n).setAttribute("disabled","disabled"):document.getElementById("one-match-forward-"+n).removeAttribute("disabled")}function g(){d.innerHTML=u+" matches"}const f=function(e,t){let n;return function(){const i=this,c=arguments;clearTimeout(n),n=setTimeout(()=>e.apply(i,c),t)}}((function(e){if(function(){document.querySelectorAll("span."+h).forEach(e=>{Array.from(e.childNodes).forEach(t=>{t.nodeType===Node.ELEMENT_NODE&&e.removeChild(t)}),e.classList.contains(h)&&(e.outerHTML=e.innerHTML)})}(),u=0,m=-1,""===e)return void g();let t=0;!function i(c){if(3===c.nodeType){const i=function(i){const c=i.nodeValue,o=new RegExp(e,"gi");let r,a=0,s=document.createDocumentFragment();for(;null!==(r=o.exec(c));){s.appendChild(document.createTextNode(c.substring(a,r.index)));const e=document.createElement("span");e.textContent=r[0],e.classList.add(h),e.classList.add(l),e.setAttribute("id",n+"-"+t),s.appendChild(e),u=t+1,t++,a=r.index+r[0].length}return s.appendChild(document.createTextNode(c.substring(a))),s}(c);i.childNodes.length>1&&c.parentNode.replaceChild(i,c)}else 1===c.nodeType&&Array.from(c.childNodes).forEach(i)}(i);let c=document.querySelector("."+l);null!==c&&b(c);g(),p(),m=-1}),600);a.addEventListener("click",(function(){m--;const e=document.querySelector("#"+n+"-"+m);e&&b(e),e.classList.add("active"),setTimeout(()=>{e.classList.remove("active")},3e3),p()})),s.addEventListener("click",(function(){m++;const e=document.querySelector("#"+n+"-"+m);e&&b(e),e.classList.add("active"),setTimeout(()=>{e.classList.remove("active")},3e3),p()})),document.addEventListener("keyup",e=>{switch(e.key){case"ArrowRight":s.click();break;case"ArrowLeft":a.click()}})}document.addEventListener("DOMContentLoaded",(function(){inPageSearch()}));
|
|
92
92
|
function highlightMenuItems(){let t=null;function e(t){document.querySelectorAll("#toc_list a").forEach(t=>{t.classList.remove("highlight-cfib41dyhcd99sm")});const e=document.querySelector(`#toc_list a[href="#${t.id}"]`);e&&(e.classList.add("highlight-cfib41dyhcd99sm"),e.scrollIntoView({behavior:"smooth",block:"center"}))}const o=new IntersectionObserver((o,n)=>{const c=o.filter(t=>t.isIntersecting).map(t=>t.target);c.length>0?(t=c[0],e(t)):t&&e(t)},{root:null,rootMargin:"0px",threshold:.1});document.querySelectorAll("h2, h3, h4, h5, h6").forEach(t=>o.observe(t))}document.addEventListener("DOMContentLoaded",(function(){highlightMenuItems()}));
|
|
93
93
|
function backToTop(){const n=document.createElement("a");n.id="back-to-top-a1zncgtqfpzsig8",n.href="#content",n.innerHTML="↑",document.body.appendChild(n);const t=function(n,t){let e;return function(){const o=this,c=arguments;clearTimeout(e),e=setTimeout(()=>n.apply(o,c),t)}}((function(){window.scrollY>300?n.style.display="flex":n.style.display="none"}),600);window.addEventListener("scroll",(function(){t()}))}document.addEventListener("DOMContentLoaded",(function(){backToTop()}));
|
|
@@ -124,4 +124,5 @@ var Notyf=function(){"use strict";var t,i=function(){return(i=Object.assign||fun
|
|
|
124
124
|
function collapseDefinitions(){const t=document.querySelectorAll("#content dl dd"),e=document.querySelectorAll(".collapse-all-defs-button");document.querySelectorAll("dt").forEach(t=>{const e=document.createElement("button");e.classList.add("collapse-all-defs-button","btn"),e.innerHTML="▲",e.setAttribute("id","toggleButton"),t.appendChild(e)}),document.addEventListener("click",n=>{n.target.classList.contains("collapse-all-defs-button")&&(!function(){const n=t[0].classList.contains("hidden");t.forEach(t=>{t.classList.toggle("hidden",!n),t.classList.toggle("visible",n)}),e.forEach(t=>{t.innerHTML=n?"▲":"▼",t.title=n?"Collapse all definitions":"Expand all definitions"})}(),n.target.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"}),setTimeout(()=>{window.scrollBy({top:-100,behavior:"smooth"})},500))})}document.addEventListener("DOMContentLoaded",(function(){collapseDefinitions()}));
|
|
125
125
|
function showModal(e){const n=document.createElement("div");n.className="modal-overlay";const o=document.createElement("div");o.className="modal";const c=document.createElement("button");function t(){document.body.removeChild(n)}c.className="modal-close",c.innerHTML="×",c.onclick=t,o.innerHTML=e,o.appendChild(c),n.appendChild(o),document.body.appendChild(n),n.onclick=function(e){e.target===n&&t()},document.addEventListener("keydown",(function(e){"Escape"===e.key&&t()}),{once:!0})}
|
|
126
126
|
function tokenInput(){let t=document.createElement("button");t.classList.add("button-token-input"),t.classList.add("btn"),t.innerHTML="🔑",document.querySelector("#container-search-h7vc6omi2hr2880").after(t),t.addEventListener("click",()=>{const t=prompt("Please enter your GitHub token:");t?(localStorage.setItem("githubToken",t),console.log("GitHub token is set.")):alert("GitHub token is not set.")})}document.addEventListener("DOMContentLoaded",(function(){tokenInput()}));
|
|
127
|
+
function helpButtons(){const t=document.createElement("a");t.textContent="?",t.classList.add("help-button","btn"),t.title="Click to see the explanation of the buttons at the documentation website, in a new tab.",t.target="_blank",t.rel="noopener noreferrer",t.href="https://blockchainbird.github.io/spec-up-t-website/docs/cheat-sheet#explanation-buttons",function(t){document.querySelectorAll("#content .collapse-all-defs-button").forEach(e=>{e.parentElement.insertBefore(t.cloneNode(!0),e.nextSibling)})}(t)}document.addEventListener("DOMContentLoaded",helpButtons);
|
|
127
128
|
!function(){var e=window.markdownit();delegateEvent("pointerup","[panel-toggle]",(e,t)=>{slidepanels.toggle(t.getAttribute("panel-toggle"))},{passive:!0}),window.addEventListener("hashchange",e=>slidepanels.close());let t=specConfig.source;t&&"github"===t.host&&fetch(`https://api.github.com/repos/${t.account+"/"+t.repo}/issues`).then(e=>e.json()).then(t=>{let n=t.length;document.querySelectorAll("[issue-count]").forEach(e=>{e.setAttribute("issue-count",n)}),repo_issue_list.innerHTML=t.map(t=>`<li class="repo-issue">\n <detail-box>\n <section>${e.render(t.body||"")}</section>\n <header class="repo-issue-title">\n <span class="repo-issue-number">${t.number}</span>\n <span class="repo-issue-link">\n <a href="${t.html_url}" target="_blank">${t.title}</a>\n </span>\n <span detail-box-toggle></span>\n </header>\n </detail-box>\n </li>`).join(""),Prism.highlightAllUnder(repo_issue_list)}),mermaid.initialize({startOnLoad:!0,theme:"neutral"}),document.querySelectorAll(".chartjs").forEach(e=>{new Chart(e,JSON.parse(e.textContent))});let n=new WeakMap;delegateEvent("pointerover",".term-reference, .spec-reference",(e,t)=>{const s=t.getAttribute("data-local-href")||t.getAttribute("href")||"";let l=document.getElementById(s.replace("#",""));if(!l||n.has(t))return;let r=l.closest("dt, td:first-child");if(!r)return;let i={allowHTML:!0,inlinePositioning:!0};switch(r.tagName){case"DT":i.content=r.nextElementSibling.textContent;break;case"TD":let e=r.closest("table"),t=Array.from(r.closest("tr").children);if(t.shift(),e){let n=Array.from(e.querySelectorAll("thead th"));n.shift(),n.length&&(i.content=`\n <header>${r.textContent}</header>\n <table>\n ${n.map((e,n)=>`<tr><td>${e.textContent}:</td><td>${t[n]?t[n].textContent:""}</td></tr>`).join("")}\n </table>`)}}i.content&&n.set(t,tippy(t,i))},{passive:!0})}();
|
|
@@ -48,7 +48,7 @@ function editTermButtons() {
|
|
|
48
48
|
const fileName = url.split(":")[1];
|
|
49
49
|
|
|
50
50
|
// add edit and history buttons to term
|
|
51
|
-
term.innerHTML += `<a target="_blank" rel="noopener" href="https://github.com/${specConfig.source.account}/${specConfig.source.repo}/blob/main/${cleanedSpecDir}/${specConfig.spec_terms_directory}/${fileName}.md" class="edit-term-button btn">Edit</a><a target="_blank" rel="noopener" href="https://github.com/${specConfig.source.account}/${specConfig.source.repo}/commits/main/${cleanedSpecDir}/${specConfig.spec_terms_directory}/${fileName}.md" class="history-term-button btn">History</a>`;
|
|
51
|
+
term.innerHTML += `<a title="Link to the term file in the Github repo in a new tab" target="_blank" rel="noopener" href="https://github.com/${specConfig.source.account}/${specConfig.source.repo}/blob/main/${cleanedSpecDir}/${specConfig.spec_terms_directory}/${fileName}.md" class="edit-term-button btn"><svg icon><use xlink:href="#svg-github"></use></svg> Edit</a><a title="Link to a GitHub page that shows a history of the edits in a new tab" target="_blank" rel="noopener" href="https://github.com/${specConfig.source.account}/${specConfig.source.repo}/commits/main/${cleanedSpecDir}/${specConfig.spec_terms_directory}/${fileName}.md" class="history-term-button btn"><svg icon><use xlink:href="#svg-github"></use></svg> History</a>`;
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
54
|
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates and inserts help buttons into the DOM.
|
|
3
|
+
*
|
|
4
|
+
* This function creates a help button element and inserts it after each element
|
|
5
|
+
* with the class 'collapse-all-defs-button' within the '#content' element. The
|
|
6
|
+
* help button links to the documentation website and opens in a new tab.
|
|
7
|
+
*
|
|
8
|
+
* @function helpButtons
|
|
9
|
+
* @memberof module:help-buttons
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* // Automatically called when the DOM content is loaded
|
|
13
|
+
* document.addEventListener('DOMContentLoaded', helpButtons);
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
function helpButtons() {
|
|
17
|
+
// Create the help button DOM element
|
|
18
|
+
const newElement = document.createElement('a');
|
|
19
|
+
newElement.textContent = '?';
|
|
20
|
+
newElement.classList.add('help-button', 'btn');
|
|
21
|
+
newElement.title = 'Click to see the explanation of the buttons at the documentation website, in a new tab.';
|
|
22
|
+
newElement.target = '_blank';
|
|
23
|
+
newElement.rel = 'noopener noreferrer';
|
|
24
|
+
newElement.href = 'https://blockchainbird.github.io/spec-up-t-website/docs/cheat-sheet#explanation-buttons';
|
|
25
|
+
|
|
26
|
+
function addElementAfterLastChild(newElement) {
|
|
27
|
+
const elements = document.querySelectorAll('#content .collapse-all-defs-button');
|
|
28
|
+
|
|
29
|
+
elements.forEach((element) => {
|
|
30
|
+
const parent = element.parentElement;
|
|
31
|
+
parent.insertBefore(newElement.cloneNode(true), element.nextSibling);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
addElementAfterLastChild(newElement);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
document.addEventListener('DOMContentLoaded', helpButtons);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "spec-up-t",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.12",
|
|
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/asset-map.json
CHANGED
package/src/create-pdf.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const fs = require('fs-extra');
|
|
1
2
|
const puppeteer = require('puppeteer');
|
|
2
3
|
const path = require('path');
|
|
3
4
|
|
|
@@ -7,8 +8,15 @@ const path = require('path');
|
|
|
7
8
|
const browser = await puppeteer.launch();
|
|
8
9
|
const page = await browser.newPage();
|
|
9
10
|
|
|
11
|
+
// Read and parse the specs.json file
|
|
12
|
+
const config = fs.readJsonSync('specs.json');
|
|
13
|
+
|
|
14
|
+
// Extract the output_path from the specs.json file
|
|
15
|
+
const outputPath = config.specs[0].output_path;
|
|
16
|
+
|
|
10
17
|
// Define the path to the HTML file based on the directory where the script is called from
|
|
11
|
-
|
|
18
|
+
//TODO: replace `docs/index.html` with the path in specs.json
|
|
19
|
+
const filePath = path.resolve(process.cwd(), outputPath, 'index.html');
|
|
12
20
|
const fileUrl = `file://${filePath}`;
|
|
13
21
|
|
|
14
22
|
// Navigate to the HTML file
|
package/src/freeze.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
const fs = require('fs-extra');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
|
|
4
|
+
// Read and parse the specs.json file
|
|
5
|
+
const config = fs.readJsonSync('specs.json');
|
|
6
|
+
|
|
7
|
+
// Extract the output_path from the specs.json file
|
|
8
|
+
const outputPath = config.specs[0].output_path;
|
|
9
|
+
|
|
10
|
+
// Define the source file path
|
|
11
|
+
const sourceFile = path.join(outputPath, 'index.html');
|
|
12
|
+
|
|
13
|
+
// Define the destination directory path
|
|
14
|
+
const destDir = path.join(outputPath, 'versions');
|
|
15
|
+
|
|
16
|
+
// Ensure the destination directory exists, create it if it doesn't
|
|
17
|
+
if (!fs.existsSync(destDir)) {
|
|
18
|
+
fs.mkdirSync(destDir, { recursive: true });
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Get all files in the destination directory
|
|
22
|
+
const files = fs.readdirSync(destDir);
|
|
23
|
+
|
|
24
|
+
// Initialize the highest version number to 0
|
|
25
|
+
let highestVersion = 0;
|
|
26
|
+
|
|
27
|
+
// Define the pattern to match versioned filenames
|
|
28
|
+
const versionPattern = /^index-v(\d+)\.html$/;
|
|
29
|
+
|
|
30
|
+
// Iterate over each file in the destination directory
|
|
31
|
+
files.forEach(file => {
|
|
32
|
+
// Check if the file matches the version pattern
|
|
33
|
+
const match = file.match(versionPattern);
|
|
34
|
+
if (match) {
|
|
35
|
+
// Extract the version number from the filename
|
|
36
|
+
const version = parseInt(match[1], 10);
|
|
37
|
+
// Update the highest version number if the current version is higher
|
|
38
|
+
if (version > highestVersion) {
|
|
39
|
+
highestVersion = version;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
// Calculate the new version number
|
|
45
|
+
const newVersion = highestVersion + 1;
|
|
46
|
+
|
|
47
|
+
// Define the destination file path with the new version number
|
|
48
|
+
const destFile = path.join(destDir, `index-v${newVersion}.html`);
|
|
49
|
+
|
|
50
|
+
// Copy the source file to the destination file
|
|
51
|
+
fs.copyFileSync(sourceFile, destFile);
|
|
52
|
+
|
|
53
|
+
// Log a message indicating the file has been copied
|
|
54
|
+
console.log(`\n SPEC-UP-T: Created a freezed specification version in ${destFile}\n`);
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
## Abstract
|
|
2
|
-
|
|
3
|
-
Let's face it, other tools and generators for writing technical specifications aimed at standards bodies or industry groups are cumbersome, underwhelming, and lack the features you might want in a technical specification document. Spec-Up's goal is to deliver you a better spec-writing experience with far less effort and tedium than other tools in the ecosystem. Spec-Up is a dead simple tool that auto-generates great specs from markdown. The version of markdown Spec-up uses contains all the same features you might expect from common implementations, like GitHub, but adds much more, including notice blocks, complex tables, charts, advanced syntax highlighting, UML diagrams, etc.
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
## Features
|
|
2
|
-
|
|
3
|
-
### Diagrams
|
|
4
|
-
<pre>
|
|
5
|
-
```mermaid
|
|
6
|
-
sequenceDiagram
|
|
7
|
-
participant Alice
|
|
8
|
-
participant Bob
|
|
9
|
-
Alice->>Bob: Hey Bob
|
|
10
|
-
Bob-->>Alice: Great!
|
|
11
|
-
Alice->>Bob: How about you?
|
|
12
|
-
Bob-->>Alice: Doing well!
|
|
13
|
-
```
|
|
14
|
-
</pre>
|
|
15
|
-
|
|
16
|
-
```mermaid
|
|
17
|
-
sequenceDiagram
|
|
18
|
-
participant Alice
|
|
19
|
-
participant Bob
|
|
20
|
-
Alice->>Bob: Hey Bob
|
|
21
|
-
Bob-->>Alice: Great!
|
|
22
|
-
Alice->>Bob: How about you?
|
|
23
|
-
Bob-->>Alice: Doing well!
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
### Charts
|
|
27
|
-
|
|
28
|
-
<pre>
|
|
29
|
-
```chart
|
|
30
|
-
{
|
|
31
|
-
"type": "pie",
|
|
32
|
-
"data": {
|
|
33
|
-
"labels": [
|
|
34
|
-
"Red",
|
|
35
|
-
"Blue",
|
|
36
|
-
"Yellow"
|
|
37
|
-
],
|
|
38
|
-
"datasets": [
|
|
39
|
-
{
|
|
40
|
-
"data": [
|
|
41
|
-
300,
|
|
42
|
-
50,
|
|
43
|
-
100
|
|
44
|
-
],
|
|
45
|
-
"backgroundColor": [
|
|
46
|
-
"#FF6384",
|
|
47
|
-
"#36A2EB",
|
|
48
|
-
"#FFCE56"
|
|
49
|
-
],
|
|
50
|
-
"hoverBackgroundColor": [
|
|
51
|
-
"#FF6384",
|
|
52
|
-
"#36A2EB",
|
|
53
|
-
"#FFCE56"
|
|
54
|
-
]
|
|
55
|
-
}
|
|
56
|
-
]
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
```
|
|
60
|
-
</pre>
|
|
61
|
-
|
|
62
|
-
```chart
|
|
63
|
-
{
|
|
64
|
-
"type": "pie",
|
|
65
|
-
"data": {
|
|
66
|
-
"labels": [
|
|
67
|
-
"Red",
|
|
68
|
-
"Blue",
|
|
69
|
-
"Yellow"
|
|
70
|
-
],
|
|
71
|
-
"datasets": [
|
|
72
|
-
{
|
|
73
|
-
"data": [
|
|
74
|
-
300,
|
|
75
|
-
50,
|
|
76
|
-
100
|
|
77
|
-
],
|
|
78
|
-
"backgroundColor": [
|
|
79
|
-
"#FF6384",
|
|
80
|
-
"#36A2EB",
|
|
81
|
-
"#FFCE56"
|
|
82
|
-
],
|
|
83
|
-
"hoverBackgroundColor": [
|
|
84
|
-
"#FF6384",
|
|
85
|
-
"#36A2EB",
|
|
86
|
-
"#FFCE56"
|
|
87
|
-
]
|
|
88
|
-
}
|
|
89
|
-
]
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
### Syntax Highlighting
|
|
95
|
-
|
|
96
|
-
<pre>
|
|
97
|
-
```json
|
|
98
|
-
{
|
|
99
|
-
"@context": "https://www.w3.org/ns/did/v1",
|
|
100
|
-
"id": "did:example:123456789abcdefghi",
|
|
101
|
-
"authentication": [{
|
|
102
|
-
"id": "did:example:123456789abcdefghi#keys-1",
|
|
103
|
-
"type": "RsaVerificationKey2018",
|
|
104
|
-
"controller": "did:example:123456789abcdefghi",
|
|
105
|
-
"publicKeyPem": "-----BEGIN PUBLIC KEY...END PUBLIC KEY-----\r\n"
|
|
106
|
-
}],
|
|
107
|
-
"service": [{
|
|
108
|
-
"id":"did:example:123456789abcdefghi#vcs",
|
|
109
|
-
"type": "VerifiableCredentialService",
|
|
110
|
-
"serviceEndpoint": "https://example.com/vc/"
|
|
111
|
-
}]
|
|
112
|
-
}
|
|
113
|
-
```
|
|
114
|
-
</pre>
|
|
115
|
-
|
|
116
|
-
```json
|
|
117
|
-
{
|
|
118
|
-
"@context": "https://www.w3.org/ns/did/v1",
|
|
119
|
-
"id": "did:example:123456789abcdefghi",
|
|
120
|
-
"authentication": [{
|
|
121
|
-
"id": "did:example:123456789abcdefghi#keys-1",
|
|
122
|
-
"type": "RsaVerificationKey2018",
|
|
123
|
-
"controller": "did:example:123456789abcdefghi",
|
|
124
|
-
"publicKeyPem": "-----BEGIN PUBLIC KEY...END PUBLIC KEY-----\r\n"
|
|
125
|
-
}],
|
|
126
|
-
"service": [{
|
|
127
|
-
"id":"did:example:123456789abcdefghi#vcs",
|
|
128
|
-
"type": "VerifiableCredentialService",
|
|
129
|
-
"serviceEndpoint": "https://example.com/vc/"
|
|
130
|
-
}]
|
|
131
|
-
}
|
|
132
|
-
```
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
## Getting Started
|
|
2
|
-
|
|
3
|
-
Using Spec-Up is easy peasy lemon squeezy:
|
|
4
|
-
|
|
5
|
-
1. `npm install spec-up`
|
|
6
|
-
2. Create a subdirectory in your project with two files:
|
|
7
|
-
- `spec.json` - add some basic config values, like your desired HTML page title, etc.
|
|
8
|
-
- `spec.md` - write the markdown version of your spec here (duh)
|
|
9
|
-
3. In your main node.js file, drop in this bad boy: `require('spec-up')()`
|
|
10
|
-
|
|
11
|
-
Boom! That's it. Spec-Up will auto-detect the location of your spec files and auto-generate your spec's HTML version every time you hit save after editing your `spec.md` files. Did I mention you can have multiple specs located at any depth in your project and Spec-Up will crawl up in there and render all those specs like a damn boss? Well it does, because why the hell not.
|
|
12
|
-
|
|
13
|
-
**Usage**
|
|
14
|
-
|
|
15
|
-
If your `spec.json` and `package.json` and `package-lock.json` files are in working order, Spec-up can be called from the root of your repo in three different modes:
|
|
16
|
-
|
|
17
|
-
|command|behavior|
|
|
18
|
-
|---|---|
|
|
19
|
-
|`npm run edit`|after rendering, this will stay running and the `gulp` library will watch the source files in your spec directory/ies for changes and re-render any time you save a file. Opening these rendered files in a browser and refreshing them will keep you up to date.|
|
|
20
|
-
|`npm run render`|this renders the site once and does not keep a gulpy watch on the underlying files.|
|
|
21
|
-
|`npm run dev`|this enables debugging features.|
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
Spec-Up Multi-File Example
|
|
2
|
-
==================
|
|
3
|
-
|
|
4
|
-
**Specification Status:** Strawman
|
|
5
|
-
|
|
6
|
-
**Latest Draft:**
|
|
7
|
-
[https://github.com/decentralized-identity/spec-up](https://github.com/decentralized-identity/spec-up)
|
|
8
|
-
|
|
9
|
-
**Editors:**
|
|
10
|
-
~ [Daniel Buchner](https://www.linkedin.com/in/dbuchner/)
|
|
11
|
-
<!-- -->
|
|
12
|
-
**Participate:**
|
|
13
|
-
~ [GitHub repo](https://github.com/csuwildcat/spec-up)
|
|
14
|
-
~ [File a bug](https://github.com/csuwildcat/spec-up/issues)
|
|
15
|
-
~ [Commit history](https://github.com/csuwildcat/spec-up/commits/master)
|
|
16
|
-
|
|
17
|
-
------------------------------------
|