o3d/documentation/jsdoc-toolkit-templates/publish.js
/**
 * Converts a JSDOC type specification into html links. For example
 * '(!o3djs.math.Vector3|!O3D.math.Vector4)' would change to
 * '(!<a href="??">o3djs.math.Vector3</a>
 * |!<a href="??">o3djs.math.Vector4</a>)'.
 * @param {string} place Use to print error message if type not found.
 * @param {string} str to linkify.
 * @return {string} linkified string.
 */
Converts a JSDOC type specification into html links.
Converts a JSDOC type specification into html links .
function linkifyTypeSpec(place, str) {
  var output = '';
  if (str) {
    var fixed = fixSpecCommas(str);
    if (startsWith(fixed, '(') && endsWith(fixed, ')')) {
      var types = fixed.substring(1, fixed.length - 1).split('|');
      output += '(';
      for (var tt = 0; tt < types.length; ++tt) {
        if (tt > 0) {
          output += '|';
        }
        output += linkifySingleType(place, types[tt]);
      }
      output += ')';
    } else {
      output += linkifySingleType(place, fixed);
    }
  } else {
    generatePlaceError(place, 'missing type specification (' + str + ')');
  }
  return output;
}
function linkifyTypeSpec ( place , str ) { var output = '' ; if ( str ) { var fixed = fixSpecCommas ( str ) ; if ( startsWith ( fixed , '(' ) && endsWith ( fixed , ')' ) ) { var types = fixed . substring ( 1 , fixed . length - 1 ) . split ( '|' ) ; output += '(' ; for ( var tt = 0 ; tt < types . length ; ++ tt ) { if ( tt > 0 ) { output += '|' ; } output += linkifySingleType ( place , types [ tt ] ) ; } output += ')' ; } else { output += linkifySingleType ( place , fixed ) ; } } else { generatePlaceError ( place , 'missing type specification (' + str + ')' ) ; } return output ; }
Converts a JSDOC type specification into html links.
Converts a JSDOC type specification into html links .
// TODO: needs to split outside of parens and angle brackets.