Skip to content

Settings

msuarz edited this page Oct 28, 2012 · 34 revisions

There are multiple level of Settings available
The Settings files are settings.coffee files
They export a settings JSON object with coffee syntax
And are available for the code as global.settings

Defaults

They ship with the module, providing global presets.
In current stage it is not recommended to change file
It would be overridden upon npm updates

Example: Current Defaults [ src\settings.coffee ]

@defaults =
   
  docs:
    reader: 'docs'
    root: '.'
    type: '.txt'
    multiline_arg: /^"{3}$/
  report: 'console'
  code:
    reader: 'code'
    root: '.'
   

Project

They are applied over the Default Settings
And should be placed at the root of the doc's directory

Example: Frankendoc's project settings [ docs\settings.coffee ]

@settings =
   
  docs:
    reader: 'github'
    repo: 'git://github.com/limadelic/frankendoc.wiki.git'
    type: '.md'
    code_block: /`{3}([\s\S]*?)`{3}/g
    multiline_arg: /^(\s{3}|"{3})$/
  code:
    root: 'docs/src'
   

Command Line

$ frank args are interpreted using Optimist
They are applied over the global.settings
Allowing to override Defaults and Project settings

$ frank -h
   
Usage: frank [docs] [options] 

Docs: [docs.root\[docs.type]]

  shortcut to set root & type properties in settings.docs 

  --docs.root              docs root folder [.]
  --docs.type              extension of doc files [*.txt]

Options: 

  these become settings properties
  
  -h, --help               output usage information
  -r, --report <name>      select report output [console]
  -o, --only <pattern>     only run docs matching <pattern>
   

Example: Using teamcity report

$ frank docs --only Args --report teamcity
   
##teamcity[testSuiteStarted name='frankendoc.wiki']
##teamcity[testStarted name='Args']
##teamcity[testFinished name='Args' duration='2']
##teamcity[testSuiteFinished name='frankendoc.wiki' duration='2']
   
Clone this wiki locally