publishFile

([Object], Object) → undefined
Parameters
  • Objectdata

    TaffyDB database passed in by JSDoc

  • Objectopts

    Options info passed in by JSDoc

  • Arrayopts._

    List of files/directories to scan

  • Stringopts.readme

    Text to use for README page

  • Stringopts.configure

    Path to JSDoc configuration file, e.g. ".jsdoc.json"

  • Stringopts.destination

    The path to the output folder for the generated documentation.

  • Stringopts.encoding

    Assume this encoding when reading all source files. Defaults to "utf8".

  • Booleanopts.pedantic

    Treat errors as fatal errors, and treat warnings as errors.

  • Booleanopts.private

    Include symbols marked with the @private tag in the generated documentation.

  • Booleanopts.recurse

    Recurse into subdirectories when scanning for source files and tutorials

  • Stringopts.template

    The path to the template directory to use for generating output (the directory containing the publish.js script and other needed files)

  • Returns:undefined

Added in v0.0.1

Function called by JSDoc to generate the final documentation files.

Empties target directory specified in opts.destination then populates with documentation files generated from data passed in by JSDoc.

_copyDirFile

(String, String) → undefined
Parameters
  • StringsourceDir

    Directory from which to copy contents

  • StringdestDir

    Directory to copy to

  • Returns:undefined

Added in v0.0.1

Copies a directory's contents recursively, creating the destination directory if needed

_copyDir(
  '/Users/foo/elv-ramdoc/node_modules/ramda/dist',
  '/Users/foo/elv-ramdoc/docs/js',
) //=> undefined

_markdownToHtmlString

String → String
Parameters
  • StringmdString

    text in Markdown format

  • Returns:String

    HTML text

Added in v0.0.1

Converts text in Markdown format to an HTML string

_markdownToHtml('#foo') //=> '<h1 id="foo">foo</h1>'

_prettifyCodeString

String | [String] → String
Parameters
  • String(unnamed)

    string or array of strings containing lines of code

  • Returns:String

    HTML text

Added in v0.0.1

Formats example Javascript code using highlight.js syntax highlighting

_prettifyCode('console.log(x)') //=> '<span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(x)'

_prettifySigString

String → String
Parameters
  • String(unnamed)

    input string (@sig tag contents)

  • Returns:String

    String with symbols substituted in

Added in v0.0.1

Replaces '...' with '…' and '->' with '→'. Used for processing @sig tags

_prettifySig('a -> b') //=> 'a → b'

_simplifyDataArray

String → ([Object] → [Object])
Parameters
  • StringbaseDir

    base directory of project

  • Returns:function

    Function that accepts and array of objects and returns an array of new objects

Added in v0.0.1

Returns a function that converts an array of JSDoc data objects to an array of objects tailored for our pug template.

_simplifySeeArray

[String] → [String]
Parameters
  • Array.<String>(unnamed)

    @see tag contents as string array

  • Returns:Array.<String>

    String array with each item in a separate element, regardless of whether it was on a new line or was on same line as another item but separated by a comma

Added in v0.0.1

Splits each string in an array by comma (excising whitespace in the process), keeping the array flat. Used to simplify handling of @see tag listing multiple items, where items might be listed on same line (separated by commas) on multiple lines.

_simplifySee(
  [
    'foo, bar',
    'baz'
  ]
) //=> [ 'foo', 'bar', 'baz' ]

_titleFilterArray

String → [Object] → [Object]
Parameters
  • String(unnamed)

    The string to filter by

  • Array.<Object>(unnamed)

    Array of objects to filter by 'title' attribute

  • Returns:Array.<Object>

    The filtered object array

Added in v0.0.1

Filters array of objects based on title attribute.

_titleFilter('see')(
  [
    {title: 'since'},
    {title: 'see'}
  ]
) //=> [{title: 'see'}]

_valuePropArray

[Object] → [*]
Parameters
  • Array.<Object>(unnamed)

    Array of objects

  • Returns:Array

    Extracted value property from each object

Added in v0.0.1

Extracts 'value' property from an array of objects, flattening one level if 'value' is an array

_valueProp(
  [
    {value: 'a'},
    {value: ['b', 'c']}
  ]
) //=> ['a', 'b', 'c']