Skip to content

Commit

Permalink
added space before param lists
Browse files Browse the repository at this point in the history
  • Loading branch information
ian committed Feb 7, 2009
1 parent a0df580 commit 42f3b9e
Show file tree
Hide file tree
Showing 9 changed files with 251 additions and 45 deletions.
4 changes: 2 additions & 2 deletions build.hxml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
-neko ../bin/haxeumlgen.n
-xml ../doc/umlgen.xml
-cmd nekotools boot ../bin/haxeumlgen.n
-cmd chxdoc.exe --installTemplate=true --templateDir=u:\haXe\codeblackbox\chxdoc\templates\default --tmpDir=..\doc\tmp -o ..\doc\html ..\doc\umlgen.xml
-cmd neko ../bin/haxeumlgen -c -b "#101020" -f "#707080" -o ../doc/html/uml/ ../doc/umlgen.xml
-cmd chxdoc --templateDir=/usr/local/chxdoc_0_7_3/templates/mine/ --installTemplate=true --title="HaxeUmlGen" --subtitle="UML for HaXe" --tmpDir=../doc/tmp -o ../doc/html ../doc/umlgen.xml
-cmd neko ../bin/haxeumlgen -c -b "#202030" -f "#707080" -o ../doc/html/uml/ ../doc/umlgen.xml
65 changes: 38 additions & 27 deletions chxdoc/README
Original file line number Diff line number Diff line change
@@ -1,28 +1,39 @@
CHXDOC INTEGRATION

HaxeUmlGen is loosely integrated with ChxDoc. ChxDoc is a source
documentation tool written by Russell Weir. ChxDoc is released under
a BSD style license. More info is available at
http://www.codeblackbox.com/.

The following modifications add an entry for "Class Diagram" to each
package.

To use ChxDoc and HaxeUmlGen together you must:
- Copy package.mtt and macros.mtt into the chxdoc templates directory.
- Compile with the -xml flag
- Run chxdoc
- Run haxeumlgen passing the "-c" flag and setting the output
directory to "uml" under the chxdoc output directory

For example, compiled with:
> haxe -xml ../doc/umlgen.xml -neko haxeumlgen.n -main umlgen.HaxeUmlGen

Run chxdoc with:
> chxdoc -o ../doc/html ../doc/umlgen.xml

Run haxeumlgen with:
> haxeumlgen -c -b "#101020" -f "#707080" -o ../doc/html/uml/ ../doc/umlgen.xml

Note that "-b" and "-c" are just to set the diagram colors to match
CHXDOC INTEGRATION

HaxeUmlGen can be loosely integrated with ChxDoc. ChxDoc is a source
documentation tool written by Russell Weir. ChxDoc is released under
a BSD style license. More info is available at
http://www.codeblackbox.com/.

The following modifications add an entry for "Class Diagram" to each
package.

To use ChxDoc and HaxeUmlGen together:

- Create a new templates directory for chxdoc, make it a copy of
[chxdoc]/templates/default. For example,

cp -R /usr/local/chxdoc/templates/default /usr/local/chxdoc/templates/mine


- Copy the template files in the directory into the new chxdoc
templates directory, overwriting the existing files.

cp *.mtt /usr/local/chxdoc/templates/mine

- Compile your source with the -xml flag.

haxe -xml ../doc/umlgen.xml -neko haxeumlgen.n -main umlgen.HaxeUmlGen

- Run chxdoc.

chxdoc -o ../doc/html ../doc/umlgen.xml

- Run haxeumlgen passing the "-c" flag and setting the output
directory to "uml" under the chxdoc output directory

haxeumlgen -c -b "#202030" -f "#707080" -o ../doc/html/uml/ ../doc/umlgen.xml


Note that "-b" and "-c" are just to set the diagram colors to match
the stylesheet I use.
190 changes: 190 additions & 0 deletions chxdoc/class.mtt
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/tr/html4/loose.dtd">
<html>
<head>
::raw build.comment::
<title>::name:: (::config.title::)</title>
<meta name="date" content="::meta.date::" />
::foreach kw meta.keywords::
<meta name="keywords" content="::kw::" />
::end::
<link rel="stylesheet" type="text/css" href="::meta.stylesheet::" />
<script type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="::name:: (::config.title::)";
}
}
</script>
<noscript></noscript>
</head>
<body onload="windowTitle();">
<script language="javascript" type="text/javascript" src="::rootRelative::../chxdoc.js"></script>
<div id="class-frame" class="type-frame">
<!-- ======== START OF class DATA ======== -->
<h1 class="::type::">::nameDots::::raw params::</h1>
<dl>
<dt>type</dt>
<dd>::type::</dd>
::if superClassHtml != null::
<dt>extends</dt>
<dd>::raw superClassHtml::</dd>
::end::
::if isPrivate::
<dt>private</dt>
<dd>yes</dd>
::end::
::if interfacesHtml.length > 0::
<dt>implements</dt>
::foreach i interfacesHtml::
<dd>::raw i::</dd>
::end::
::end::

::if module != null && module.length > 0::
<dt>defined in</dt>
<dd>::module::</dd>
::end::
::if subclasses.length > 0::
<dt>subclasses</dt>
::foreach sc subclasses::
<dd><a href="::raw sc.href::">::raw sc.text::</a></dd>
::end::
::end::
::if platforms.length > 0::
<dt>available in</dt>
::foreach p platforms::
<dd>::p::</dd>
::end::
::end::
</dl>

<div class="doc">$$typeDocs()</div>


::if staticVars.length > 0::
<!-- ============ STATIC VAR DETAIL =========== -->
<div class="members-panel">
<h2><a name="static_var_detail"></a>Static Variables</h2>
<div class="members">
::foreach f staticVars::
<div class="member">
<div class="header">$$varHeader(::f::)</div>
<div class="body">$$varDocs(::f::)</div>
$$showPlatforms(::f.platforms::)
</div>
::end::
</div>
</div>
::end::

::if staticMethods.length > 0::
<!-- ============ STATIC METHOD DETAIL ========== -->
<div class="members-panel">
<h2><a name="function_detail"></a>Static Methods</h2>
<div class="members">
::foreach m staticMethods::
<div class="member">
<div class="header">$$methodHeader(::m::)</div>
<div class="body">$$methodDocs(::m::)</div>
$$showPlatforms(::m.platforms::)
</div>
::end::
</div>
</div>
::end::

::if constructor != null::
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<div class="members-panel">
<h2><a name="constructor_detail"></a>Constructor</h2>
<div class="members">
<div class="member">
<div class="header">
<a name="::raw constructor.name::()"></a>$$showAccess(::constructor::)<span class="name">::raw constructor.name:: </span>(::if constructor.args != null::::raw constructor.args::::end::)
</div>
<div class="body">$$methodDocs(::constructor::)</div>
</div>
</div>
</div>
::end::

::if vars.length > 0::
<!-- ============ FIELD field_detail =========== -->
<div class="members-panel">
<h2><a name="member_var_detail"></a>Instance Variables
::if superClasses.length > 0::
<span id="hideInheritedVar" class="hideInheritedVar">
<a class="showHideLink" href="#member_var_detail" onclick="javascript:showInherited('Var', false);">
Hide Inherited
</a>
</span>
<span id="showInheritedVar" class="showInheritedVar">
<a class="showHideLink" href="#member_var_detail" onclick="javascript:showInherited('Var', true);">
Show Inherited
</a>
</span>
::end::
</h2>
<div class="members">
::foreach f vars::
::if f.isInherited == true::
::set spanClass = "hideInheritedVar"::
::else::
::set spanClass = "showVar"::
::end::
<span class="::spanClass::">
<div class="member">
<div class="header">$$varHeader(::f::)</div>
<div class="body">$$varDocs(::f::)</div>
$$showPlatforms(::f.platforms::)
</div>
</span>
::end::
</div>
</div>
::end::

::if methods.length > 0::
<!-- ============ METHOD DETAIL ========== -->
<div class="members-panel">
<h2><a name="method_detail"></a>Instance Methods
::if superClasses.length > 0::
<span id="hideInheritedMethod" class="hideInheritedMethod">
<a class="showHideLink" href="#method_detail" onclick="javascript:showInherited('Method', false);">
Hide Inherited
</a>
</span>
<span id="showInheritedMethod" class="showInheritedMethod">
<a class="showHideLink" href="#method_detail" onclick="javascript:showInherited('Method', true);">
Show Inherited
</a>
</span>
::end::
</h2>
<div class="members">
::foreach m methods::
::if m.isInherited == true::
::set spanClass = "hideInheritedMethod"::
::else::
::set spanClass = "showMethod"::
::end::
<span class="::spanClass::">
<div class="member">
<div class="header">$$methodHeader(::m::)</div>
<div class="body">$$methodDocs(::m::)</div>
$$showPlatforms(::m.platforms::)
</div>
</span>
::end::
</div>
</div>
::end::
</div>
<!-- ========= END OF class DATA ========= -->
<hr />
<a href="::rootRelative::../overview::config.htmlFileExtension::">Overview</a>
<hr />
::if config.footerText != null::<div id="footer">::raw config.footerText::</div>::end::
</body>
</html>
8 changes: 4 additions & 4 deletions chxdoc/macros.mtt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<macro name="methodHeader(m)">
<h3>
<a name="::raw m.name::()"></a>$$showAccess(::m::)$$showDynamic(::m::)<span class="name">::raw m.name::</span>::m.params::(::if m.args != null::::raw m.args::::end::) : ::raw m.returns::
<a name="::raw m.name::()"></a>$$showAccess(::m::)$$showDynamic(::m::)<span class="name">::raw m.name:: </span>::m.params::(::if m.args != null::::raw m.args::::end::) : ::raw m.returns::
</h3>
::if m.isOverride::
<div class="overrides">overrides</div>
Expand All @@ -22,11 +22,11 @@
<macro name="methodDocs(m)">
<!-- Comment block -->
::if m.docs != null && m.docs.comments != null::
<table><tr><td width="700">
<table><tr><td>
<div class="comment">::raw m.docs.comments::</div></td>

