spec-up-t 0.11.29 → 0.11.30

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.
@@ -0,0 +1,64 @@
1
+ /**
2
+ * @file This file contains a function that adds a blank line at the end of all markdown files in a directory and its subdirectories, only if the blank line is missing.
3
+ * @author Kor Dwarshuis
4
+ * @version 1.0.0
5
+ * @since 2024-08-20
6
+ */
7
+
8
+ const fs = require('fs');
9
+ const path = require('path');
10
+
11
+ // Function to process markdown files in a directory recursively
12
+ function processMarkdownFiles(directory) {
13
+ // Helper function to process a directory
14
+ function processDirectory(directory) {
15
+ // Read the contents of the directory
16
+ fs.readdir(directory, { withFileTypes: true }, (err, items) => {
17
+ if (err) {
18
+ console.error(`Error reading directory: ${err}`);
19
+ return;
20
+ }
21
+
22
+ // Loop through each item in the directory
23
+ items.forEach(item => {
24
+ const itemPath = path.join(directory, item.name);
25
+ if (item.isDirectory()) {
26
+ // If the item is a directory, call processDirectory recursively
27
+ processDirectory(itemPath);
28
+ } else if (item.isFile() && path.extname(item.name) === '.md') {
29
+ // If the item is a markdown file, process it
30
+ fs.readFile(itemPath, 'utf8', (err, data) => {
31
+ if (err) {
32
+ console.error(`Error reading file ${item.name}: ${err}`);
33
+ return;
34
+ }
35
+
36
+ // Check if the file ends with a blank line
37
+ if (!data.endsWith('\n')) {
38
+ // If not, add a blank line at the end
39
+ data += '\n';
40
+ // Write the modified content back to the file
41
+ fs.writeFile(itemPath, data, 'utf8', err => {
42
+ if (err) {
43
+ console.error(`Error writing file ${item.name}: ${err}`);
44
+ } else {
45
+ console.log(`Added blank line to ${item.name}`);
46
+ }
47
+ });
48
+ }
49
+ });
50
+ }
51
+ });
52
+ });
53
+ }
54
+
55
+ // Start processing from the given directory
56
+ processDirectory(directory);
57
+ }
58
+
59
+ const directoryPath = './spec';
60
+ processMarkdownFiles(directoryPath);
61
+
62
+ module.exports = {
63
+ processMarkdownFiles
64
+ }
@@ -128,8 +128,8 @@ function getXrefsData() {
128
128
  });
129
129
 
130
130
  // trim every entry of allMatches
