MCPcopy Index your code
hub / github.com/lingodotdev/lingo.dev / buildOptionEntries

Function buildOptionEntries

scripts/docs/src/generate-cli-docs.ts:306–335  ·  view source on GitHub ↗
({
  options,
  commandPath,
  depth,
}: BuildOptionEntriesArgs)

Source from the content-addressed store, hash-verified

304};
305
306function buildOptionEntries({
307 options,
308 commandPath,
309 depth,
310}: BuildOptionEntriesArgs): Content[] {
311 const nodes: Content[] = [];
312 const headingDepth = Math.min(depth + 1, 6);
313
314 options.forEach((option) => {
315 const signature = formatOptionSignature(option);
316 nodes.push(createHeading(headingDepth, [createInlineCode(signature)]));
317
318 nodes.push({
319 type: "code",
320 lang: "bash",
321 value: buildOptionUsage(commandPath, option),
322 });
323
324 if (option.description) {
325 nodes.push(createParagraph(option.description));
326 }
327
328 const details = buildOptionDetails(option);
329 if (details.length > 0) {
330 nodes.push(createParagraph(details.join(" ")));
331 }
332 });
333
334 return nodes;
335}
336
337function buildArgumentListItems(args: readonly Argument[]): ListItem[] {
338 return args.map((arg) => {

Callers 1

buildCommandSectionFunction · 0.85

Calls 7

formatOptionSignatureFunction · 0.85
createHeadingFunction · 0.85
createInlineCodeFunction · 0.85
buildOptionUsageFunction · 0.85
createParagraphFunction · 0.85
buildOptionDetailsFunction · 0.85
pushMethod · 0.65

Tested by

no test coverage detected