::if m.platforms != null::
<td width="500">
<td>
<dl>
::if m.docs != null::
<!-- deprecated -->
Expand Down Expand Up @@ -108,7 +108,7 @@

<macro name="varHeader(f)">
<h3>
<a name="::f.name::"></a>$$showAccess(::f::)<span class="name">::f.name::</span>::raw f.rights:: : ::raw f.returns::
<a name="::f.name::"></a>$$showAccess(::f::)<span class="name">::f.name:: </span>::raw f.rights:: : ::raw f.returns::
</h3>
::if f.isInherited::
<div class="inherited">inherited from <a href="::raw f.inheritance.link.href::#::f.name::">::raw f.inheritance.link.text::</a></div>
Expand Down
6 changes: 5 additions & 1 deletion chxdoc/stylesheet.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ table, caption, tbody, tfoot, thead, tr, th, td {
body {
line-height: 1;
color: #707080;
background: #101020;
background: #202030;
}
ol, ul {
list-style: none;
Expand All @@ -37,6 +37,10 @@ table {
caption, th, td {
text-align: left;
font-weight: normal;
padding: 4px;
}
.comment {
width: 600px;
}
blockquote:before, blockquote:after,
q:before, q:after {
Expand Down
1 change: 1 addition & 0 deletions umlgen/HaxeUmlGen.hx
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ class HaxeUmlGen
buf.add(' fontname = "Sans";\n');
buf.add(' fontsize = "8";\n');
buf.add(' bgcolor = "' + bgColor + '";\n');
buf.add(' fontcolor = "' + fgColor + '";\n');
buf.add(' node [ fontname="Sans", fontsize=8, shape="record", color="' + fgColor + '", fontcolor="' + fgColor + '" ]\n');
buf.add(' edge [ fontname="Sans", fontsize=8, minlen=3, color="' + fgColor + '", fontcolor="' + fgColor + '" ]\n');
for( dd in boxes )
Expand Down
2 changes: 1 addition & 1 deletion umlgen/model/Reference.hx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class Reference
if (!isFunc) return "";

var strBuf = new StringBuf();
strBuf.add("(");
strBuf.add(" (");
for( pp in params )
if( pp != params.last() )
strBuf.add(pp.getParamStr() + ", ");
Expand Down
8 changes: 4 additions & 4 deletions umlgen/model/TestClass.hx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class TestClass extends haxe.unit.TestCase
{
var testClass = new ClassModel("the.pkg.AClass", false);
testClass.addField(new Reference("aMethod", "Void", true, false, false));
var check = '\t "the.pkg.AClass" [ label = "{AClass||- aMethod() : Void\\l}" ]\n';
var check = '\t "the.pkg.AClass" [ label = "{AClass||- aMethod () : Void\\l}" ]\n';
assertEquals(check, testClass.getDotStr());
}

Expand All @@ -61,7 +61,7 @@ class TestClass extends haxe.unit.TestCase
var method = new Reference("aMethod", "Void", true, false, false);
method.addParam(new Reference("aParam", "Int"));
testClass.addField(method);
var check = '\t "the.pkg.AClass" [ label = "{AClass||- aMethod(aParam : Int) : Void\\l}" ]\n';
var check = '\t "the.pkg.AClass" [ label = "{AClass||- aMethod (aParam : Int) : Void\\l}" ]\n';
assertEquals(check, testClass.getDotStr());
}

Expand All @@ -70,7 +70,7 @@ class TestClass extends haxe.unit.TestCase
var testClass = new ClassModel("the.pkg.AClass", false);
testClass.addField(new Reference("aMethod1", "Void", true, false, false));
testClass.addField(new Reference("aMethod2", "String", true, true, false));
var check = '\t "the.pkg.AClass" [ label = "{AClass||- aMethod1() : Void\\l+ aMethod2() : String\\l}" ]\n';
var check = '\t "the.pkg.AClass" [ label = "{AClass||- aMethod1 () : Void\\l+ aMethod2 () : String\\l}" ]\n';
assertEquals(check, testClass.getDotStr());
}

Expand All @@ -79,7 +79,7 @@ class TestClass extends haxe.unit.TestCase
var testClass = new ClassModel("the.pkg.AClass", false);
testClass.addField(new Reference("aField", "Int", false, false, false));
testClass.addField(new Reference("aMethod", "String", true, true, false));
var check = '\t "the.pkg.AClass" [ label = "{AClass|- aField : Int\\l|+ aMethod() : String\\l}" ]\n';
var check = '\t "the.pkg.AClass" [ label = "{AClass|- aField : Int\\l|+ aMethod () : String\\l}" ]\n';
assertEquals(check, testClass.getDotStr());
}

Expand Down
Loading

0 comments on commit 42f3b9e

Please sign in to comment.