From 282c33c450ed1453865f5d4041f4395466911396 Mon Sep 17 00:00:00 2001 From: Mike Hamburg Date: Wed, 26 May 2010 16:09:38 -0700 Subject: [PATCH] initial import didn't include codeview template; adding it --- .../templates/codeview/allclasses.tmpl | 11 + .../templates/codeview/allfiles.tmpl | 62 ++ .../templates/codeview/class.tmpl | 690 ++++++++++++++++++ .../templates/codeview/css/default.css | 418 +++++++++++ .../templates/codeview/index.tmpl | 40 + .../templates/codeview/publish.js | 206 ++++++ .../templates/codeview/static/header.html | 2 + .../templates/codeview/static/index.html | 19 + .../templates/codeview/symbol.tmpl | 35 + 9 files changed, 1483 insertions(+) create mode 100644 jsdoc_toolkit-2.3.3-beta/templates/codeview/allclasses.tmpl create mode 100644 jsdoc_toolkit-2.3.3-beta/templates/codeview/allfiles.tmpl create mode 100644 jsdoc_toolkit-2.3.3-beta/templates/codeview/class.tmpl create mode 100644 jsdoc_toolkit-2.3.3-beta/templates/codeview/css/default.css create mode 100644 jsdoc_toolkit-2.3.3-beta/templates/codeview/index.tmpl create mode 100644 jsdoc_toolkit-2.3.3-beta/templates/codeview/publish.js create mode 100644 jsdoc_toolkit-2.3.3-beta/templates/codeview/static/header.html create mode 100644 jsdoc_toolkit-2.3.3-beta/templates/codeview/static/index.html create mode 100644 jsdoc_toolkit-2.3.3-beta/templates/codeview/symbol.tmpl diff --git a/jsdoc_toolkit-2.3.3-beta/templates/codeview/allclasses.tmpl b/jsdoc_toolkit-2.3.3-beta/templates/codeview/allclasses.tmpl new file mode 100644 index 0000000..a44577b --- /dev/null +++ b/jsdoc_toolkit-2.3.3-beta/templates/codeview/allclasses.tmpl @@ -0,0 +1,11 @@ +
{+new Link().toFile("index.html").withText("Class Index")+} | {+new Link().toFile("files.html").withText("File Index")+}
+ +

Classes

+ + diff --git a/jsdoc_toolkit-2.3.3-beta/templates/codeview/allfiles.tmpl b/jsdoc_toolkit-2.3.3-beta/templates/codeview/allfiles.tmpl new file mode 100644 index 0000000..2b0fd5e --- /dev/null +++ b/jsdoc_toolkit-2.3.3-beta/templates/codeview/allfiles.tmpl @@ -0,0 +1,62 @@ + + + + + {! Link.base = ""; /* all generated links will be relative to this */ !} + JsDoc Reference - File Index + + + + + + {+include("static/header.html")+} + +
+ + +
+ ©{+JSDOC.opt.D.copyright+}
+ Generated by JsDoc Toolkit {+JSDOC.VERSION+} on {+new Date()+}
+ HTML template: Codeview +
+
+ +
+
+

File Index

+ +
    + +
  • +

    {+new Link().toSrc(item.alias).withText(item.name)+}

    + + {+resolveLinks(item.desc)+} + +
    + +
    Author:
    +
    {+item.author+}
    +
    + + +
    Version:
    +
    {+item.version+}
    +
    + + {! var locations = item.comment.getTag('location').map(function($){return $.toString().replace(/(^\$ ?| ?\$$)/g, '').replace(/^HeadURL: https:/g, 'http:');}) !} + +
    Location:
    + +
    {+location+}
    +
    +
    +
    +
  • +
    +
+
+
+ + \ No newline at end of file diff --git a/jsdoc_toolkit-2.3.3-beta/templates/codeview/class.tmpl b/jsdoc_toolkit-2.3.3-beta/templates/codeview/class.tmpl new file mode 100644 index 0000000..96525e1 --- /dev/null +++ b/jsdoc_toolkit-2.3.3-beta/templates/codeview/class.tmpl @@ -0,0 +1,690 @@ + + + + + + {! Link.base = "../"; /* all generated links will be relative to this */ !} + JsDoc Reference - {+data.alias+} + + + + + {+include("static/header.html")+} + +
+ + +
+ ©{+JSDOC.opt.D.copyright+}
+ Generated by JsDoc Toolkit {+JSDOC.VERSION+} on {+new Date()+}
+ HTML template: Codeview +
+
+ +
+
+

+ {! + var classType = ""; + + if (data.isBuiltin()) { + classType += "Built-In "; + } + + if (data.isNamespace) { + if (data.is('FUNCTION')) { + classType += "Function "; + } + classType += "Namespace "; + } else { + classType += "Class "; + } + !} + {+classType+}{+data.alias+} +

+ +

+ + Version {+ data.version +}.
+
+ +
Extends + {+ + data.augments + .sort() + .map( + function($) { return new Link().toSymbol($); } + ) + .join(", ") + +}.
+
+ + {+resolveLinks(data.classDesc)+} + + {# isn't defined in any file #} +
Defined in: {+new Link().toSrc(data.srcFile)+}. +
+

+ + +
+ + + + + + + + + + + + + + +
{+classType+}Summary
Constructor AttributesConstructor Name and Description
{! + if (data.isPrivate) output += "<private> "; + if (data.isInner) output += "<inner> "; + !}  +
+ {+ new Link().toSymbol(data.alias).inner('constructor')+}{+ makeSignature(data.params) +} +
+
{+resolveLinks(summarize(data.desc))+}
+
+
+
+ + + {! var ownProperties = data.properties.filter(function($){return $.memberOf == data.alias && !$.isNamespace}).sort(makeSortby("name")); !} + +
+ + + + + + + + + + + + + + + + + + +
Field Summary
Field AttributesField Name and Description
{! + if (member.isPrivate) output += "<private> "; + if (member.isInner) output += "<inner> "; + if (member.isStatic) output += "<static> "; + if (member.isConstant) output += "<constant> "; + !}  +
+ {+member.memberOf+}.{+new Link().toSymbol(member.alias).withText(member.name)+} +
+
{+resolveLinks(summarize(member.desc))+}
+
+
+
+ + +
+ {! + var borrowedMembers = data.properties.filter(function($) {return $.memberOf != data.alias}); + + var contributers = []; + borrowedMembers.map(function($) {if (contributers.indexOf($.memberOf) < 0) contributers.push($.memberOf)}); + for (var i = 0, l = contributers.length; i < l; i++) { + output += + "
Fields borrowed from class "+new Link().toSymbol(contributers[i])+":
" + + + "
" + + borrowedMembers + .filter( + function($) { return $.memberOf == contributers[i] } + ) + .sort(makeSortby("name")) + .map( + function($) { return new Link().toSymbol($.alias).withText($.name) } + ) + .join(", ") + + + "
"; + } + !} +
+
+
+ + + + {! var ownMethods = data.methods.filter(function($){return $.memberOf == data.alias && !$.isNamespace}).sort(makeSortby("name")); !} + +
+ + + + + + + + + + + + + + + + + + +
Method Summary
Method AttributesMethod Name and Description
{! + if (member.isPrivate) output += "<private> "; + if (member.isInner) output += "<inner> "; + if (member.isStatic) output += "<static> "; + !}  +
{+member.memberOf+}.{+new Link().toSymbol(member.alias).withText(member.name.replace(/\^\d+$/, ''))+}{+makeSignature(member.params)+} +
+
{+resolveLinks(summarize(member.desc))+}
+
+
+
+ + +
+ {! + var borrowedMembers = data.methods.filter(function($) {return $.memberOf != data.alias}); + var contributers = []; + borrowedMembers.map(function($) {if (contributers.indexOf($.memberOf) < 0) contributers.push($.memberOf)}); + for (var i = 0, l = contributers.length; i < l; i++) { + output += + "
Methods borrowed from class "+new Link().toSymbol(contributers[i])+":
" + + + "
" + + borrowedMembers + .filter( + function($) { return $.memberOf == contributers[i] } + ) + .sort(makeSortby("name")) + .map( + function($) { return new Link().toSymbol($.alias).withText($.name) } + ) + .join(", ") + + + "
"; + } + !} +
+
+
+ + + + {! var ownEvents = data.events.filter(function($){return $.memberOf == data.alias && !$.isNamespace}).sort(makeSortby("name")); !} + +
+ + + + + + + + + + + + + + + + + + +
Event Summary
Event AttributesEvent Name and Description
{! + if (member.isPrivate) output += "<private> "; + if (member.isInner) output += "<inner> "; + if (member.isStatic) output += "<static> "; + !}  +
{+member.memberOf+}.{+new Link().toSymbol(member.alias).withText(member.name)+}{+makeSignature(member.params)+} +
+
{+resolveLinks(summarize(member.desc))+}
+
+
+
+ + +
+ {! + var borrowedMembers = data.events.filter(function($) {return $.memberOf != data.alias}); + var contributers = []; + borrowedMembers.map(function($) {if (contributers.indexOf($.memberOf) < 0) contributers.push($.memberOf)}); + for (var i = 0, l = contributers.length; i < l; i++) { + output += + "
Events borrowed from class "+new Link().toSymbol(contributers[i])+":
" + + + "
" + + borrowedMembers + .filter( + function($) { return $.memberOf == contributers[i] } + ) + .sort(makeSortby("name")) + .map( + function($) { return new Link().toSymbol($.alias).withText($.name) } + ) + .join(", ") + + + "
"; + } + + !} +
+
+
+ + + +
+
+ + +
+ {+classType+}Detail +
+ +
{! + if (data.isPrivate) output += "<private> "; + if (data.isInner) output += "<inner> "; + !} + {+ data.alias +}{+ makeSignature(data.params) +} +
+ +
+ {+resolveLinks(data.desc)+} +
Author: {+data.author+}.
+
+ + + +
{+example+}
+
+
+ + +
+
Parameters:
+ +
+ {+((item.type)?""+("{"+(new Link().toSymbol(item.type)+"} ")) : "")+} {+item.name+} + Optional, Default: {+item.defaultValue+} +
+
{+resolveLinks(item.desc)+}
+
+
+
+ + +
+ +
+ {+resolveLinks(data.deprecated)+} +
+
+ + +
Since:
+
{+ data.since +}
+
+ + +
Throws:
+ +
+ {+((item.type)?"{"+(new Link().toSymbol(item.type))+"} " : "")+} {+item.name+} +
+
{+resolveLinks(item.desc)+}
+
+
+ + +
Returns:
+ +
{+((item.type)?"{"+(new Link().toSymbol(item.type))+"} " : "")+}{+resolveLinks(item.desc)+}
+
+
+ + +
Requires:
+ +
{+ resolveLinks(item) +}
+
+
+ + +
See:
+ +
{+ new Link().toSymbol(item) +}
+
+
+
+
+
+
+
+ + + +
+
+ +
+ Field Detail +
+ + + + +
+ + {! + if (member.isPrivate) output += "<private> "; + if (member.isInner) output += "<inner> "; + if (member.isStatic) output += "<static> "; + if (member.isConstant) output += "<constant> "; + !} + + + {{+new Link().toSymbol(member.type)+}} + + {+member.memberOf+}.{+member.name+} +
+ +
+ {+resolveLinks(member.desc)+} + +
+ Defined in: {+new Link().toSrc(member.srcFile)+}. +
+ +
Author: {+member.author+}.
+
+ + + +
{+example+}
+
+
+ + +
+ + +
Deprecated:
+
+ {+ resolveLinks(member.deprecated) +} +
+
+ +
Since:
+
{+ member.since +}
+
+ +
See:
+ +
{+ new Link().toSymbol(item) +}
+
+
+ +
Default Value:
+
+ {+resolveLinks(member.defaultValue)+} +
+
+
+
+ +
+
+
+
+
+ + + +
+
+
+ Method Detail +
+ + + + +
+ + {! + if (member.isPrivate) output += "<private> "; + if (member.isInner) output += "<inner> "; + if (member.isStatic) output += "<static> "; + !} + + + {{+new Link().toSymbol(member.type)+}} + + {+member.memberOf+}.{+member.name.replace(/\^\d+$/, '')+}{+makeSignature(member.params)+} +
+ +
+ {+resolveLinks(member.desc)+} + + +
+ Defined in: {+new Link().toSrc(member.srcFile)+}. +
+ +
Author: {+member.author+}.
+
+ + + +
{+example+}
+
+
+ + +
+
Parameters:
+ +
+ {+((item.type)?"{"+(new Link().toSymbol(item.type))+"} " : "")+}{+item.name+} + Optional, Default: {+item.defaultValue+} +
+
{+resolveLinks(item.desc)+}
+
+
+
+ + +
+ + +
Deprecated:
+
+ {+ resolveLinks(member.deprecated) +} +
+
+ + +
Since:
+
{+ member.since +}
+
+ + +
Throws:
+ +
+ {+((item.type)?"{"+(new Link().toSymbol(item.type))+"} " : "")+} {+item.name+} +
+
{+resolveLinks(item.desc)+}
+
+
+ + +
Returns:
+ +
{+((item.type)?"{"+(new Link().toSymbol(item.type))+"} " : "")+}{+resolveLinks(item.desc)+}
+
+
+ + +
Requires:
+ +
{+ resolveLinks(item) +}
+
+
+ + +
See:
+ +
{+ new Link().toSymbol(item) +}
+
+
+ +
+
+ +
+
+
+
+
+ + + +
+
+
+ Event Detail +
+ + + + +
+ + {! + if (member.isPrivate) output += "<private> "; + if (member.isInner) output += "<inner> "; + if (member.isStatic) output += "<static> "; + !} + + + {{+new Link().toSymbol(member.type)+}} + + {+member.memberOf+}.{+member.name+}{+makeSignature(member.params)+} +
+ +
+ {+resolveLinks(member.desc)+} + + +
+ Defined in: {+new Link().toSrc(member.srcFile)+}. +
+ +
Author: {+member.author+}.
+
+ + + +
{+example+}
+
+
+ + +
+
Parameters:
+ +
+ {+((item.type)?"{"+(new Link().toSymbol(item.type))+"} " : "")+}{+item.name+} + Optional, Default: {+item.defaultValue+} +
+
{+ resolveLinks(item.desc) +}
+
+
+
+ + +
+ +
Deprecated:
+
{+ resolveLinks(member.deprecated) +}
+
+ + +
Since:
+
{+ member.since +}
+
+ + +
Throws:
+ +
+ {+((item.type)?"{"+(new Link().toSymbol(item.type))+"} " : "")+} {+item.name+} +
+
{+ resolveLinks(item.desc) +}
+
+
+ + +
Returns:
+ +
{+((item.type)?"{"+(new Link().toSymbol(item.type))+"} " : "")+}{+resolveLinks(item.desc)+}
+
+
+ + +
Requires:
+ +
{+ resolveLinks(item) +}
+
+
+ + +
See:
+ +
{+ new Link().toSymbol(item) +}
+
+
+
+
+ +
+
+
+
+
+
+
+ + diff --git a/jsdoc_toolkit-2.3.3-beta/templates/codeview/css/default.css b/jsdoc_toolkit-2.3.3-beta/templates/codeview/css/default.css new file mode 100644 index 0000000..b9dde3b --- /dev/null +++ b/jsdoc_toolkit-2.3.3-beta/templates/codeview/css/default.css @@ -0,0 +1,418 @@ +/* + * TABLE OF CONTENTS: + * - Browser reset + * - HTML elements + * - JsDoc styling + */ + + + + + + +/* + * BEGIN BROWSER RESET + */ + +body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,p,pre,form,fieldset,input,textarea,p,blockquote,th,td { + margin:0; + padding:0 +} +html { + height:100%; + overflow:-moz-scrollbars-vertical; + overflow-x:auto +} +table { + border:0; + border-collapse:collapse; + border-spacing:0 +} +fieldset,img { + border:0 +} +address,caption,cite,code,dfn,em,strong,th,var { + font-style:normal; + font-weight:normal +} +em,cite { + font-style:italic +} +strong { + font-weight:bold +} +ol,ul { + list-style:none +} +caption,th { + text-align:left +} +h1,h2,h3,h4,h5,h6 { + font-size:100%; + font-weight:normal; + margin:0; + padding:0 +} +q:before,q:after { + content:'' +} +abbr,acronym { + border:0 +} + +/* + * END BROWSER RESET + */ + + + + + + +/* + * HTML ELEMENTS + */ + +* { + line-height: 1.4em; +} + +html { + font-size: 100%; +} + +body { + font-size: 0.75em !important; + padding: 15px 0; + background: #eee; + background-image: -moz-linear-gradient(left, #dddddd, #f9f9f9); + background-image: -webkit-gradient(linear,left bottom,right bottom,color-stop(0, #dddddd),color-stop(1, #f9f9f9)); + } + +body, +input, +select, +textarea { + color: #000; + font-family: Arial, Geneva, sans-serif; +} + +a:link, +a:hover, +a:active, +a:visited { + color: #19199e; +} +a:hover, +a:focus { + color: #00f; + text-decoration: none; +} + +p { + margin: 0 0 1.5em 0; +} + +/* + * END HTML ELEMENTS + */ + + + +/* + * BEGIN HACK + */ + +div.containerMain:after, +div.safeBox:after { + content:""; + display:block; + height:0; + clear:both; +} + +/* + * END HACK + */ + + + +/* + * BEGIN JSDOC + */ + +div.index *.heading1 { + margin-bottom: 0.5em; + border-bottom: 1px solid #999999; + padding: 0.5em 0 0.1em 0; + font-family: 'Lucida Sans Unicode', 'Lucida Grande', sans-serif; + font-size: 1.3em; + letter-spacing: 1px; +} + +div.index { + float: left; + width: 30%; + min-width: 100px; + max-width: 250px; +} +div.index div.menu { + margin: 0 15px 0 -15px; + -moz-border-radius: 15px; + -webkit-border-radius: 15px; + border-radius: 15px; + padding: 15px 15px 15px 30px; + background-color: #FFFFFF; + background-color: rgba(255, 255, 255, 0.5); + -moz-box-shadow: 0px 0px 10px #c4c4c4; + -webkit-box-shadow: 0px 0px 10px #c4c4c4; + box-shadow: 0px 0px 10px #c4c4c4; +} +*+html div.index div.menu { + background-color: #FFFFFF; +} +* html div.index div.menu { + background-color: #FFFFFF; +} + +div.index div.menu div { + text-align: left; +} + +div.index div.menu a { + text-decoration: none; +} +div.index div.menu a:hover { + text-decoration: underline; +} + +div.index ul.classList a { + font-family: Consolas, "Courier New", Courier, monospace; +} + +div.index div.fineprint { + padding: 15px 30px 15px 15px; + color: #777; + font-size: 0.9em; +} +div.index div.fineprint a { + color: #777; +} + + + +div.content { + float: left; + width: 70%; + min-width: 300px; + max-width: 600px; +} +div.innerContent { + padding: 0 0 0 2.5em; +} + +div.content ul, +div.content ol { + margin-bottom: 3em; +} + +div.content *.classTitle { + margin-bottom: 0.5em; + font-family: 'Lucida Sans Unicode', 'Lucida Grande', sans-serif; + font-size: 2.5em; + letter-spacing: 2px; +} + +div.content *.classTitle span { + font-family: Consolas, "Courier New", Courier, monospace; +} + +div.content p.summary { + font-size: 1.2em; +} + +div.content ul *.classname a, +div.content ul *.filename a { + font-family: Consolas, "Courier New", Courier, monospace; + text-decoration: none; + font-weight: bold; +} +div.content ul *.classname a:hover, +div.content ul *.filename a:hover { + text-decoration: underline; +} + +div.content div.props { + position: relative; + left: -10px; + margin-bottom: 2.5em; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + padding: 10px 15px 15px 15px; + overflow: hidden; + background: #fff; + background: -moz-linear-gradient(top, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.2)); /* FF3.6 */ + background: -webkit-gradient(linear,left top,left bottom,color-stop(0, rgba(255, 255, 255, 0.7)),color-stop(1, rgba(255, 255, 255, 0.2))); + -moz-box-shadow: 0px 0px 10px #ccc; + -webkit-box-shadow: 0px 0px 5px #bbb; + box-shadow: 0px 0px 5px #bbb; +} + +div.content div.props div.sectionTitle { + padding-bottom: 10px; + font-family: 'Lucida Sans Unicode', 'Lucida Grande', sans-serif; + font-size: 1.4em; + letter-spacing: 1px; +} + +div.content div.hr { + margin: 0 10px 0 0; + height: 4em; +} + + + +table.summaryTable { + position: relative; + left: -10px; + width: 100%; + border-collapse: collapse; + box-sizing: content-box; + -moz-box-sizing: content-box; + -webkit-box-sizing: content-box; + -ms-box-sizing: content-box; + -o-box-sizing: content-box; + -icab-box-sizing: content-box; + -khtml-box-sizing: content-box; +} + +table.summaryTable caption { + padding: 0 10px 10px 10px; + font-family: 'Lucida Sans Unicode', 'Lucida Grande', sans-serif; + font-size: 1.4em; + letter-spacing: 1px; +} + +table.summaryTable td, +table.summaryTable th { + padding: 0px 10px 10px 10px; + vertical-align: top; +} +table.summaryTable tr:last-child td { + padding-bottom: 0; +} + +table.summaryTable th { + font-weight: bold; +} + +table.summaryTable td.attributes { + width: 35%; + font-family: Consolas, "Courier New", Courier, monospace; + color: #666; +} + +table.summaryTable td.nameDescription { + width: 65% +} + +table.summaryTable td.nameDescription div.fixedFont { + font-weight: bold; +} + +table.summaryTable div.description { + color: #333; +} + + + +dl.detailList { + margin-top: 0.5em; +} + +dl.detailList.nomargin + dl.detailList.nomargin { + margin-top: 0; +} + +dl.detailList dt { + display: inline; + margin-right: 5px; + font-weight: bold; +} + +dl.detailList dt:before { + display: block; + content: ""; +} + +dl.detailList dd { + display: inline; +} + +dl.detailList.params dt { + display: block; +} +dl.detailList.params dd { + display: block; + padding-left: 2em; + padding-bottom: 0.4em; +} + + + + +ul.fileList li { + margin-bottom: 1.5em; +} + + + +.fixedFont { + font-family: Consolas, "Courier New", Courier, monospace; +} + +.fixedFont.heading { + margin-bottom: 0.5em; + font-size: 1.25em; + line-height: 1.1em +} + +.fixedFont.heading + .description { + font-size: 1.2em; +} + +.fixedFont.heading .light, +.fixedFont.heading .lighter { + font-weight: bold; +} + +pre.code { + margin: 10px 0 10px 0; + padding: 10px; + border: 1px solid #ccc; + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + border-radius: 2px; + overflow: auto; + font-family: Consolas, "Courier New", Courier, monospace; + background: #eee; +} + +.light { + color: #666; +} + +.lighter { + color: #999; +} + +.clear { + clear: both; + width: 100%; + min-height: 0; +} + +/* + * END JSDOC + */ \ No newline at end of file diff --git a/jsdoc_toolkit-2.3.3-beta/templates/codeview/index.tmpl b/jsdoc_toolkit-2.3.3-beta/templates/codeview/index.tmpl new file mode 100644 index 0000000..f83b656 --- /dev/null +++ b/jsdoc_toolkit-2.3.3-beta/templates/codeview/index.tmpl @@ -0,0 +1,40 @@ + + + + + JsDoc Reference - Index + + + + + + {+include("static/header.html")+} + +
+ + +
+ ©{+JSDOC.opt.D.copyright+}
+ Generated by JsDoc Toolkit {+JSDOC.VERSION+} on {+new Date()+}
+ HTML template: Codeview +
+
+ +
+
+

Class Index

+ +
    + +
  • +

    {+(new Link().toSymbol(thisClass.alias))+}

    +

    {+resolveLinks(summarize(thisClass.classDesc))+}

    +
  • +
    +
+
+
+ + \ No newline at end of file diff --git a/jsdoc_toolkit-2.3.3-beta/templates/codeview/publish.js b/jsdoc_toolkit-2.3.3-beta/templates/codeview/publish.js new file mode 100644 index 0000000..59dcb25 --- /dev/null +++ b/jsdoc_toolkit-2.3.3-beta/templates/codeview/publish.js @@ -0,0 +1,206 @@ +/** Called automatically by JsDoc Toolkit. */ +function publish(symbolSet) { + publish.conf = { // trailing slash expected for dirs + ext: ".html", + outDir: JSDOC.opt.d || SYS.pwd+"../out/jsdoc/", + templatesDir: JSDOC.opt.t || SYS.pwd+"../templates/jsdoc/", + cssDir: "css/", + symbolsDir: "symbols/", + srcDir: "symbols/src/" + }; + + // is source output is suppressed, just display the links to the source file + if (JSDOC.opt.s && defined(Link) && Link.prototype._makeSrcLink) { + Link.prototype._makeSrcLink = function(srcFilePath) { + return "<"+srcFilePath+">"; + } + } + + // create the folders and subfolders to hold the output + IO.mkPath((publish.conf.outDir+publish.conf.cssDir)); + IO.mkPath((publish.conf.outDir+"symbols/src").split("/")); + + // used to allow Link to check the details of things being linked to + Link.symbolSet = symbolSet; + + // create the required templates + try { + //var styleTemplate = new JSDOC.JsPlate(publish.conf.templatesDir+publish.conf.cssDir+"default.css"); + var classTemplate = new JSDOC.JsPlate(publish.conf.templatesDir+"class.tmpl"); + var classesTemplate = new JSDOC.JsPlate(publish.conf.templatesDir+"allclasses.tmpl"); + } + catch(e) { + print("Couldn't create the required templates: "+e); + quit(); + } + + // some utility filters + function hasNoParent($) {return ($.memberOf == "")} + function isaFile($) {return ($.is("FILE"))} + function isaClass($) {return ($.is("CONSTRUCTOR") || $.isNamespace)} + + // get an array version of the symbolset, useful for filtering + var symbols = symbolSet.toArray(); + + // create the hilited source code files + var files = JSDOC.opt.srcFiles; + for (var i = 0, l = files.length; i < l; i++) { + var file = files[i]; + var srcDir = publish.conf.outDir + "symbols/src/"; + makeSrcFile(file, srcDir); + } + + // get a list of all the classes in the symbolset + var classes = symbols.filter(isaClass).sort(makeSortby("alias")); + + // create a filemap in which outfiles must be to be named uniquely, ignoring case + if (JSDOC.opt.u) { + var filemapCounts = {}; + Link.filemap = {}; + for (var i = 0, l = classes.length; i < l; i++) { + var lcAlias = classes[i].alias.toLowerCase(); + + if (!filemapCounts[lcAlias]) filemapCounts[lcAlias] = 1; + else filemapCounts[lcAlias]++; + + Link.filemap[classes[i].alias] = + (filemapCounts[lcAlias] > 1)? + lcAlias+"_"+filemapCounts[lcAlias] : lcAlias; + } + } + + // create a class index, displayed in the left-hand column of every class page + Link.base = "../"; + publish.classesIndex = classesTemplate.process(classes); // kept in memory + + // create each of the class pages + for (var i = 0, l = classes.length; i < l; i++) { + var symbol = classes[i]; + + symbol.events = symbol.getEvents(); // 1 order matters + symbol.methods = symbol.getMethods(); // 2 + + var output = ""; + output = classTemplate.process(symbol); + + IO.saveFile(publish.conf.outDir+"symbols/", ((JSDOC.opt.u)? Link.filemap[symbol.alias] : symbol.alias) + publish.conf.ext, output); + } + + // regenerate the index with different relative links, used in the index pages + Link.base = ""; + publish.classesIndex = classesTemplate.process(classes); + + // create the class index page + try { + var classesindexTemplate = new JSDOC.JsPlate(publish.conf.templatesDir+"index.tmpl"); + } + catch(e) { print(e.message); quit(); } + + var classesIndex = classesindexTemplate.process(classes); + IO.saveFile(publish.conf.outDir, "index"+publish.conf.ext, classesIndex); + classesindexTemplate = classesIndex = classes = null; + + // create the file index page + try { + var fileindexTemplate = new JSDOC.JsPlate(publish.conf.templatesDir+"allfiles.tmpl"); + } + catch(e) { print(e.message); quit(); } + + var documentedFiles = symbols.filter(isaFile); // files that have file-level docs + var allFiles = []; // not all files have file-level docs, but we need to list every one + + for (var i = 0; i < files.length; i++) { + allFiles.push(new JSDOC.Symbol(files[i], [], "FILE", new JSDOC.DocComment("/** */"))); + } + + for (var i = 0; i < documentedFiles.length; i++) { + var offset = files.indexOf(documentedFiles[i].alias); + allFiles[offset] = documentedFiles[i]; + } + + allFiles = allFiles.sort(makeSortby("name")); + + // output the file index page + var filesIndex = fileindexTemplate.process(allFiles); + IO.saveFile(publish.conf.outDir, "files"+publish.conf.ext, filesIndex); + fileindexTemplate = filesIndex = files = null; + + // copy files + IO.copyFile(publish.conf.templatesDir+"/"+publish.conf.cssDir+"default.css", publish.conf.outDir+"/"+publish.conf.cssDir); +} + + +/** Just the first sentence (up to a full stop). Should not break on dotted variable names. */ +function summarize(desc) { + if (typeof desc != "undefined") + return desc.match(/([\w\W]+?\.)[^a-z0-9_$]/i)? RegExp.$1 : desc; +} + +/** Make a symbol sorter by some attribute. */ +function makeSortby(attribute) { + return function(a, b) { + if (a[attribute] != undefined && b[attribute] != undefined) { + a = a[attribute].toLowerCase(); + b = b[attribute].toLowerCase(); + if (a < b) return -1; + if (a > b) return 1; + return 0; + } + } +} + +/** Pull in the contents of an external file at the given path. */ +function include(path) { + var path = publish.conf.templatesDir+path; + return IO.readFile(path); +} + +/** Turn a raw source file into a code-hilited page in the docs. */ +function makeSrcFile(path, srcDir, name) { + if (JSDOC.opt.s) return; + + if (!name) { + name = path.replace(/\.\.?[\\\/]/g, "").replace(/[\\\/]/g, "_"); + name = name.replace(/\:/g, "_"); + } + + var src = {path: path, name:name, charset: IO.encoding, hilited: ""}; + + if (defined(JSDOC.PluginManager)) { + JSDOC.PluginManager.run("onPublishSrc", src); + } + + if (src.hilited) { + IO.saveFile(srcDir, name+publish.conf.ext, src.hilited); + } +} + +/** Build output for displaying function parameters. */ +function makeSignature(params) { + if (!params) return "()"; + var signature = "(" + + + params.filter( + function($) { + return $.name.indexOf(".") == -1; // don't show config params in signature + } + ).map( + function($) { + return $.name; + } + ).join(", ") + + + ")"; + return signature; +} + +/** Find symbol {@link ...} strings in text and turn into html links */ +function resolveLinks(str, from) { + str = str.replace(/\{@link ([^} ]+) ?\}/gi, + function(match, symbolName) { + return new Link().toSymbol(symbolName); + } + ); + + return str; +} diff --git a/jsdoc_toolkit-2.3.3-beta/templates/codeview/static/header.html b/jsdoc_toolkit-2.3.3-beta/templates/codeview/static/header.html new file mode 100644 index 0000000..353b735 --- /dev/null +++ b/jsdoc_toolkit-2.3.3-beta/templates/codeview/static/header.html @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/jsdoc_toolkit-2.3.3-beta/templates/codeview/static/index.html b/jsdoc_toolkit-2.3.3-beta/templates/codeview/static/index.html new file mode 100644 index 0000000..661f6f6 --- /dev/null +++ b/jsdoc_toolkit-2.3.3-beta/templates/codeview/static/index.html @@ -0,0 +1,19 @@ + + + + + Generated Javascript Documentation + + + + + + <body> + <p> + This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. + </p> + </body> + + + \ No newline at end of file diff --git a/jsdoc_toolkit-2.3.3-beta/templates/codeview/symbol.tmpl b/jsdoc_toolkit-2.3.3-beta/templates/codeview/symbol.tmpl new file mode 100644 index 0000000..f8f4bd1 --- /dev/null +++ b/jsdoc_toolkit-2.3.3-beta/templates/codeview/symbol.tmpl @@ -0,0 +1,35 @@ + + {+data.name+} + {+data.memberOf+} + {+data.isStatic+} + {+data.isa+} + {+data.desc+} + {+data.classDesc+} + + + + {+method.name+} + {+method.memberOf+} + {+method.isStatic+} + {+method.desc+} + + + {+param.type+} + {+param.name+} + {+param.desc+} + {+param.defaultValue+} + + + + + + + + {+property.name+} + {+property.memberOf+} + {+property.isStatic+} + {+property.desc+} + {+property.type+} + + +