File size: 657 Bytes
61d39e2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import dedent from 'dedent';
import configVals from './config-vals.json.js';

const mdlib = {};
mdlib.h = (out, n, str) => {
    out(`${'#'.repeat(n)} ${str}\n\n`);
};

const N_START = 3;

const out = str => process.stdout.write(str);
for ( const configVal of configVals ) {
    mdlib.h(out, N_START, `\`${configVal.key}\``);
    out(`${dedent(configVal.description) }\n\n`);

    if ( configVal.example_values ) {
        mdlib.h(out, N_START + 1, 'Examples');
        for ( const example of configVal.example_values ) {
            out(`- \`"${configVal.key}": ${JSON.stringify(example)}\`\n`);
        }
    }

    out('\n');

}