@fern-api/generator-cli 0.0.10-41618efd4 → 0.0.11-9ad75c8f6
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/dist/cli.cjs +20 -4
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -13316,14 +13316,28 @@ var ReferenceGenerator = class {
|
|
|
13316
13316
|
}
|
|
13317
13317
|
async generate({ output }) {
|
|
13318
13318
|
const writer = new StreamWriter(output);
|
|
13319
|
+
writer.writeLine("# Reference");
|
|
13320
|
+
if (this.referenceConfig.rootSection !== void 0) {
|
|
13321
|
+
this.writeRootSection({ section: this.referenceConfig.rootSection, writer });
|
|
13322
|
+
}
|
|
13319
13323
|
for (const section of this.referenceConfig.sections) {
|
|
13320
13324
|
this.writeSection({ section, writer });
|
|
13321
13325
|
}
|
|
13322
13326
|
writer.end();
|
|
13323
13327
|
}
|
|
13328
|
+
writeRootSection({ section, writer }) {
|
|
13329
|
+
if (section.description !== void 0) {
|
|
13330
|
+
writer.writeLine(`${section.description}`);
|
|
13331
|
+
}
|
|
13332
|
+
for (const endpoint of section.endpoints) {
|
|
13333
|
+
this.writeEndpoint({ endpoint, writer });
|
|
13334
|
+
}
|
|
13335
|
+
}
|
|
13324
13336
|
writeSection({ section, writer }) {
|
|
13325
13337
|
writer.writeLine(`## ${section.title}`);
|
|
13326
|
-
|
|
13338
|
+
if (section.description !== void 0) {
|
|
13339
|
+
writer.writeLine(`${section.description}`);
|
|
13340
|
+
}
|
|
13327
13341
|
for (const endpoint of section.endpoints) {
|
|
13328
13342
|
this.writeEndpoint({ endpoint, writer });
|
|
13329
13343
|
}
|
|
@@ -13358,9 +13372,11 @@ ${this.writeIndentedBlock(
|
|
|
13358
13372
|
`
|
|
13359
13373
|
);
|
|
13360
13374
|
}
|
|
13361
|
-
|
|
13362
|
-
|
|
13363
|
-
|
|
13375
|
+
let linkedSnippet = this.wrapInLinksAndJoin(endpoint.title.snippetParts);
|
|
13376
|
+
if (endpoint.title.returnValue != null) {
|
|
13377
|
+
linkedSnippet += ` -> ${this.wrapInLink(endpoint.title.returnValue.text, endpoint.title.returnValue.location)}`;
|
|
13378
|
+
}
|
|
13379
|
+
writer.writeLine(`<details><summary><code>${linkedSnippet}</code></summary>`);
|
|
13364
13380
|
writer.writeLine(this.writeIndentedBlock(stringWriter.toString()));
|
|
13365
13381
|
writer.writeLine("</details>\n");
|
|
13366
13382
|
}
|