diff --git a/templates/twinity/allfiles.tmpl b/templates/twinity/allfiles.tmpl
index 7568a0b..168f758 100644
--- a/templates/twinity/allfiles.tmpl
+++ b/templates/twinity/allfiles.tmpl
@@ -2,55 +2,44 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-
Class Index
-
-
-
-
{+(new Link().toSymbol(thisClass.alias))+}
- {+resolveLinks(summarize(thisClass.classDesc))+}
-
-
-
-
-
-
+
Class Index
+ {.repeated section classes}
+
+
{link}
+ {description}
+
+
+ {.end}
+
+ {footer}
+
\ No newline at end of file
diff --git a/templates/twinity/publish.js b/templates/twinity/publish.js
index d766a79..cbc28e8 100644
--- a/templates/twinity/publish.js
+++ b/templates/twinity/publish.js
@@ -26,13 +26,6 @@ exports.publish = function publish(symbolSet, options) {
var destination = options.destination;
- // is source output is suppressed, just display the links to the source file
- if (options.includeSource && Link !== undefined && Link.prototype._makeSrcLink) {
- Link.prototype._makeSrcLink = function(srcFilePath) {
- return "<" + srcFilePath + ">";
- }
- }
-
// create the folders and subfolders to hold the output
var symbols = Link.symbolsDir = destination.join("symbols");
var dirs = Link.srcDir = symbols.join("src");
@@ -52,12 +45,24 @@ exports.publish = function publish(symbolSet, options) {
// get an array version of the symbolset, useful for filtering
var symbols = symbolSet.toArray();
-
+ var sources = destination.join("symbols", "src");
// create the hilited source code files
var files = options.files;
if (options.includeSource) {
for (var i = 0, l = files.length; i < l; i++) {
- UTILS.makeSrcFile(files[i], destination.join("symbols", "src"), null, options.encoding);
+ var content, src;
+ var path = files[i];
+ var name = path.toString()
+ .replace(/\.\.?[\\\/]/g, "")
+ .replace(/[\\\/]/g, "_")
+ .replace(/\:/g, "_");
+ plugins.notify("onPublishSrc", (src = {
+ path: path,
+ name: name,
+ charset: encoding,
+ highlighted: null
+ }));
+ if (content = src.highlighted) sources.join(name + extension).write(content);
}
}
@@ -105,55 +110,79 @@ exports.publish = function publish(symbolSet, options) {
Link.currentSymbol = symbol;
var name = options.uniqueNames ? Link.filemap[symbol.alias] : symbol.alias;
- var json = DIG.Class(symbol);
- print("\n\n" + JSON.stringify(json) + "\n\n");
destination.join("symbols", name + extension).write(classTemplate.expand({
- "encoding": encoding,
- "header": header,
- "footer": footer,
- "style": style,
- "index": index,
- "symbol": json
+ encoding: encoding,
+ header: header,
+ footer: footer,
+ style: style,
+ index: index,
+ symbol: DIG.Class(symbol)
}));
}
-
-throw "So far"
-
// regenerate the index with different relative links, used in the index pages
Link.base = "";
// TODO: don't access this damn Link
- global.conf.classesIndex = classesTemplate.process(classes);
-
+ index = classesTemplate.expand({ // kept in memory
+ classesLink: classesLink,
+ filesLink: filesLink,
+ items: classes.map(function(item) {
+ var alias = item.alias, link = Link().toClass(alias);
+ return (alias == GLOBAL) ? "