File tree Expand file tree Collapse file tree 3 files changed +22
-9
lines changed
Expand file tree Collapse file tree 3 files changed +22
-9
lines changed Original file line number Diff line number Diff line change @@ -102,6 +102,16 @@ export const DOC_TYPES_MAPPING_PRIMITIVES = {
102102 undefined : 'Undefined' ,
103103} ;
104104
105+ // https://github.com/nodejs/node/blob/main/doc/api/cli.md#options
106+ // This slug should reference the section where the available
107+ // options are defined.
108+ export const DOC_SLUG_OPTIONS = 'options' ;
109+
110+ // https://github.com/nodejs/node/blob/main/doc/api/cli.md#environment-variables-1
111+ // This slug should reference the section where the available
112+ // environment variables are defined.
113+ export const DOC_SLUG_ENVIRONMENT = 'evironment-options-1' ;
114+
105115// This is a mapping for types within the Markdown content and their respective
106116// JavaScript globals types within the MDN JavaScript docs
107117// @see DOC_MDN_BASE_URL_JS_GLOBALS
Original file line number Diff line number Diff line change 88 convertEnvVarToMandoc ,
99} from './utils/converter.mjs' ;
1010
11+ import { DOC_SLUG_ENVIRONMENT , DOC_SLUG_OPTIONS } from '../../constants.mjs' ;
12+
1113/**
1214 * This generator generates a man page version of the CLI.md file.
1315 * See https://man.openbsd.org/mdoc.7 for the formatting.
@@ -29,13 +31,15 @@ export default {
2931 // Filter to only 'cli'.
3032 const components = input . filter ( ( { api } ) => api === 'cli' ) ;
3133 if ( ! components . length ) {
32- throw new Error ( 'CLI.md not found ' ) ;
34+ throw new Error ( 'Could not find any `cli` documentation. ' ) ;
3335 }
3436
3537 // Find the appropriate headers
36- const optionsStart = components . findIndex ( ( { slug } ) => slug === 'options' ) ;
38+ const optionsStart = components . findIndex (
39+ ( { slug } ) => slug === DOC_SLUG_OPTIONS
40+ ) ;
3741 const environmentStart = components . findIndex (
38- ( { slug } ) => slug === 'environment-variables-1'
42+ ( { slug } ) => slug === DOC_SLUG_ENVIRONMENT
3943 ) ;
4044 // The first header that is <3 in depth after environmentStart
4145 const environmentEnd = components . findIndex (
Original file line number Diff line number Diff line change 11.\"
2- .\" This file is automatically generated by api-docs-tooling.
3- .\" Do not edit this file directly. Please make changes to CLI .md
4- .\" and then regenerate this file.
2+ .\" This file was generated automatically by the api-docs-tooling tool .
3+ .\" Please do not edit this file manually. Make any updates to cli .md
4+ .\" and regenerate the file afterward .
55.\"
6- .\" For generation instructions using api-docs-tooling, see:
7- .\" https://github.com/nodejs/api-docs-tooling
6+ .\" To regenerate this file, run `make doc/node.1`.
87.\"
98.\" ======================================================================
109.Dd $Mdocdate $
@@ -71,4 +70,4 @@ Documentation:
7170.
7271.Pp
7372GitHub repository and issue tracker:
74- .Sy https://github.com/nodejs/node
73+ .Sy https://github.com/nodejs/node
You can’t perform that action at this time.
0 commit comments