From abd020556f96ff316711d9cd4c79eca363c2cd7f Mon Sep 17 00:00:00 2001 From: Christian Williams Date: Tue, 5 Oct 2010 12:34:04 -0700 Subject: [PATCH] Modify jsdoc-template to write jekyll-compatible files. --- jsdoc-template/allfiles.tmpl | 102 ++++++++++++++++------------------- jsdoc-template/class.tmpl | 19 +++---- jsdoc-template/index.tmpl | 69 +++++++++++------------- jsdoc-template/publish.js | 8 +-- pages | 2 +- 5 files changed, 90 insertions(+), 110 deletions(-) diff --git a/jsdoc-template/allfiles.tmpl b/jsdoc-template/allfiles.tmpl index 37e9915..ce50f6d 100644 --- a/jsdoc-template/allfiles.tmpl +++ b/jsdoc-template/allfiles.tmpl @@ -1,56 +1,48 @@ - - - - - {! Link.base = ""; /* all generated links will be relative to this */ !} - JsDoc Reference - File Index - +--- +layout: default +title: "API - File Index" +--- + +{! Link.base = ""; /* all generated links will be relative to this */ !} + + +
+ {+publish.classesIndex+} +
- - - - - {+include("static/header.html")+} - -
- {+publish.classesIndex+} -
- -
-

File Index

- - -
-

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

- {+resolveLinks(summarize(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+}
-
-
-
-
-
-
- -
-
- ©{+JSDOC.opt.D.copyright+}
- Documentation generated by JsDoc Toolkit {+JSDOC.VERSION+} on {+new Date()+} -
- - \ No newline at end of file +
+

File Index

+ + +
+

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

+ {+resolveLinks(summarize(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+}
+
+
+
+
+
+
+ +
+ +
+ ©{+JSDOC.opt.D.copyright+}
+ Documentation generated by JsDoc Toolkit {+JSDOC.VERSION+} on {+new Date()+} +
diff --git a/jsdoc-template/class.tmpl b/jsdoc-template/class.tmpl index f8debae..2001862 100644 --- a/jsdoc-template/class.tmpl +++ b/jsdoc-template/class.tmpl @@ -1,15 +1,12 @@ - - - - - - {! Link.base = "../"; /* all generated links will be relative to this */ !} - JsDoc Reference - {+data.alias+} +--- +layout: default +title: "API - {+data.alias+}" +--- - +{! Link.base = "../"; /* all generated links will be relative to this */ !} + diff --git a/jsdoc-template/index.tmpl b/jsdoc-template/index.tmpl index 61b93cf..481b905 100644 --- a/jsdoc-template/index.tmpl +++ b/jsdoc-template/index.tmpl @@ -1,39 +1,30 @@ - - - - - - JsDoc Reference - Index - - - - - - - {+include("static/header.html")+} - -
- {+publish.classesIndex+} -
- -
-

Class Index

- - -
-

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

- {+resolveLinks(summarize(thisClass.classDesc))+} -
-
-
- -
-
- ©{+JSDOC.opt.D.copyright+}
- Documentation generated by JsDoc Toolkit {+JSDOC.VERSION+} on {+new Date()+} -
- - \ No newline at end of file +--- +layout: default +title: "API - Index" +--- + + + +
+ {+publish.classesIndex+} +
+ +
+

Class Index

+ + +
+

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

+ {+resolveLinks(summarize(thisClass.classDesc))+} +
+
+
+ +
+ +
+ ©{+JSDOC.opt.D.copyright+}
+ Documentation generated by JsDoc Toolkit {+JSDOC.VERSION+} on {+new Date()+} +
\ No newline at end of file diff --git a/jsdoc-template/publish.js b/jsdoc-template/publish.js index 7e1cbd7..d3e62c7 100644 --- a/jsdoc-template/publish.js +++ b/jsdoc-template/publish.js @@ -64,7 +64,7 @@ function publish(symbolSet) { var output = ""; output = classTemplate.process(symbol); - IO.saveFile(publish.conf.outDir+"symbols/", symbol.alias+publish.conf.ext, output); + IO.saveFile(publish.conf.outDir+"symbols/", symbol.alias+publish.conf.ext+".md", output); } // regenerate the index with different relative links, used in the index pages @@ -78,7 +78,7 @@ function publish(symbolSet) { catch(e) { print(e.message); quit(); } var classesIndex = classesindexTemplate.process(classes); - IO.saveFile(publish.conf.outDir, "index"+publish.conf.ext, classesIndex); + IO.saveFile(publish.conf.outDir, "index"+publish.conf.ext+".md", classesIndex); classesindexTemplate = classesIndex = classes = null; // create the file index page @@ -103,7 +103,7 @@ function publish(symbolSet) { // output the file index page var filesIndex = fileindexTemplate.process(allFiles); - IO.saveFile(publish.conf.outDir, "files"+publish.conf.ext, filesIndex); + IO.saveFile(publish.conf.outDir, "files"+publish.conf.ext+".md", filesIndex); fileindexTemplate = filesIndex = files = null; } @@ -149,7 +149,7 @@ function makeSrcFile(path, srcDir, name) { } if (src.hilited) { - IO.saveFile(srcDir, name+publish.conf.ext, src.hilited); + IO.saveFile(srcDir, name+publish.conf.ext+".md", src.hilited); } } diff --git a/pages b/pages index 9ef7724..fef4a2d 160000 --- a/pages +++ b/pages @@ -1 +1 @@ -Subproject commit 9ef772465fe1af3d1a75a7bd30558594686f02cc +Subproject commit fef4a2da3c808762d5c54a6dbd4e65951712468d