Browse Source

User documentation: reverting back to Textile :-(

Rainer Klute 9 years ago
parent
commit
e012f05f4f

+ 1 - 0
plugins/org.yakindu.sct.doc.user/.gitignore

@@ -1,3 +1,4 @@
+.ant-targets-build.xml
 docbook-xsl/
 docbook-xsl.distribution/
 docbook-xml.distribution/

+ 120 - 7
plugins/org.yakindu.sct.doc.user/build.xml

@@ -38,11 +38,22 @@
 
     <!-- Aether Ant Tasks configuration -->
     <property name="aether.jar.version" value="1.0.0.v20140518" />
-    <property name="aether.jar.checksum" value="95dadd03392a75564904da45108cf048abe6e5bb" />
+    <property name="aether.jar.checksum"
+              value="9008c0c96390eacc0f7fdde542dacbd921f942dcd5c139465e21f8b583942edb995304025bb436cfeeea0b89698ef9dfccf8a027da68cd079669adea8cca381f" />
     <property name="aether.jar.src"
               value="http://search.maven.org/remotecontent?filepath=org/eclipse/aether/aether-ant-tasks/${aether.jar.version}/aether-ant-tasks-${aether.jar.version}-uber.jar" />
     <property name="aether.jar.file" value="${lib.dir}/aether-ant-tasks-uber.jar" />
 
+    <!-- Wikitext download configuration -->
+    <property name="wikitext.zip.version" value="1.0.0.v20140518" />
+    <property name="wikitext.zip.checksum"
+              value="f0f2fb383227cd926b2cdee2049b199639c39ffddc2ff5828d9eda995d8c4d864a5093567957b6e4f7febc968210073d34c8ceea26618737e467ecde0e0294a8" />
+    <property name="wikitext.zip.src"
+              value="http://www.eclipse.org/downloads/download.php?file=/mylyn/snapshots/nightly/docs/wikitext-standalone-latest.zip" />
+    <property name="wikitext.zip.file" value="${lib.dir}/wikitext.zip" />
+    <property name="wikitext.basename" value="wikitext-standalone" />
+    <property name="wikitext.version" value="2.8.0-SNAPSHOT" />
+
 
 
     <!-- The DocBook XML distribution ZIP file will be unpacked to this directory: -->
@@ -88,7 +99,7 @@
          "clean" target. If the JAR is present, a typedef will make Aether Ant Tasks' elements available in the Ant
          build file. -->
     <target name="init.aether"
-            description="Initialized Aether Ant Tasks JAR by downloading the JAR and defining a type.">
+            description="Initializes Aether Ant Tasks JAR by downloading the JAR and defining a type.">
         <condition property="target.exists">
             <available file="${aether.jar.file}" />
         </condition>
@@ -99,7 +110,7 @@
                 <condition>
                     <not>
                         <checksum file="${aether.jar.file}"
-                                  algorithm="SHA"
+                                  algorithm="SHA-512"
                                   property="${aether.jar.checksum}"
                                   verifyproperty="checksum.matches" />
                     </not>
@@ -112,6 +123,39 @@
                  classpathref="aether-ant-tasks.classpath" />
     </target>
 
+    <!-- Download and unpack the wikitext standalone distribution. Unfortunately it is currently available as a nightly build only. -->
+    <target name="wikitext.download" description="Download and unpack the wikitext standalone distribution.">
+        <condition property="wikitext.zip.file.exists">
+            <available file="${wikitext.zip.file}" />
+        </condition>
+        <sequential unless:set="wikitext.zip.file.exists">
+            <mkdir dir="${lib.dir}" />
+            <get src="${wikitext.zip.src}" dest="${wikitext.zip.file}" skipexisting="true" usetimestamp="true" />
+            <fail message="Checksum mismatch for ${wikitext.zip.file}. Please delete it and rerun ant to redownload.">
+                <condition>
+                    <not>
+                        <checksum file="${wikitext.zip.file}"
+                                  algorithm="SHA-512"
+                                  property="${wikitext.zip.checksum}"
+                                  verifyproperty="checksum.matches" />
+                    </not>
+                </condition>
+            </fail>
+            <unzip dest="${lib.dir}" src="${wikitext.zip.file}" />
+        </sequential>
+    </target>
+
+    <!-- Resolves the necessary dependencies: -->
+    <target name="init.wikitext"
+            description="Resolves the necessary wikitext dependencies."
+            depends="wikitext.download">
+        <property name="wikitext.dir" location="${lib.dir}/${wikitext.basename}-${wikitext.version}" />
+        <path id="wikitext.classpath">
+            <fileset dir="${wikitext.dir}">
+                <include name="*.jar" />
+            </fileset>
+        </path>
+    </target>
 
     <!-- Resolves the necessary dependencies: -->
     <target name="init.dependencies" description="Resolves the necessary dependencies." depends="init.aether">
@@ -244,11 +288,11 @@
     <!-- Generates the documentation in all supported formats. -->
     <target name="generate.all"
             description="Generates the documentation in all supported formats."
-            depends="generate.html, generate.eclipsehelp, generate.pdf" />
+            depends="generate.eclipsehelp" />
 
 
     <!-- Generates the documentation as HTML. -->
-    <target name="generate.html"
+    <target name="generate.html.from.docbook"
             description="Generates the documentation as HTML."
             depends="validate, init.docbook-xsl">
         <docbook.conversion src.dir="${res.dir.name}"
@@ -260,7 +304,7 @@
 
 
     <!-- Generates the documentation as Eclipse help. This is essentially chunked HTML with a TOC file. -->
-    <target name="generate.eclipsehelp"
+    <target name="generate.eclipsehelp.from.docbook"
             description="Generates the documentation as Eclipse help."
             depends="validate, init.docbook-xsl">
         <docbook.conversion src.dir="${res.dir.name}"
@@ -271,8 +315,22 @@
     </target>
 
 
+    <!-- Generates the documentation as Eclipse help. This is essentially chunked HTML with a TOC file. -->
+    <target name="generate.eclipsehelp"
+            description="Generates the documentation as Eclipse help from the textile (wikitext) sources."
+            depends="init.wikitext">
+        <wikitext.conversion src.dir="${src.dir.name}"
+                             src.file.name="${src.basename}.textile"
+                             dst.dir="${help.dir.name}"
+                             dst.file.name="---"
+                             style="---" />
+    </target>
+
+
     <!-- Generates the documentation as PDF. -->
-    <target name="generate.pdf" description="Generates the documentation as PDF." depends="validate, init.docbook-xsl">
+    <target name="generate.pdf.from.docbook"
+            description="Generates the documentation as PDF."
+            depends="validate, init.docbook-xsl">
         <docbook.conversion src.dir="${res.dir.name}"
                             src.file.name="${res.basename}.xml"
                             dst.dir="${pdf.dir.name}"
@@ -286,6 +344,61 @@
     </target>
 
 
+
+    <!-- Converts a Textile document into Eclipsehelp format. Produces an HTML document and a corresponding toc.xml -->
+    <macrodef name="wikitext.conversion"
+              description="Converts a textile document into a target format. Produces an HTML document and a corresponding toc.xml">
+        <attribute name="src.dir" />
+        <attribute name="src.file.name" />
+        <attribute name="dst.dir" />
+        <attribute name="dst.file.name" />
+        <attribute name="style" />
+
+        <sequential>
+            <basename property="src.file.basename" file="@{src.file.name}" suffix=".textile" />
+            <taskdef classpathref="wikitext.classpath"
+                     resource="org/eclipse/mylyn/wikitext/core/ant/tasks.properties" />
+            <wikitext-to-eclipse-help markupLanguage="Textile"
+                                      multipleOutputFiles="false"
+                                      navigationImages="true"
+                                      formatoutput="true"
+                                      validate="true"
+                                      failOnValidationError="true"
+                                      failOnValidationWarning="false"
+                                      title="YAKINDU Statechart Tools – User Documentation"
+                                      helpPrefix="@{dst.dir}">
+                <fileset dir="@{src.dir}">
+                    <include name="@{src.file.name}" />
+                </fileset>
+                <stylesheet url="css/style.css" />
+            </wikitext-to-eclipse-help>
+
+            <!-- Files have been generated in the source directory, which is bad practice. Move them to the destination
+                 directory: -->
+            <move todir="@{dst.dir}">
+                <fileset dir="${src.dir}">
+                    <include name="${src.file.basename}.html" />
+                    <include name="${src.file.basename}-toc.xml" />
+                </fileset>
+            </move>
+
+            <!-- Copy the CSS files to the destination directory: -->
+            <copy todir="@{dst.dir}/${css.dir.name}">
+                <fileset dir="${css.dir}">
+                    <include name="*" />
+                </fileset>
+            </copy>
+
+            <!-- Copy the image files to the destination directory: -->
+            <copy todir="@{dst.dir}/${img.dir.name}">
+                <fileset dir="${img.dir}">
+                    <include name="*" />
+                </fileset>
+            </copy>
+
+        </sequential>
+    </macrodef>
+
     <!-- Converts a DocBook document into a target format. -->
     <macrodef name="docbook.conversion" description="Converts a DocBook document into a target format.">
         <attribute name="src.dir" />

+ 4 - 0
plugins/org.yakindu.sct.doc.user/css/custom.css

@@ -234,6 +234,10 @@ pre.synopsis code.varname {
     font-style: italic;
 }
 
+pre {
+    line-height: 100%;
+}
+
 
 
 div.example {

File diff suppressed because it is too large
+ 3349 - 0
plugins/org.yakindu.sct.doc.user/src/documentation.textile


+ 5 - 8
plugins/org.yakindu.sct.doc.user/src/documentation.xml

@@ -1259,13 +1259,11 @@ yakindu-sct/SCT
       <para>The dialog asks you for the project, the directory, and the name of the model file to be created. Eclipse project and
        directory should be correctly preset already. In our case the corresponding text field contains
        <emphasis role="strong">LightSwitch/model</emphasis> which means the directory named
-       <emphasis
-       role="strong">model</emphasis> in the <emphasis role="strong">LightSwitch</emphasis> project.
+       <emphasis role="strong">model</emphasis> in the <emphasis role="strong">LightSwitch</emphasis> project.
        You can change that if you wish, but most likely you won't.</para>
 
       <para>The default file name in the <emphasis>File Name</emphasis> field is
-       <emphasis
-       role="strong">default.sct</emphasis>, however. You should change that to something more
+       <emphasis role="strong">default.sct</emphasis>, however. You should change that to something more
        meaningful. In our case we type <emphasis role="strong">LightSwitch.sct</emphasis> into the <emphasis>File
        name</emphasis> field, see the screenshot above.</para>
 
@@ -3059,8 +3057,7 @@ event voidEvent : void
       the event name, e. g. <literal>raiseIncoming_call()</literal>. If the event is an interface event, the name of
       the interface must also be appended.</para>
 
-     <remark role="fixme">Add an
-      example!</remark>
+     <remark role="fixme">Add an example!</remark>
     </sect4>
 
     <sect4 xml:id="calling-an-operation">
@@ -4167,7 +4164,7 @@ feature Debug {
     </figure>
 
     <para>You can checkout the C sample project
-     <emphasis><link xl:href="https://github.com/Yakindu/statecharts/tree/master/examples/org.yakindu.sct.examples.c.trafficlight_">org.yakindu.sct.examples.c.trafficlight</link></emphasis>
+     <link xl:href="https://github.com/Yakindu/statecharts/tree/master/examples/org.yakindu.sct.examples.c.trafficlight_">org.yakindu.sct.examples.c.trafficlight</link>
      from the <link xl:href="https://github.com/Yakindu/statecharts"> <application>YAKINDU Statechart
      Tools</application> GitHub repository</link>. The C example contains statechart, SGen model, graphical widgets, and
      some glue code to connect the generated code with the widgets. The graphical widgets are based on Qt.</para>
@@ -4866,7 +4863,7 @@ feature GeneratorOptions {
      <remark role="fixme">This is quite likely a Java feature, at least JUnit is.</remark>
 
      <para>Using the <emphasis>JUnitWrapper</emphasis> feature, it is possible to create JUnit tests that will run the generated
-      gtests<remark role="fixme">What a gtests?</remark>.</para>
+      gtests.<remark role="fixme">What are gtests?</remark></para>
 
      <orderedlist numeration="arabic">
 

+ 1 - 1
plugins/org.yakindu.sct.doc.user/toc.xml

@@ -3,6 +3,6 @@
 
 <toc label="YAKINDU Statechart Tools Documentation">
 
-	<link toc="help/toc.xml"/>
+	<link toc="help/documentation-toc.xml"/>
 
 </toc>