Improved header and argument details

Argument detail structure cleaned up. Only relevant pieces of information are shown now, and in a cleaner layout.
Misc. cleanup in the code.
This commit is contained in:
Mark DePristo 2011-07-24 16:36:25 -04:00
parent c6af4efcdc
commit 793e7d3d1d
4 changed files with 24 additions and 17 deletions

View File

@ -186,6 +186,10 @@ public class DiffObjectsWalker extends RodWalker<Integer, Integer> {
@Argument(fullName="testEnum", doc="X", required=false)
TestEnum testEnum = TestEnum.ONE;
@Deprecated
@Argument(fullName="testDepreciates", doc="Y", required=false)
int dontUseMe = 1;
public enum TestEnum { ONE, TWO };
final DiffEngine diffEngine = new DiffEngine();

View File

@ -75,7 +75,6 @@ public class GenericDocumentationHandler extends DocumentedGATKFeatureHandler {
addArgumentBindings(root);
addRelatedBindings(root);
//System.out.printf("Root is %s%n", root);
toProcess.setHandlerContent((String)root.get("summary"), root);
}
@ -110,7 +109,7 @@ public class GenericDocumentationHandler extends DocumentedGATKFeatureHandler {
for ( ArgumentSource argumentSource : parsingEngine.extractArgumentSources(HelpUtils.getClassForDoc(classdoc)) ) {
ArgumentDefinition argDef = argumentSource.createArgumentDefinitions().get(0);
FieldDoc fieldDoc = getFieldDoc(classdoc, argumentSource.field.getName());
GATKDoc doc = docForArgument(fieldDoc, argDef); // todo -- why can you have multiple ones?
GATKDoc doc = docForArgument(fieldDoc, argumentSource, argDef); // todo -- why can you have multiple ones?
String kind = "optional";
if ( argumentSource.isRequired() ) kind = "required";
else if ( argumentSource.isHidden() ) kind = "hidden";
@ -216,7 +215,7 @@ public class GenericDocumentationHandler extends DocumentedGATKFeatureHandler {
return null;
}
protected GATKDoc docForArgument(FieldDoc fieldDoc, ArgumentDefinition def) {
protected GATKDoc docForArgument(FieldDoc fieldDoc, ArgumentSource source, ArgumentDefinition def) {
final String name = def.fullName != null ? "--" + def.fullName : "-" + def.shortName;
GATKDoc doc = new GATKDoc(GATKDoc.DocType.WALKER_ARG, name);
@ -228,17 +227,23 @@ public class GenericDocumentationHandler extends DocumentedGATKFeatureHandler {
if ( def.doc != null ) doc.setSummary(def.doc);
List<String> attributes = new ArrayList<String>();
attributes.add(def.ioType.annotationClass.getSimpleName());
// this one below is just too much.
//attributes.add(def.ioType.annotationClass.getSimpleName());
if ( def.required ) attributes.add("required");
if ( def.isFlag ) attributes.add("flag");
// flag is just boolean, not interesting
//if ( def.isFlag ) attributes.add("flag");
if ( def.isHidden ) attributes.add("hidden");
doc.addTag("attributes", Utils.join(",", attributes));
if ( source.isDeprecated() ) attributes.add("depreciated");
if ( attributes.size() > 0 )
doc.addTag("attributes", Utils.join(", ", attributes));
// todo -- need depreciated value
if ( def.validOptions != null ) {
//source.field.getType().isEnum();
// todo -- what's the best way to link to these docs? Maybe a separate section on enums?
doc.addTag("options", Utils.join(", ", def.validOptions));
}
doc.addTag("options", def.validOptions == null ? GATKDoc.NA_STRING : Utils.join(",", def.validOptions));
doc.setFulltext(fieldDoc.commentText());
doc.setFulltext(fieldDoc.commentText().equals("") ? GATKDoc.NA_STRING : fieldDoc.commentText());
return doc;
}

View File

@ -18,12 +18,10 @@
</#macro>
<#macro argumentDetails arg>
<h3><a name="${arg.name}">${arg.name} / ${arg.synonyms}</a></h3>
Summary: ${arg.summary}<br>
Attributes: ${arg.attributes}<br>
Type: ${arg.type}<br>
Options: ${arg.options}<br>
Details: ${arg.fulltext}<br>
<h3><a name="${arg.name}">${arg.name} / ${arg.synonyms}</a>
(<#if arg.attributes??>${arg.attributes} </#if>${arg.type})</h3>
${arg.summary}. ${arg.fulltext}<br>
<#if arg.options??>TODO: document enum in line here. Possible values ${arg.options}</#if>
</#macro>
<#macro relatedByType name type>

View File

@ -16,7 +16,7 @@ p, ul, ol, dl, dt, dd, td
p.version, p.see-also
{
font-size: 6pt;
font-size: 8pt;
}
dt