mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-08 05:42:07 -05:00
jsdoc template: move src files into separate folder and make a groupTitle plugin.
This commit is contained in:
parent
c07fee0e6b
commit
a32930287a
9 changed files with 23 additions and 22 deletions
14
build/jsdoc-toolkit/app/plugins/grouptitle.js
Normal file
14
build/jsdoc-toolkit/app/plugins/grouptitle.js
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
JSDOC.PluginManager.registerPlugin(
|
||||||
|
"JSDOC.grouptitle",
|
||||||
|
{
|
||||||
|
beanSymbols: {},
|
||||||
|
onSymbol: function(symbol) {
|
||||||
|
var matches = symbol.desc.match(/\{@grouptitle ([^}]+)\}/),
|
||||||
|
groupTitle;
|
||||||
|
if (matches) {
|
||||||
|
symbol.groupTitle = matches[1];
|
||||||
|
symbol.desc = symbol.desc.replace(/\{@grouptitle ([^}]+)\}/, '');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
|
@ -1,8 +1,8 @@
|
||||||
/** Called automatically by JsDoc Toolkit. */
|
/** Called automatically by JsDoc Toolkit. */
|
||||||
load(JSDOC.opt.t + 'Symbol.js');
|
load(JSDOC.opt.t + 'src/Symbol.js');
|
||||||
load(JSDOC.opt.t + 'Utils.js');
|
load(JSDOC.opt.t + 'src/Utils.js');
|
||||||
load(JSDOC.opt.t + 'Operator.js');
|
load(JSDOC.opt.t + 'src/Operator.js');
|
||||||
load(JSDOC.opt.t + 'Render.js');
|
load(JSDOC.opt.t + 'src/Render.js');
|
||||||
|
|
||||||
function publish(symbolSet) {
|
function publish(symbolSet) {
|
||||||
var renderMode = JSDOC.opt.D.renderMode;
|
var renderMode = JSDOC.opt.D.renderMode;
|
||||||
|
|
|
@ -24,16 +24,6 @@ var Render = new function() {
|
||||||
templates[i] = new JSDOC.JsPlate(templatesDir + templates[i]);
|
templates[i] = new JSDOC.JsPlate(templatesDir + templates[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
var processGroupTitle = function(symbol) {
|
|
||||||
var matches = symbol.desc.match(/\{@grouptitle ([^}]+)\}/),
|
|
||||||
groupTitle;
|
|
||||||
if (matches) {
|
|
||||||
groupTitle = matches[1];
|
|
||||||
symbol.desc = symbol.desc.replace(/\{@grouptitle ([^}]+)\}/, '');
|
|
||||||
}
|
|
||||||
return groupTitle;
|
|
||||||
};
|
|
||||||
|
|
||||||
var processInlineTags = function(str, param) {
|
var processInlineTags = function(str, param) {
|
||||||
if (!param)
|
if (!param)
|
||||||
param = {};
|
param = {};
|
||||||
|
@ -183,7 +173,6 @@ var Render = new function() {
|
||||||
constructor: function(symbol) {
|
constructor: function(symbol) {
|
||||||
var param = {
|
var param = {
|
||||||
symbol: symbol,
|
symbol: symbol,
|
||||||
groupTitle: processGroupTitle(symbol),
|
|
||||||
id: symbol.getId(),
|
id: symbol.getId(),
|
||||||
name: symbol.alias.replace(/(#|\^).+$/, ''),
|
name: symbol.alias.replace(/(#|\^).+$/, ''),
|
||||||
description: processInlineTags(symbol.desc),
|
description: processInlineTags(symbol.desc),
|
||||||
|
@ -209,7 +198,6 @@ var Render = new function() {
|
||||||
name = symbol.memberOf + '.' + name;
|
name = symbol.memberOf + '.' + name;
|
||||||
var param = {
|
var param = {
|
||||||
name: name,
|
name: name,
|
||||||
groupTitle: processGroupTitle(symbol),
|
|
||||||
id: symbol.getId(),
|
id: symbol.getId(),
|
||||||
signature: makeSignature(symbol.params),
|
signature: makeSignature(symbol.params),
|
||||||
description: processInlineTags(symbol.desc),
|
description: processInlineTags(symbol.desc),
|
||||||
|
@ -227,7 +215,6 @@ var Render = new function() {
|
||||||
name = symbol.memberOf + '.' + name;
|
name = symbol.memberOf + '.' + name;
|
||||||
var param = {
|
var param = {
|
||||||
name: name,
|
name: name,
|
||||||
groupTitle: processGroupTitle(symbol),
|
|
||||||
id: symbol.getId(),
|
id: symbol.getId(),
|
||||||
description: processInlineTags(symbol.desc),
|
description: processInlineTags(symbol.desc),
|
||||||
symbol: symbol
|
symbol: symbol
|
|
@ -1,4 +1,4 @@
|
||||||
<if test="defined(data.groupTitle)"><h3>{+data.symbol.groupTitle+}</h3></if>
|
<if test="defined(data.symbol.groupTitle)"><h3>{+data.symbol.groupTitle+}</h3></if>
|
||||||
<div id="{+ data.id +}" class="member">
|
<div id="{+ data.id +}" class="member">
|
||||||
<div id="{+ data.id +}-link" class="member-link">
|
<div id="{+ data.id +}-link" class="member-link">
|
||||||
<a name="{+ data.id +}" href="#" onClick="return toggleMember('{+ data.id +}', false);"><tt><b>{+ data.name +}</b>{+ data.signature +}</tt></a>
|
<a name="{+ data.id +}" href="#" onClick="return toggleMember('{+ data.id +}', false);"><tt><b>{+ data.name +}</b>{+ data.signature +}</tt></a>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<if test="defined(data.groupTitle)">
|
<if test="defined(data.symbol.groupTitle)">
|
||||||
<h3>{+data.groupTitle+}</h3>
|
<h3>{+data.symbol.groupTitle+}</h3>
|
||||||
</if>
|
</if>
|
||||||
<div id="{+ data.id +}" class="member">
|
<div id="{+ data.id +}" class="member">
|
||||||
<div id="{+ data.id +}-link" class="member-link">
|
<div id="{+ data.id +}-link" class="member-link">
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<if test="defined(data.groupTitle)">
|
<if test="defined(data.symbol.groupTitle)">
|
||||||
<h3>{+ data.groupTitle +}</h3>
|
<h3>{+ data.symbol.groupTitle +}</h3>
|
||||||
</if>
|
</if>
|
||||||
<div id="{+ data.id +}" class="member">
|
<div id="{+ data.id +}" class="member">
|
||||||
<div id="{+ data.id +}-link" class="member-link">
|
<div id="{+ data.id +}-link" class="member-link">
|
||||||
|
|
Loading…
Reference in a new issue