diff --git a/public/java/src/org/broadinstitute/sting/utils/help/GATKDoclet.java b/public/java/src/org/broadinstitute/sting/utils/help/GATKDoclet.java index aa5514dae..3b581e77b 100644 --- a/public/java/src/org/broadinstitute/sting/utils/help/GATKDoclet.java +++ b/public/java/src/org/broadinstitute/sting/utils/help/GATKDoclet.java @@ -30,8 +30,10 @@ import freemarker.template.Configuration; import freemarker.template.DefaultObjectWrapper; import freemarker.template.Template; import freemarker.template.TemplateException; +import org.apache.commons.io.FileUtils; import org.apache.log4j.Logger; import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; +import sun.misc.IOUtils; import java.io.*; import java.util.*; @@ -40,6 +42,8 @@ import java.util.*; * */ public class GATKDoclet extends ResourceBundleExtractorDoclet { + final protected static File SETTINGS_DIR = new File("settings/helpTemplates"); + final protected static File DESTINATION_DIR = new File("testdoc"); final protected static Logger logger = Logger.getLogger(GATKDoclet.class); public static class DocWorkUnit implements Comparable { @@ -128,12 +132,16 @@ public class GATKDoclet extends ResourceBundleExtractorDoclet { this.rootDoc = rootDoc; try { + // basic setup + DESTINATION_DIR.mkdirs(); + FileUtils.copyFile(new File(SETTINGS_DIR + "/style.css"), new File(DESTINATION_DIR + "/style.css")); + /* ------------------------------------------------------------------- */ /* You should do this ONLY ONCE in the whole application life-cycle: */ Configuration cfg = new Configuration(); // Specify the data source where the template files come from. - cfg.setDirectoryForTemplateLoading(new File("settings/helpTemplates/")); + cfg.setDirectoryForTemplateLoading(SETTINGS_DIR); // Specify how templates will see the data-model. This is an advanced topic... cfg.setObjectWrapper(new DefaultObjectWrapper()); @@ -200,7 +208,7 @@ public class GATKDoclet extends ResourceBundleExtractorDoclet { Template temp = cfg.getTemplate("generic.index.template.html"); /* Merge data-model with template */ - Writer out = new OutputStreamWriter(new FileOutputStream(new File("testdoc/index.html"))); + Writer out = new OutputStreamWriter(new FileOutputStream(new File(DESTINATION_DIR + "/index.html"))); try { temp.process(groupIndexData(indexData), out); out.flush(); @@ -259,7 +267,7 @@ public class GATKDoclet extends ResourceBundleExtractorDoclet { Template temp = cfg.getTemplate(unit.handler.getTemplateName(unit.classDoc)); // Merge data-model with template - File outputPath = new File("testdoc/" + unit.filename); + File outputPath = new File(DESTINATION_DIR + "/" + unit.filename); try { Writer out = new OutputStreamWriter(new FileOutputStream(outputPath)); temp.process(unit.forTemplate, out); diff --git a/settings/helpTemplates/generic.index.template.html b/settings/helpTemplates/generic.index.template.html index b494dc582..a6ea3da86 100644 --- a/settings/helpTemplates/generic.index.template.html +++ b/settings/helpTemplates/generic.index.template.html @@ -1,5 +1,7 @@ +<#include "common.html"/> + <#macro emitGroup group> - +

${group.name}

${group.summary} @@ -20,9 +22,7 @@ - - GATK documentation index - +<@makeHeader title="GATK documentation index"/>

GATK documentation index

<#list groups as group> diff --git a/settings/helpTemplates/generic.template.html b/settings/helpTemplates/generic.template.html index 6540ba0e3..d029cf8a5 100644 --- a/settings/helpTemplates/generic.template.html +++ b/settings/helpTemplates/generic.template.html @@ -1,3 +1,5 @@ +<#include "common.html"/> + <#macro argumentlist name myargs> <#if myargs?size != 0> @@ -39,12 +41,9 @@ - - + - - ${name} documentation - +<@makeHeader title="${name} documentation"/>

${name}

Brief summary

@@ -60,7 +59,7 @@ <#if arguments.all?size != 0>

Feature specific arguments

-
${name}
+
@@ -90,10 +89,10 @@ <#-- This class is related to other documented classes via sub/super relationships --> <#if relatedDocs?size != 0> +

Related capabilities

<@relatedByType name="Superclasses" type="superclass"/> <@relatedByType name="Subclasses" type="subclass"/> -
<#-- List all of the -->
Name Synonyms