How to use the jsdoc/util/templateHelper.getUniqueFilename function in jsdoc

To help you get started, we’ve selected a few jsdoc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github HumanBrainProject / jsdoc-sphinx / template / publish.js View on Github external
doclet.signature += ')';

    _.each(doclet.returns, function(r) {
      if (!(r && r.type && r.type.names)) {
        logger.debug('Bad return', r, doclet.longname);
        return;
      }
      r.signature = ':return ' +
        r.type && r.type.names && r.type.names.join('|');
    });
  }

  // build the list of page generation actions.
  var actions = [];
  actions.push(generate(
    helper.getUniqueFilename('index'), require('./view-models/home')));
  actions.push(generate(
    'conf.py', require('./view-models/sphinx-config')));
  var docletModel = require('./view-models/doclet');
  context.data().each(function(doclet) {
    var url = helper.longnameToUrl[doclet.longname];
    if (url.indexOf('#') !== -1) {
      logger.debug('URL Generator', url, doclet.longname);
      url = helper.longnameToUrl[doclet.longname].split(/#/).pop();
      logger.debug('URL Generated', url);
    }
    if (util.mainDocletKinds.indexOf(doclet.kind) !== -1) {
      actions.push(generate(url, docletModel(doclet)));
    }
  });

  // publish must be synchronous as the caller does not care about callbacks.
github uralys / maperial.js / assets / jsdoc-jaguarjs / publish.js View on Github external
exports.publish = function(taffyData, opts, tutorials) {
    data = taffyData;

    var conf = env.conf.templates || {};
    conf['default'] = conf['default'] || {};

    var templatePath = opts.template;
    view = new template.Template(templatePath + '/tmpl');
    
    // claim some special filenames in advance, so the All-Powerful Overseer of Filename Uniqueness
    // doesn't try to hand them out later
    var indexUrl = helper.getUniqueFilename('index');
    // don't call registerLink() on this one! 'index' is also a valid longname

    var globalUrl = helper.getUniqueFilename('global');
    helper.registerLink('global', globalUrl);

    // set up templating
    view.layout = 'layout.tmpl';

    // set up tutorials for helper
    helper.setTutorials(tutorials);

    data = helper.prune(data);
    data.sort('longname, version, since');
    helper.addEventListeners(data);

    var sourceFiles = {};
github jsdoc / jsdoc / templates / default / publish.js View on Github external
exports.publish = function(taffyData, opts, tutorials) {
    data = taffyData;

    var conf = env.conf.templates || {};
    conf['default'] = conf['default'] || {};

    var templatePath = opts.template;
    view = new template.Template(templatePath + '/tmpl');

    // claim some special filenames in advance, so the All-Powerful Overseer of Filename Uniqueness
    // doesn't try to hand them out later
    var indexUrl = helper.getUniqueFilename('index');
    // don't call registerLink() on this one! 'index' is also a valid longname

    var globalUrl = helper.getUniqueFilename('global');
    helper.registerLink('global', globalUrl);

    // set up templating
    view.layout = conf['default'].layoutFile ?
        path.getResourcePath(path.dirname(conf['default'].layoutFile),
            path.basename(conf['default'].layoutFile) ) :
        'layout.tmpl';

    // set up tutorials for helper
    helper.setTutorials(tutorials);

    data = helper.prune(data);
    data.sort('longname, version, since');
    helper.addEventListeners(data);

    var sourceFiles = {};
github archilogic-com / 3dio-js / tasks / jsdoc / template / publish.js View on Github external
Object.keys(sourceFiles).forEach(function(file) {
    var source
    // links are keyed to the shortened path in each doclet's `meta.shortpath` property
    var sourceOutfile = helper.getUniqueFilename(sourceFiles[file].shortened)
    helper.registerLink(sourceFiles[file].shortened, sourceOutfile)

    try {
      source = {
        kind: "source",
        code: helper.htmlsafe(
          fs.readFileSync(sourceFiles[file].resolved, encoding)
        )
      }
    } catch (e) {
      logger.error("Error while generating source file %s: %s", file, e.message)
    }

    generate(
      "Source",
      sourceFiles[file].shortened,
github janpaepke / ScrollMagic / dev / docs / template / publish.js View on Github external
path = require( 'jsdoc/path' ),
	taffy = require( 'taffydb' ).taffy,
	handle = require( 'jsdoc/util/error' ).handle,
	helper = require( 'jsdoc/util/templateHelper' ),
	htmlsafe = helper.htmlsafe,
	linkto = helper.linkto,
	resolveAuthorLinks = helper.resolveAuthorLinks,
	scopeToPunc = helper.scopeToPunc,
	hasOwnProp = Object.prototype.hasOwnProperty,
	conf = env.conf.templates || {},
	data,
	view,
	outdir = env.opts.destination;

var globalUrl = helper.getUniqueFilename( 'global' );
var indexUrl = helper.getUniqueFilename( 'index' );

var navOptions = {
	systemName      : conf.systemName || "Documentation",
	navType         : conf.navType || "vertical",
	footer          : conf.footer || "",
	copyright       : conf.copyright || "",
	theme           : conf.theme || "simplex",
	linenums        : conf.linenums,
	collapseSymbols : conf.collapseSymbols || false,
	inverseNav      : conf.inverseNav
};

var navigationMaster = {
	index     : {
		title   : navOptions.systemName,
		link    : indexUrl,
github Sjeiti / TinySort / _oldrem / jsdoc / template / publish.js View on Github external
link    : indexUrl,
		members : []
	},
	namespace : {
		title   : "Namespaces",
		link    : helper.getUniqueFilename( "namespaces.list" ),
		members : []
	},
	module    : {
		title   : "Modules",
		link    : helper.getUniqueFilename( "modules.list" ),
		members : []
	},
	class     : {
		title   : "Classes",
		link    : helper.getUniqueFilename( 'classes.list' ),
		members : []
	},

	mixin    : {
		title   : "Mixins",
		link    : helper.getUniqueFilename( "mixins.list" ),
		members : []
	},
	event    : {
		title   : "Events",
		link    : helper.getUniqueFilename( "events.list" ),
		members : []
	},
	tutorial : {
		title   : "Tutorials",
		link    : helper.getUniqueFilename( "tutorials.list" ),
github miguelmota / inview / node_modules / jsdoc-oblivion / template / publish.js View on Github external
sourceRootPath        : conf.sourceRootPath,
  outputSourcePath      : conf.outputSourcePath,
  dateFormat            : conf.dateFormat,
  analytics             : conf.analytics || null,
  highlightTutorialCode : conf.highlightTutorialCode
};

var navigationMaster = {
  index     : {
    title   : navOptions.systemName,
    link    : indexUrl,
    members : []
  },
  namespace : {
    title   : "Namespaces",
    link    : helper.getUniqueFilename( "namespaces.list" ),
    members : []
  },
  module    : {
    title   : "Modules",
    link    : helper.getUniqueFilename( "modules.list" ),
    members : []
  },
  class     : {
    title   : "Classes",
    link    : helper.getUniqueFilename( 'classes.list' ),
    members : []
  },

  mixin    : {
    title   : "Mixins",
    link    : helper.getUniqueFilename( "mixins.list" ),
github Vincit / objection.js / jsdocTemplate / publish.js View on Github external
members : []
	},
	class     : {
		title   : "Classes",
		link    : helper.getUniqueFilename( 'classes.list' ),
		members : []
	},

	mixin    : {
		title   : "Mixins",
		link    : helper.getUniqueFilename( "mixins.list" ),
		members : []
	},
	event    : {
		title   : "Events",
		link    : helper.getUniqueFilename( "events.list" ),
		members : []
	},
	tutorial : {
		title   : "Tutorials",
		link    : helper.getUniqueFilename( "tutorials.list" ),
		members : []
	},
	global   : {
		title   : "Global",
		link    : globalUrl,
		members : []

	},
	external : {
		title   : "Externals",
		link    : helper.getUniqueFilename( "externals.list" ),
github xperiments / TSDoc / template / publish.js View on Github external
link    : helper.getUniqueFilename( 'classes.list' ),
		members : []
	},
	mixin    : {
		title   : "Mixins",
		link    : helper.getUniqueFilename( "mixins.list" ),
		members : []
	},
	event    : {
		title   : "Events",
		link    : helper.getUniqueFilename( "events.list" ),
		members : []
	},
	tutorial : {
		title   : "Tutorials",
		link    : helper.getUniqueFilename( "tutorials.list" ),
		members : []
	},
	global    : {
		title   : "Global",
		link    : globalUrl,
		members : []

	},
	external : {
		title   : "Externals",
		link    : helper.getUniqueFilename( "externals.list" ),
		members : []
	}
};

function find( spec ) {