tools/docgenerator.js
function functionEntry (name) {
      const fn = functions[name]
      let syntax = SYNTAX[name] || (fn.doc && fn.doc.syntax && fn.doc.syntax[0]) || name
      syntax = syntax
        // .replace(/^math\./, '')
        .replace(/\s+\/\/.*$/, '')
        .replace(/;$/, '')
      if (syntax.length < 40) {
        syntax = syntax.replace(/ /g, '&nbsp;')
      }

      let description = ''
      if (fn.doc.description) {
        description = fn.doc.description.replace(/\n/g, ' ').split('.')[0] + '.'
      }

      return '[' + syntax + '](functions/' + name + '.md) | ' + description
    }
function functionEntry (name) {
      const fn = functions[name]
      let syntax = SYNTAX[name] || (fn.doc && fn.doc.syntax && fn.doc.syntax[0]) || name
      syntax = syntax
        // .replace(/^math\./, '')
        .replace(/\s+\/\/.*$/, '')
        .replace(/;$/, '')
      if (syntax.length < 40) {
        syntax = syntax.replace(/ /g, '&nbsp;')
      }

      let description = ''
      if (fn.doc.description) {
        description = fn.doc.description.replace(/\n/g, ' ').split('.')[0] + '.'
      }

      return '[' + syntax + '](functions/' + name + '.md) | ' + description
    }
function functionEntry ( name ) { const fn = functions [ name ] let syntax = SYNTAX [ name ] || ( fn . doc && fn . doc . syntax && fn . doc . syntax [ 0 ] ) || name syntax = syntax // .replace(/^math\./, '') . replace ( / \s+\/\/.*$ / , '' ) . replace ( / ;$ / , '' ) if ( syntax . length < 40 ) { syntax = syntax . replace ( / / g , '&nbsp;' ) } let description = '' if ( fn . doc . description ) { description = fn . doc . description . replace ( / \n / g , ' ' ) . split ( '.' ) [ 0 ] + '.' } return '[' + syntax + '](functions/' + name + '.md) | ' + description }
Helper function to generate a markdown list entry for a function.
Used to generate both alphabetical and categorical index pages.
@param {string} name Function name
@returns {string}    Returns a markdown list entry
Helper function to generate a markdown list entry for a function . Used to generate both alphabetical and categorical index pages .