fsteeg.com
| notes
| tags
∞ /notes/generating-documentation-from-a-wiki-with-ant-and-mylyn-wikitext | 2010-03-14 | authoring programming eclipse soc zest
Cross-posted to: https://fsteeg.wordpress.com/2010/03/14/generating-documentation-from-a-wiki-with-ant-and-mylyn-wikitext/
I was planning to update the dot4zest documentation when I saw the recent posts by David Green and Chris Aniszczyk on generating Eclipse help right from the wiki. Outdated and duplicated documentation is one of the topics I keep encountering in basically every project I work on. Given that I was already generating the dot4zest help with WikiText (but from a file, not straight from the wiki) I decided to give it a try. Following the instructions in the crowdsourcing example, I first got the WikiText standalone Jars and set up a small Ant script:<project name="dot4zest" default="doc" basedir=".">
wikitext.tasks.classpath">
<fileset dir="Graphviz_DOT_as_a_DSL_for_Zest">
mylyn.wikitext.*core*.jar"/>
</fileset>
</path>
<taskdef classpathref="wikitext.tasks.classpath" resource=
"org/eclipse/mylyn/internal/wikitext/mediawiki/core/tasks/tasks.properties"/>
<taskdef classpathref="wikitext.tasks.classpath" resource=
"org/eclipse/mylyn/wikitext/core/util/anttask/tasks.properties"/>
<target name="doc">
<!-- Set up the base wiki location to pull content from: -->
<mediawiki-to-eclipse-help wikiBaseUrl="http://wiki.eclipse.org"
validate="true"
failonvalidationerror="true"
prependImagePrefix="images"
formatoutput="true"
defaultAbsoluteLinkTarget="doc_external"
dest="${basedir}"
title="Graphviz DOT as a DSL for Zest"
generateUnifiedToc="false">
<!-- Set up which wiki page to pull from: -->
<path name="Graphviz_DOT_as_a_DSL_for_Zest"
title="Graphviz DOT as a DSL for Zest"
generateToc="true"/>
</mediawiki-to-eclipse-help>
</target>
</project>
Running the Ant file (ant in a console or double-click after dragging it onto the Ant view in Eclipse) pulls the content from the wiki location specified in the script and generates the Eclipse help:
<extension point="org.eclipse.help.toc">
<toc file="Graphviz-DOT-as-a-DSL-for-Zest-toc.xml" primary="true"/>
</extension>
Then I added the generated help resources to the binary build in the build tab of the manifest editor to have them included in the deployed bundle: