Generate documentation for available options for each beautifier
This commit is contained in:
parent
b41daabaa6
commit
c6492bf100
|
@ -9,6 +9,13 @@ console.log('Generating options...')
|
||||||
beautifier = new Beautifiers()
|
beautifier = new Beautifiers()
|
||||||
languageOptions = beautifier.options
|
languageOptions = beautifier.options
|
||||||
packageOptions = require('../src/config.coffee')
|
packageOptions = require('../src/config.coffee')
|
||||||
|
# Build options by Beautifier
|
||||||
|
beautifierOptions = {}
|
||||||
|
for optionName, optionDef of languageOptions
|
||||||
|
beautifiers = optionDef.beautifiers ? []
|
||||||
|
for beautifierName in beautifiers
|
||||||
|
beautifierOptions[beautifierName] ?= {}
|
||||||
|
beautifierOptions[beautifierName][optionName] = optionDef
|
||||||
|
|
||||||
console.log('Loading options template...')
|
console.log('Loading options template...')
|
||||||
optionsTemplatePath = __dirname + '/options-template.md'
|
optionsTemplatePath = __dirname + '/options-template.md'
|
||||||
|
@ -23,6 +30,7 @@ template = Handlebars.compile(optionsTemplate)
|
||||||
context = {
|
context = {
|
||||||
packageOptions: packageOptions
|
packageOptions: packageOptions
|
||||||
languageOptions: languageOptions
|
languageOptions: languageOptions
|
||||||
|
beautifierOptions: beautifierOptions
|
||||||
}
|
}
|
||||||
result = template(context)
|
result = template(context)
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
### {{#if title}} {{title}} {{else}} `{{@key}}` {{/if}}
|
#### {{#if title}} {{title}} {{else}} `{{@key}}` {{/if}}
|
||||||
|
|
||||||
**Key**: `{{@key}}`
|
**Key**: `{{@key}}`
|
||||||
{{#if default}}
|
{{#if default}}
|
||||||
|
@ -11,6 +11,10 @@
|
||||||
|
|
||||||
**Enum**: {{#each enum}} `{{this}}` {{/each}}
|
**Enum**: {{#each enum}} `{{this}}` {{/each}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
{{#if beautifiers}}
|
||||||
|
|
||||||
|
**Supported Beautifiers**: {{#each beautifiers}} `{{this}}` {{/each}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
**Description**:
|
**Description**:
|
||||||
|
|
||||||
|
|
|
@ -21,3 +21,18 @@ Supported options for each language.
|
||||||
{{#each languageOptions}}
|
{{#each languageOptions}}
|
||||||
{{> option}}
|
{{> option}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
|
||||||
|
## Beautifier Options
|
||||||
|
|
||||||
|
Supported options for each beautifier.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
{{#each beautifierOptions}}
|
||||||
|
### {{@key}}
|
||||||
|
|
||||||
|
{{#each this}}
|
||||||
|
{{> option}}
|
||||||
|
{{/each}}
|
||||||
|
|
||||||
|
{{/each}}
|
||||||
|
|
1422
docs/options.md
1422
docs/options.md
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue