[caffeine-hx] r748 committed - Support for %HAXELIB% and %HAXELIBVER% path expansion in templatesDir ...

1 view
Skip to first unread message

caffe...@googlecode.com

unread,
Aug 7, 2012, 12:23:07 PM8/7/12
to caffein...@googlegroups.com
Revision: 748
Author: damon...@gmail.com
Date: Tue Aug 7 09:22:52 2012
Log: Support for %HAXELIB% and %HAXELIBVER% path expansion in
templatesDir and template


http://code.google.com/p/caffeine-hx/source/detail?r=748

Modified:
/trunk/projects/chxdoc/src/CHANGES
/trunk/projects/chxdoc/src/README
/trunk/projects/chxdoc/src/chxdoc/ChxDocMain.hx
/trunk/projects/chxdoc/src/chxdoc/Setup.hx

=======================================
--- /trunk/projects/chxdoc/src/CHANGES Mon Aug 6 09:41:36 2012
+++ /trunk/projects/chxdoc/src/CHANGES Tue Aug 7 09:22:52 2012
@@ -25,6 +25,7 @@
the regular tags. Basically this makes @author("Russell Weir") function
blah() {} the same
as the "/** @author Russell Weir */" style.
- --ignoreRoot removed. Use the --deny=/ syntax.
+ - Added %HAXELIB% and %HAXELIBVER% to template and templatesDir paths

1.1.4
- Haxe 2.10 compatibility
=======================================
--- /trunk/projects/chxdoc/src/README Mon Aug 6 09:40:09 2012
+++ /trunk/projects/chxdoc/src/README Tue Aug 7 09:22:52 2012
@@ -203,7 +203,10 @@
Template name relative to --templatesDir (default is 'default')

--templatesDir=path
- Set the base directory for templates
+ Set the base directory for templates. Two special variables are allow in
the path.
+ %HAXELIB% is replaced with the base path of the haxelib
repository. %HAXELIBVER% is
+ replaced with the chxdoc version directory (ie "1,2,0"). A complete path
to chxdoc
+ may look like "%HAXELIB%/chxdoc/%HAXELIBVER%/"

--title=string
Set the package title
=======================================
--- /trunk/projects/chxdoc/src/chxdoc/ChxDocMain.hx Mon Aug 6 09:40:09 2012
+++ /trunk/projects/chxdoc/src/chxdoc/ChxDocMain.hx Tue Aug 7 09:22:52 2012
@@ -47,7 +47,7 @@
versionMajor : 1,
versionMinor : 2,
versionRevision : 0,
- buildNumber : 730,
+ buildNumber : 748,
verbose : false,
rootTypesPackage : null,
allPackages : new Array(),
@@ -719,6 +719,16 @@
config.todoFile = "todo" + config.htmlFileExtension;


+ var hlp = Utils.getHaxelib();
+ if(hlp != null) {
+ hlp = hlp.substr(0, hlp.length-1);
+ config.templatesDir =
StringTools.replace(config.templatesDir, "%HAXELIB%", hlp);
+ config.template = StringTools.replace(config.template, "%HAXELIB%",
hlp);
+ }
+ var hlv =
config.versionMajor+","+config.versionMinor+","+config.versionRevision;
+ config.templatesDir =
StringTools.replace(config.templatesDir, "%HAXELIBVER%", hlv);
+ config.template = StringTools.replace(config.template, "%HAXELIBVER%",
hlv);
+
if( config.showPrivateClasses ||
config.showPrivateTypedefs ||
config.showPrivateEnums ||
@@ -977,7 +987,7 @@
println("\n Sample usage:");
println("\tchxdoc -f flash9.xml,flash,flash9 --file=php.xml,php");
println("\t\tWill transform all references to flash.* to flash9.*");
- println("\tchxdoc -o Doc --includeOnly=mypackage.*,Int --developer=true
--generateTodoFile=true --showTodoTags=true -f neko.xml,neko");
+ println("\tchxdoc -o Doc --policy=deny --allow=mypackage.*,Int
--developer=true --generateTodoFile=true --showTodoTags=true -f
neko.xml,neko");
println("\t\tGenerates developer docs for mypackage.* and the Int class
only, generating the TODO file as well as showing @todo\n\t\ttags in user
docs. The output is built in the 'Doc' directory.");
println("");
#if neko
=======================================
--- /trunk/projects/chxdoc/src/chxdoc/Setup.hx Mon Aug 6 09:40:09 2012
+++ /trunk/projects/chxdoc/src/chxdoc/Setup.hx Tue Aug 7 09:22:52 2012
@@ -291,11 +291,11 @@
// if possible.
var tpl : String = null;
try {
- tpl = Utils.getHaxelib() + "chxdoc/" +
c.versionMajor+","+c.versionMinor+","+c.versionRevision;
- tpl += "/templates/";
+ var hlv = c.versionMajor+","+c.versionMinor+","+c.versionRevision;
+ tpl = Utils.getHaxelib() + "chxdoc/" + hlv + "/templates/";
if(FileSystem.isDirectory(tpl)) {
if(FileSystem.isDirectory(tpl + "default")) {
- setVal("templatesDir", tpl);
+ setVal("templatesDir", "%HAXELIB%/chxdoc/%HAXELIBVER%/templates");
setVal("template", "default");
}
}
@@ -323,41 +323,6 @@
//setVal("xmlBasePath",""); // in <files>
setVal("webPassword","");
}
-
- /*
- static function syncFromMain() {
- var c = ChxDocMain.config;
- setval("title", c.title, true);
- setval("subtitle", c.subtitle, true);
- setval("headerText", c.headerText, true);
- setval("footerText", c.footerText, true);
- setval("headerTextFile", c.headerTextFile, true);
- setval("footerTextFile", c.footerTextFile, true);
- setval("dateShort", c.dateShort, true);
- setval("dateLong", c.dateLong, true);
- setval("showAuthorTags", c.showAuthorTags, true);
- setval("showPrivateClasses", c.showPrivateClasses, true);
- setval("showPrivateTypedefs", c.showPrivateTypedefs, true);
- setval("showPrivateEnums", c.showPrivateEnums, true);
- setval("showPrivateMethods", c.showPrivateMethods, true);
- setval("showPrivateVars", c.showPrivateVars, true);
- setval("showTodoTags", c.showTodoTags, true);
- setval("developer", c.developer, true);
- setval("output", c.output, true);
- setval("packageDirectory", c.packageDirectory, true);
- setval("typeDirectory", c.typeDirectory, true);
- setval("template", c.template, true);
- setval("macros", c.macros, true);
- setval("htmlFileExtension", c.htmlFileExtension, true);
- setval("stylesheet", c.stylesheet, true);
- setval("installImagesDir", c.installImagesDir, true);
- setval("installCssFile", c.installCssFile, true);
- setval("generateTodo", c.generateTodo, true);
- setval("verbose", c.verbose, true);
- setval("tmpDir", c.tmpDir, true);
- setval("webPassword", c.webPassword, true);
- }
- */

static function escape(val:Dynamic) {
var s = Std.string(val);
Reply all
Reply to author
Forward
0 new messages