-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dcddf02
commit 85948b9
Showing
4 changed files
with
152 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
const fs = require('fs'); | ||
|
||
const jsonFilePath = process.argv[2]; | ||
const markdownFilePath = process.argv[3]; | ||
|
||
// Check if file paths are provided | ||
if (!jsonFilePath || !markdownFilePath) { | ||
console.error('Both a JSON file path and a Markdown file path must be provided.'); | ||
process.exit(1); | ||
} | ||
|
||
const jsonData = JSON.parse(fs.readFileSync(jsonFilePath, 'utf8')); | ||
const sortedKeys = Object.keys(jsonData).sort((a, b) => b.length - a.length); | ||
|
||
let markdown = fs.readFileSync(markdownFilePath, 'utf8'); | ||
|
||
for (const key of sortedKeys) { | ||
const newName = jsonData[key][1] | ||
? `[${jsonData[key][0]}](${jsonData[key][1]})` | ||
: jsonData[key][0]; | ||
|
||
const regex = new RegExp(key, 'g'); | ||
markdown = markdown.replace(regex, newName); | ||
} | ||
|
||
// output the new markdown to stdout | ||
fs.writeFileSync(1, markdown); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
{ | ||
"Cors": [ | ||
"Cross-Origin Resource Sharing", | ||
null | ||
], | ||
"DAgPbConversion": [ | ||
"DAG Protobuf Conversion", | ||
null | ||
], | ||
"DNSLinkGateway": [ | ||
"DNS Link Gateway", | ||
"https://specs.ipfs.tech/http-gateways/dnslink-gateway/" | ||
], | ||
"DNSLinkGatewayUnixFSDirectoryListing": [ | ||
"DNS Link Gateway Unix FS Directory Listing", | ||
"https://specs.ipfs.tech/http-gateways/dnslink-gateway/" | ||
], | ||
"GatewayBlock": [ | ||
"Gateway Block", | ||
null | ||
], | ||
"GatewayCache": [ | ||
"Gateway Cache", | ||
null | ||
], | ||
"GatewayCacheWithIPNS": [ | ||
"Gateway Cache with IPNS", | ||
null | ||
], | ||
"GatewayIPNSRecord": [ | ||
"Gateway IPNS Record", | ||
null | ||
], | ||
"GatewayJSONCborAndIPNS": [ | ||
"Gateway JSON CBOR and IPNS", | ||
null | ||
], | ||
"GatewayJsonCbor": [ | ||
"Gateway JSON CBOR", | ||
null | ||
], | ||
"GatewaySubdomainAndIPNS": [ | ||
"Gateway Subdomain and IPNS", | ||
null | ||
], | ||
"GatewaySubdomains": [ | ||
"Gateway Subdomains", | ||
null | ||
], | ||
"GatewaySymlink": [ | ||
"Gateway Symbolic Link", | ||
null | ||
], | ||
"NativeDag": [ | ||
"Native DAG", | ||
null | ||
], | ||
"Pathing": [ | ||
"Pathing", | ||
null | ||
], | ||
"PlainCodec": [ | ||
"Plain Codec", | ||
null | ||
], | ||
"RedirectsFileSupport": [ | ||
"Redirects File Support", | ||
"https://specs.ipfs.tech/http-gateways/web-redirects-file/" | ||
], | ||
"RedirectsFileSupportWithDNSLink": [ | ||
"Redirects File Support with DNS Link", | ||
"https://specs.ipfs.tech/http-gateways/web-redirects-file/" | ||
], | ||
"SubdomainGatewayDNSLinkInlining": [ | ||
"Subdomain Gateway DNS Link Inlining", | ||
null | ||
], | ||
"Tar": [ | ||
"Tar", | ||
null | ||
], | ||
"TrustlessCarDagScopeAll": [ | ||
"Trustless Car DAG Scope All", | ||
"https://specs.ipfs.tech/http-gateways/trustless-gateway/" | ||
], | ||
"TrustlessCarDagScopeBlock": [ | ||
"Trustless Car DAG Scope Block", | ||
"https://specs.ipfs.tech/http-gateways/trustless-gateway/" | ||
], | ||
"TrustlessCarDagScopeEntity": [ | ||
"Trustless Car DAG Scope Entity", | ||
"https://specs.ipfs.tech/http-gateways/trustless-gateway/" | ||
], | ||
"TrustlessCarEntityBytes": [ | ||
"Trustless Car Entity Bytes", | ||
"https://specs.ipfs.tech/http-gateways/trustless-gateway/" | ||
], | ||
"TrustlessCarPathing": [ | ||
"Trustless Car Pathing", | ||
"https://specs.ipfs.tech/http-gateways/trustless-gateway/" | ||
], | ||
"TrustlessRaw": [ | ||
"Trustless Raw", | ||
"https://specs.ipfs.tech/http-gateways/trustless-gateway/" | ||
], | ||
"UnixFSDirectoryListing": [ | ||
"Unix FS Directory Listing", | ||
null | ||
], | ||
"UnixFSDirectoryListingOnSubdomainGateway": [ | ||
"Unix FS Directory Listing on Subdomain Gateway", | ||
null | ||
], | ||
"conformance-bifrost-gateway": [ | ||
"Bifrost Gateway", | ||
"https://github.com/ipfs/bifrost-gateway" | ||
], | ||
"conformance-kubo-gateway": [ | ||
"Kubo Gateway", | ||
"https://github.com/ipfs/kubo" | ||
] | ||
} |