Class: UsageParser

Defined in: src\components\usage.coffee

Overview

Parses example files

Variables Summary

name =
"UsageParser"

Instance Method Summary

Constructor Details

# (void) constructor(options)

Creates a new UsageParser addUsage can optionally be given as an array of strings that will be concatenated by the module. This is to enhance readability of package.json

Parameters:

  • (options) ( Object ) An optional set of options

Options Hash: (options):

  • encoding ( String ) Encoding for reading the file ['utf-8']
  • replaceReferences ( Boolean ) Replace '../' in examples with pkg name [true]
  • addUsage ( String ) Additional text for the usage section ['']
  • exampleDir ( String ) Examples dir to be used unless in package.json ['examples']

Instance Method Details

# (void) run(pkg)

Includes the files from the examples directory as usage examples. If this.options.replaceModuleReferences is true, Strings of the form '../' and "../" will be replaced by the package name, so that require("../") will show as require('my-package-name'). @returns [Promise] Usage information [{name: string, file: string}]

Parameters:

  • pkg ( Object ) package.json data

    Quickly fuzzy find classes, mixins, methods, file:

    • T Open fuzzy finder dialog

    Control the navigation frame:

    • L Toggle list view
    • C Show class list
    • I Show mixin list
    • F Show file list
    • M Show method list
    • E Show extras list

    You can focus and blur the search input:

    • S Focus search input
    • Esc Blur search input