131
- allXrefs.xrefs = allXrefs.xrefs.map(match => {
132
- return match.trim();
131
+ allXrefs.xrefs = allXrefs.xrefs.map(xref => {
132
+ return xref.trim();
133
133
  });
134
134
 
135
135
  // split every entry of allMatches on the first comma, replace the entry with an object that has two keys: one that contains everything before the comma and one that contains everything after the comma
@@ -181,7 +181,7 @@ function getXrefsData() {
181
181
  xref.repo = urlParts[2];
182
182
  });
183
183
 
184
- allXrefs.xrefs.forEach(match => {
184
+ allXrefs.xrefs.forEach(xref => {
185
185
  // loop through array of specs in config
186
186
  config.specs.forEach(spec => {
187
187
  if (spec.external_specs) {
@@ -194,17 +194,32 @@ function getXrefsData() {
194
194
  // ]
195
195
  spec.external_specs.forEach(externalSpec => {
196
196
  const key = Object.keys(externalSpec)[0];
197
- if (key === match.externalSpec) {
198
- match.site = externalSpec[key];
197
+ if (key === xref.externalSpec) {
198
+ xref.site = externalSpec[key];
199
199
  }
200
200
  });
201
201
  }
202
202
  });
203
203
  });
204
204
 
205
+ // Loop through all xrefs and fetch the latest commit hash for each term and add it to the xref object
206
+ /* Example of xref after adding commitHash:
207
+ xref: {
208
+ "externalSpec": "test-1",
209
+ "term": "Aal",
210
+ "repoUrl": "https://github.com/blockchainbird/spec-up-xref-test-1",
211
+ "terms_dir": "spec/term-definitions",
212
+ "owner": "blockchainbird",
213
+ "repo": "spec-up-xref-test-1",
214
+ "site": "https://blockchainbird.github.io/spec-up-xref-test-1/",
215
+ "commitHash": [
216
+ "f66951f1d378490289caab9c51141b44a0438365"
217
+ ]
218
+ }
219
+ */
205
220
  async function fetchLatestCommitHashes() {
206
- for (const match of allXrefs.xrefs) {
207
- match.commitHash = await fetchLatestCommitHash(match);
221
+ for (const xref of allXrefs.xrefs) {
222
+ xref.commitHash = await fetchLatestCommitHash(xref);
208
223
  }
209
224
  }
210
225
 
package/logo.png DELETED
Binary file
package/spec/header.md DELETED
@@ -1,20 +0,0 @@
1
- ## Status
2
-
3
- This is the first public review draft of the ToIP Glossary. It is also the first version published using the [Spec-Up specification editing utility](https://identity.foundation/spec-up/) developed by the [Decentralized Identity Foundation](http://identity.foundation/).
4
-
5
- ## Copyright Notice
6
-
7
- This specification is subject to the **OWF Contributor License Agreement 1.0 - Copyright**
8
- available at
9
- [https://www.openwebfoundation.org/the-agreements/the-owf-1-0-agreements-granted-claims/owf-contributor-license-agreement-1-0-copyright](https://www.openwebfoundation.org/the-agreements/the-owf-1-0-agreements-granted-claims/owf-contributor-license-agreement-1-0-copyright).
10
-
11
- These terms are inherited from the [Technical Stack Working Group](https://wiki.trustoverip.org/display/HOME/Technology+Stack+Working+Group) at the Trust over IP (ToIP) Foundation. [Working Group Charter](https://trustoverip.org/wp-content/uploads/TSWG-2-Charter-Revision.pdf)
12
-
13
-
14
- ## Terms of Use
15
-
16
- These materials are made available under and are subject to the [OWF CLA 1.0 - Copyright & Patent license](https://www.openwebfoundation.org/the-agreements/the-owf-1-0-agreements-granted-claims/owf-contributor-license-agreement-1-0-copyright-and-patent). Any source code is made available under the [Apache 2.0 license](https://www.apache.org/licenses/LICENSE-2.0.txt).
17
-
18
- THESE MATERIALS ARE PROVIDED “AS IS.” The Trust Over IP Foundation, established as the Joint Development Foundation Projects, LLC, Trust Over IP Foundation Series ("ToIP"), and its members and contributors (each of ToIP, its members and contributors, a "ToIP Party") expressly disclaim any warranties (express, implied, or otherwise), including implied warranties of merchantability, non-infringement, fitness for a particular purpose, or title, related to the materials. The entire risk as to implementing or otherwise using the materials is assumed by the implementer and user.
19
-
20
- IN NO EVENT WILL ANY ToIP PARTY BE LIABLE TO ANY OTHER PARTY FOR LOST PROFITS OR ANY FORM OF INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER FROM ANY CAUSES OF ACTION OF ANY KIND WITH RESPECT TO THESE MATERIALS, ANY DELIVERABLE OR THE ToIP GOVERNING AGREEMENT, WHETHER BASED ON BREACH OF CONTRACT, TORT (INCLUDING NEGLIGENCE), OR OTHERWISE, AND WHETHER OR NOT THE OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -1,32 +0,0 @@
1
-
2
- [//]: # (Pandoc Formatting Macros)
3
-
4
- [//]: # (::: introtitle)
5
-
6
- [//]: # (Introduction)
7
-
8
- [//]: # (:::)
9
-
10
- ## Introduction
11
-
12
- The ToIP Glossary is a deliverable of the ToIP Concepts and Terminology Working Group. Its purpose is to promote shared understanding of terms and concepts across the many different working groups, communities, enterprises, and ecosystems who are collaborating to develop and deploy decentralized digital trust infrastructure.
13
-
14
- Contributions and feedback are encouraged from any stakeholder in this area of terminology.
15
-
16
- ## Linking to this Glossary
17
-
18
- This glossary is designed to be both human and machine readable. All terms are listed alphabetically; acronyms are listed separately and linked to the fully expanded terms. Document authors can link directly to any term using standard web links and anchors following this syntax:
19
-
20
- `https://trustoverip.org/ctwg-main-glossary#term:xxxxx`
21
-
22
- Where `xxxxx` is the term as it appears in the glossary, with any spaces are replaced by en-dashes (hyphens). For example, a link to the term `self-certifying identifer` would be:
23
-
24
- `https://trustoverip.github.io/ctwg-main-glossary#self-certifiying-identifier`
25
-
26
- A specification document written using the [Decentralized Identity Foundation](http://identity.foundation/)'s open source [Spec-Up editor](https://identity.foundation/spec-up/) may create special external references to terms in this glossary using the Spec-Up `xref` tag following this syntax:
27
-
28
- `[[xref: glossary, xxxxx]]`
29
-
30
- Where `glossary` is the text label the document author assigns to the URL of a Web-accessible glossary, and `xxxxx` is the term as it appears in that glossary, with any spaces are replaced by en-dashes (hyphens). For example, a Spec-Up external reference to the term `self-certifying identifer` using the label `toip` for this glossary would look like this:
31
-
32
- `[[xref: toip, self-certifying-identifier]]`
@@ -1,24 +0,0 @@
1
- ## Referenced Glossaries
2
-
3
- [//]: # (Pandoc Formatting Macros)
4
-
5
- [//]: # (# Normative references)
6
-
7
- [//]: # (::: { #nrm:pdf2 .normref label="ISO 32000-2" })
8
-
9
- [//]: # (ISO 32000-2, *Document management --- Portable Document Format --- Part 2: PDF 2.0*)
10
-
11
- [//]: # (:::)
12
-
13
- The following glossaries were used as sources for some of the definitions in the ToIP Glossary. All source glossaries are cited in the definitions of each term.
14
-
15
- | Short Name | Source Glossary | URL |
16
- |------------|-----------------|-----|
17
- | Wikipedia | Wikipedia | https://www.wikipedia.org/ |
18
- | eSSIF-Lab | eSSIF-Lab Glossary | https://essif-lab.github.io/framework/docs/essifLab-glossary |
19
- | NIST-CSRC | NIST Computer Security Resource Center Glossary | https://csrc.nist.gov/glossary/ |
20
- | PEMC IGR | Kantara Privacy Enhancing Mobile Credentials Implementors Guidance Report | https://kantarainitiative.org/download/pemc-implementors-guidance-report/ |
21
- | W3C DID | W3C Decentralized Identifiers (DIDs) 1.0 | https://www.w3.org/TR/did-core/#terminology |
22
- | W3C VC | W3C VC Data Model 1.1 | https://www.w3.org/TR/vc-data-model/#terminology |
23
- | Ethereum | Ethereum.org Glossary | https://ethereum.org/ |
24
- | Merriam-Webster | Merriam-Webster Dictionary | https://www.merriam-webster.com/dictionary/ |
@@ -1,10 +0,0 @@
1
-
2
- [//]: # (Pandoc Formatting Macros)
3
-
4
- [//]: # (Portable Document Format)
5
-
6
- [//]: # (blank)
7
-
8
- [//]: # (: file format defined by ISO 32000-2)
9
-
10
- ## Terms & Definitions
package/spec/title.md DELETED
@@ -1,38 +0,0 @@
1
- ToIP Glossary
2
- ==================
3
-
4
- **Specification Status**: Public Review Draft 01 (PR1)
5
-
6
- **Latest Draft:**
7
-
8
- * [Github Repository](https://github.com/trustoverip/ctwg-main-glossary)
9
- * [Submit/View Issues](https://github.com/trustoverip/ctwg-main-glossary/issues)
10
- * [Discussions](https://github.com/trustoverip/ctwg-main-glossary/discussions)
11
-
12
- **Editors:**
13
-
14
- - [Drummond Reed](https://github.com/talltree), [Gen](https://www.gendigital.com)
15
- - [Henk van Caan](https://github.com/henkvancann)
16
-
17
- **Contributors:**
18
-
19
- - [Darrell O'Donnell](https://github.com/darrellodonnell), [Continuum Loop Inc.](https://www.continuumloop.com/)
20
- - [Kevin Griffin](https://github.com/m00sey), [GLEIF](https://gleif.org)
21
- - [Kor Dwarshuis](https://github.com/kordwarshuis/)
22
- - [Neil Thomson] TODO
23
- - [Nicky Hickman] TODO
24
- - [Rieks Joosten] TODO
25
- - TODO
26
-
27
- **Participate:**
28
-
29
- ~ [GitHub repo](https://github.com/trustoverip/ctwg-main-glossary)
30
- ~ [Commit history](https://github.com/trustoverip/ctwg-main-glossary/commits/main)
31
-
32
- ------------------------------------
33
-
34
- [//]: # (Pandoc Formatting Macros)
35
-
36
- [//]: # (\maketitle)
37
-
38
- [//]: # (\newpage)
package/spec/toc.md DELETED
@@ -1,4 +0,0 @@
1
-
2
- [//]: # (Pandoc Formatting Macros)
3
-
4
- [//]: # (\toc)