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:
parent
c6af4efcdc
commit
793e7d3d1d
|
|
@ -186,6 +186,10 @@ public class DiffObjectsWalker extends RodWalker<Integer, Integer> {
|
||||||
@Argument(fullName="testEnum", doc="X", required=false)
|
@Argument(fullName="testEnum", doc="X", required=false)
|
||||||
TestEnum testEnum = TestEnum.ONE;
|
TestEnum testEnum = TestEnum.ONE;
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
|
@Argument(fullName="testDepreciates", doc="Y", required=false)
|
||||||
|
int dontUseMe = 1;
|
||||||
|
|
||||||
public enum TestEnum { ONE, TWO };
|
public enum TestEnum { ONE, TWO };
|
||||||
|
|
||||||
final DiffEngine diffEngine = new DiffEngine();
|
final DiffEngine diffEngine = new DiffEngine();
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,6 @@ public class GenericDocumentationHandler extends DocumentedGATKFeatureHandler {
|
||||||
addArgumentBindings(root);
|
addArgumentBindings(root);
|
||||||
addRelatedBindings(root);
|
addRelatedBindings(root);
|
||||||
|
|
||||||
//System.out.printf("Root is %s%n", root);
|
|
||||||
toProcess.setHandlerContent((String)root.get("summary"), 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)) ) {
|
for ( ArgumentSource argumentSource : parsingEngine.extractArgumentSources(HelpUtils.getClassForDoc(classdoc)) ) {
|
||||||
ArgumentDefinition argDef = argumentSource.createArgumentDefinitions().get(0);
|
ArgumentDefinition argDef = argumentSource.createArgumentDefinitions().get(0);
|
||||||
FieldDoc fieldDoc = getFieldDoc(classdoc, argumentSource.field.getName());
|
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";
|
String kind = "optional";
|
||||||
if ( argumentSource.isRequired() ) kind = "required";
|
if ( argumentSource.isRequired() ) kind = "required";
|
||||||
else if ( argumentSource.isHidden() ) kind = "hidden";
|
else if ( argumentSource.isHidden() ) kind = "hidden";
|
||||||
|
|
@ -216,7 +215,7 @@ public class GenericDocumentationHandler extends DocumentedGATKFeatureHandler {
|
||||||
return null;
|
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;
|
final String name = def.fullName != null ? "--" + def.fullName : "-" + def.shortName;
|
||||||
GATKDoc doc = new GATKDoc(GATKDoc.DocType.WALKER_ARG, name);
|
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);
|
if ( def.doc != null ) doc.setSummary(def.doc);
|
||||||
|
|
||||||
List<String> attributes = new ArrayList<String>();
|
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.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");
|
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().equals("") ? GATKDoc.NA_STRING : fieldDoc.commentText());
|
||||||
|
|
||||||
doc.setFulltext(fieldDoc.commentText());
|
|
||||||
|
|
||||||
return doc;
|
return doc;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,12 +18,10 @@
|
||||||
</#macro>
|
</#macro>
|
||||||
|
|
||||||
<#macro argumentDetails arg>
|
<#macro argumentDetails arg>
|
||||||
<h3><a name="${arg.name}">${arg.name} / ${arg.synonyms}</a></h3>
|
<h3><a name="${arg.name}">${arg.name} / ${arg.synonyms}</a>
|
||||||
Summary: ${arg.summary}<br>
|
(<#if arg.attributes??>${arg.attributes} </#if>${arg.type})</h3>
|
||||||
Attributes: ${arg.attributes}<br>
|
${arg.summary}. ${arg.fulltext}<br>
|
||||||
Type: ${arg.type}<br>
|
<#if arg.options??>TODO: document enum in line here. Possible values ${arg.options}</#if>
|
||||||
Options: ${arg.options}<br>
|
|
||||||
Details: ${arg.fulltext}<br>
|
|
||||||
</#macro>
|
</#macro>
|
||||||
|
|
||||||
<#macro relatedByType name type>
|
<#macro relatedByType name type>
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ p, ul, ol, dl, dt, dd, td
|
||||||
|
|
||||||
p.version, p.see-also
|
p.version, p.see-also
|
||||||
{
|
{
|
||||||
font-size: 6pt;
|
font-size: 8pt;
|
||||||
}
|
}
|
||||||
|
|
||||||
dt
|
dt
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue