lib/grunt/apidoc2readme.js
function (doc, skipSignature, postHook) {
        var index = doc.indexOf('\n');
        var functionLine = '';
        if (!skipSignature) {
            functionLine = doc.substring(0, index).substring(4); //get first line and remove initial ###

            //wrap with "'", replace object#function to object.function, remove <code>, fix escape chars
            functionLine = '### \'' + functionLine.split('#').join('.').split('<code>').join('').split('</code>').join('').split('&.').join('&#') + '\'';

            //remove links
            var foundLinks = false;
            var field;
            var start;
            var end;
            do {
                end = functionLine.indexOf('](');
                if (end !== -1) {
                    start = functionLine.lastIndexOf('[', end);
                    field = functionLine.substring(start + 1, end);

                    end = functionLine.indexOf(')', start) + 1;

                    functionLine = functionLine.substring(0, start) + field + functionLine.substring(end);

                    foundLinks = true;
                } else {
                    foundLinks = false;
                }
            } while (foundLinks);
        }

        if (functionLine && postHook && (typeof postHook === 'function')) {
            functionLine = postHook(functionLine);
        }

        doc = functionLine + doc.substring(index);

        return doc;
    }
function (doc, skipSignature, postHook) {
        var index = doc.indexOf('\n');
        var functionLine = '';
        if (!skipSignature) {
            functionLine = doc.substring(0, index).substring(4); //get first line and remove initial ###

            //wrap with "'", replace object#function to object.function, remove <code>, fix escape chars
            functionLine = '### \'' + functionLine.split('#').join('.').split('<code>').join('').split('</code>').join('').split('&.').join('&#') + '\'';

            //remove links
            var foundLinks = false;
            var field;
            var start;
            var end;
            do {
                end = functionLine.indexOf('](');
                if (end !== -1) {
                    start = functionLine.lastIndexOf('[', end);
                    field = functionLine.substring(start + 1, end);

                    end = functionLine.indexOf(')', start) + 1;

                    functionLine = functionLine.substring(0, start) + field + functionLine.substring(end);

                    foundLinks = true;
                } else {
                    foundLinks = false;
                }
            } while (foundLinks);
        }

        if (functionLine && postHook && (typeof postHook === 'function')) {
            functionLine = postHook(functionLine);
        }

        doc = functionLine + doc.substring(index);

        return doc;
    }
function ( doc , skipSignature , postHook ) { var index = doc . indexOf ( '\n' ) ; var functionLine = '' ; if ( ! skipSignature ) { functionLine = doc . substring ( 0 , index ) . substring ( 4 ) ; //get first line and remove initial ### //wrap with "'", replace object#function to object.function, remove <code>, fix escape chars functionLine = '### \'' + functionLine . split ( '#' ) . join ( '.' ) . split ( '<code>' ) . join ( '' ) . split ( '</code>' ) . join ( '' ) . split ( '&.' ) . join ( '&#' ) + '\'' ; //remove links var foundLinks = false ; var field ; var start ; var end ; do { end = functionLine . indexOf ( '](' ) ; if ( end !== - 1 ) { start = functionLine . lastIndexOf ( '[' , end ) ; field = functionLine . substring ( start + 1 , end ) ; end = functionLine . indexOf ( ')' , start ) + 1 ; functionLine = functionLine . substring ( 0 , start ) + field + functionLine . substring ( end ) ; foundLinks = true ; } else { foundLinks = false ; } } while ( foundLinks ) ; } if ( functionLine && postHook && ( typeof postHook === 'function' ) ) { functionLine = postHook ( functionLine ) ; } doc = functionLine + doc . substring ( index ) ; return doc ; }
Returns the doc with updated signature line.

@function
@memberof! GruntApiDocs2ReadmeTaskHelper
@private
@param {String} doc - The document text
@param {Boolean} [skipSignature] - True to not create a signature line, just remove it
@param {function} [postHook] - Will be invoked after the signature was modified
@returns {String} The updated doc
Returns the doc with updated signature line .