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()
|
||||
languageOptions = beautifier.options
|
||||
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...')
|
||||
optionsTemplatePath = __dirname + '/options-template.md'
|
||||
|
@ -23,6 +30,7 @@ template = Handlebars.compile(optionsTemplate)
|
|||
context = {
|
||||
packageOptions: packageOptions
|
||||
languageOptions: languageOptions
|
||||
beautifierOptions: beautifierOptions
|
||||
}
|
||||
result = template(context)
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
### {{#if title}} {{title}} {{else}} `{{@key}}` {{/if}}
|
||||
#### {{#if title}} {{title}} {{else}} `{{@key}}` {{/if}}
|
||||
|
||||
**Key**: `{{@key}}`
|
||||
{{#if default}}
|
||||
|
@ -11,6 +11,10 @@
|
|||
|
||||
**Enum**: {{#each enum}} `{{this}}` {{/each}}
|
||||
{{/if}}
|
||||
{{#if beautifiers}}
|
||||
|
||||
**Supported Beautifiers**: {{#each beautifiers}} `{{this}}` {{/each}}
|
||||
{{/if}}
|
||||
|
||||
**Description**:
|
||||
|
||||
|
|
|
@ -21,3 +21,18 @@ Supported options for each language.
|
|||
{{#each languageOptions}}
|
||||
{{> option}}
|
||||
{{/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