Skip to content

Commit

Permalink
Bugfix release
Browse files Browse the repository at this point in the history
  • Loading branch information
Eike, Stefan committed Feb 22, 2018
2 parents 15019cf + 02b90f6 commit f2f8a9d
Show file tree
Hide file tree
Showing 51 changed files with 2,317 additions and 1,009 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ org.doctales.terminology

**org.doctales.terminology** is a plugin for the [DITA-OT](http://dita-ot.github.io) for creating a DITA-based terminology database.

- Create and change terms easily using specialized DITA topics. The new DITA `<termentry>` topic represents a single term. Terms are linked together to a terminology database using the `<termmap>` map.
- Create and change terms easily using specialized DITA topics (DTD/RNG). The new DITA `<termentry>` topic represents a single term. Terms are linked together to a terminology database using the `<termmap>` map.
- Author terms easily using an &lt;oXygen/&gt; XML framework with author mode stylesheets, that simplify the editing of `<termentry>` and `<termmap>` topics.
- Navigate through the terminology database with a classic or responsive terminology browser ([DEMO](https://doctales.github.io/samples/termbrowser-responsive/index.html)) based on the &lt;oXygen/&gt; webhelp transformation.
- Check DITA or XLIFF files with a Schematron based terminology checker.
Expand All @@ -20,15 +20,20 @@ org.doctales.terminology

**Prerequisites**

- DITA-OT 2.3 or higher
- DITA-OT 2.3.x, DITA-OT 2.4.x, DITA-OT 2.5.x or DITA-OT 3.x
- The termbrowser needs the [OOPS Consultancy XMLTask](http://www.oopsconsultancy.com/software/xmltask/) library on classpath. If this library is missing, you can provide it by installing the DITA-OT utility plugin [org.doctales.xmltask](https://github.com/doctales/org.doctales.xmltask).
- &lt;oXygen/&gt; XML 18 or higher (optional)
- To use the Relax NG topics and maps, you need to install the **dita-relaxng-defaults** plugin.
```shell
dita --install https://github.com/oxygenxml/dita-relaxng-defaults/archive/master.zip
```

**Install the plugin**

1. Install the plugin with the [`dita` command](http://www.dita-ot.org/dev/parameters/dita-command-arguments.html).
```shell
dita -install https://github.com/doctales/org.doctales.terminology/archive/master.zip
```
Install the plugin with the [`dita` command](http://www.dita-ot.org/dev/parameters/dita-command-arguments.html).
```shell
dita --install https://github.com/doctales/org.doctales.terminology/archive/master.zip
```

**Install the &lt;oXygen/&gt; XML Framework**

Expand All @@ -40,6 +45,9 @@ org.doctales.terminology

Please refer to the [documentation](https://doctales.atlassian.net/wiki/x/AoAy).

## Licenses

**org.doctales.terminology** is available under the [Apache Public License (APL) 2](https://www.apache.org/licenses/LICENSE-2.0). The plugin contains SVG flags taken from the [flag-icon-css](https://github.com/lipis/flag-icon-css) project, which is available under the [MIT license](https://opensource.org/licenses/MIT).

## Contribution

Expand Down
55 changes: 37 additions & 18 deletions build_dita2termbrowser_template.xml
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:dita="http://dita-ot.sourceforge.net">

<path id="org.doctales.terminology.path">
<pathelement path="dost.class.path"/>
<pathelement location="${dita.plugin.org.doctales.terminology.dir}/lib/xmltask.jar"/>
<pathelement location="lib/xmltask.jar"/>
<pathelement location="${dita.dir}/plugins/org.doctales.terminology/lib/xmltask.jar"/>
</path>

<taskdef name="xmltask" classname="com.oopsconsultancy.xmltask.ant.XmlTask" classpathref="org.doctales.terminology.path"/>

<target name="is.com.oxygen.webhelp.available">
<target name="-is-oxygen-webhelp-available">
<fail message="The plugin com.oxygen.webhelp is not available">
<condition>
<not>
<isset property="dita.plugin.com.oxygenxml.dita-ot.plugin.webhelp.dir"/>
</not>
<or>
<not>
<isset property="dita.plugin.com.oxygenxml.webhelp.responsive.dir"/>
</not>
<not>
<isset property="dita.plugin.com.oxygenxml.webhelp.classic.dir"/>
</not>
</or>
</condition>
</fail>
</target>
Expand All @@ -26,20 +22,29 @@
in the termbrowser-termstats and semanticnet target
on some Linux OSes when using DITA-OT 2.4.3+
-->
<target name="dita2termbrowser" depends="is.com.oxygen.webhelp.available, init-properties">
<target name="dita2termbrowser-classic" depends="-is-oxygen-webhelp-available, init-properties">
<antcall target="dita2webhelp"/>
<antcall target="termbrowser-termstats"/>
<antcall target="semanticnet"/>
</target>
<target name="dita2termbrowser-responsive" depends="is.com.oxygen.webhelp.available, init-properties">
<target name="dita2termbrowser-responsive" depends="-is-oxygen-webhelp-available, init-properties">
<antcall target="dita2webhelp-responsive"/>
<antcall target="termbrowser-termstats"/>
<antcall target="semanticnet"/>
</target>
<target name="dita2termbrowser-html5" depends="dita2html5, termbrowser-termstats, semanticnet"/>

<target name="-is-xmltask-available">
<pathconvert refid="dost.class.path" property="dost.class.path.property"/>
<condition property="xmltask-available" value="true">
<contains string="${dost.class.path.property}" substring="xmltask"/>
</condition>
<fail unless="xmltask-available">xmltask.jar is not found on classpath</fail>
</target>

<target name="termbrowser-termstats"
description="Generate terminology statistics.">
description="Generate terminology statistics."
depends="-is-xmltask-available">
<condition property="termmap" value="${args.term.containermap}">
<isset property="args.term.containermap"/>
</condition>
Expand Down Expand Up @@ -103,6 +108,17 @@
<!-- Copy the XML file to the output dir. It has to be shipped with the webhelp to be used as an input parameter for the next publication. -->
<copy file="${dita.temp.dir}/termstats_merged.xml" tofile="${output.dir}/termstats.xml"/>

<loadfile srcFile="${dita.temp.dir}${file.separator}terminology_stats.html" property="terminlogy_stats.head">
<filterchain>
<replaceregex pattern="\s\s+" replace=" "/>
<trim/>
<ignoreblank/>
<striplinebreaks/>
<replaceregex pattern="(.*)&lt;!--HEAD BEGINNING--&gt;" replace=""/>
<replaceregex pattern="&lt;!--HEAD END--&gt;(.*)" replace=""/>
</filterchain>
</loadfile>

<loadfile srcFile="${dita.temp.dir}${file.separator}terminology_stats.html" property="terminology_stats.body">
<filterchain>
<replaceregex pattern="\s\s+" replace=" "/>
Expand All @@ -120,6 +136,9 @@
</xmltask>
<basename property="termstats.base" file="${termstats-file}" suffix=".dita"/>

<replaceregexp file="${output.dir}/${termstats.base}.html" match="&lt;head&gt;" replace="&lt;head&gt;${terminlogy_stats.head}" flags="gis" byline="false"/>
<replaceregexp file="${output.dir}/${termstats.base}.html" match="&lt;div class=&quot;div stats&quot;(.+?)&lt;\/div&gt;" replace="${terminology_stats.body}" flags="gis" byline="false"/>

<echo level="info">Replace &lt;div class="div stats"&gt; placeholder element of: ${output.dir}\${termstats.base}.html</echo>
<replaceregexp file="${output.dir}/${termstats.base}.html" match="&lt;div class=&quot;div stats&quot;(.+?)&lt;\/div&gt;" replace="${terminology_stats.body}" flags="gis" byline="false"/>
</target>
Expand Down Expand Up @@ -155,7 +174,7 @@
<move file="${dita.temp.dir}${file.separator}terminology_stats.xml" tofile="${dita.temp.dir}/termstats_merged.xml"/>
</target>

<target name="semanticnet">
<target name="semanticnet" depends="-is-xmltask-available">
<fail unless="args.default.language">'args.default.language' is not set, e.g. to 'en-GB'</fail>
<basename property="basename" file="${args.input}" suffix=".ditamap"/>
<xslt basedir="${dita.temp.dir}"
Expand Down Expand Up @@ -205,7 +224,7 @@
<basename property="semantic-net.base" file="${semantic-net-file}" suffix=".dita"/>

<!-- Replace certain parts of the topic with the semantic net data -->
<replaceregexp file="${output.dir}/${semantic-net.base}.html" match="&lt;\/head&gt;" replace="${semantic-net.head}&lt;\/head&gt;" flags="gis" byline="false"/>
<replaceregexp file="${output.dir}/${semantic-net.base}.html" match="&lt;head&gt;" replace="&lt;head&gt;${semantic-net.head}" flags="gis" byline="false"/>
<replaceregexp file="${output.dir}/${semantic-net.base}.html" match="&lt;div class=&quot;div net&quot;(.+?)&lt;\/div&gt;" replace="${semantic-net.body}" flags="gis" byline="false"/>
<copy file="${dita.temp.dir}${file.separator}${basename}_net.html" todir="${output.dir}"/>
</target>
Expand Down
60 changes: 30 additions & 30 deletions dtd/termentry.mod
Original file line number Diff line number Diff line change
Expand Up @@ -498,65 +498,47 @@ Category: Termentry elements-->

<!-- LONG NAME: Antonyms -->
<!ENTITY % antonyms.content "((%antonym;)+)">
<!ENTITY % antonyms.attributes "%termLinkGroup-atts;
type
CDATA
'antonyms'">
<!ENTITY % antonyms.attributes "%termLinkGroup-atts;">
<!--doc:The <antonyms> element contains references to <antonym> elements.
Category: Termentry elements-->
<!ELEMENT antonyms %antonyms.content;>
<!ATTLIST antonyms %antonyms.attributes;>

<!-- LONG NAME: Hypernyms -->
<!ENTITY % hypernyms.content "((%hypernym;)+)">
<!ENTITY % hypernyms.attributes "%termLinkGroup-atts;
type
CDATA
'hypernyms'">
<!ENTITY % hypernyms.attributes "%termLinkGroup-atts;">
<!--doc:The <hypernyms> element contains references to <hypernym> elements.
Category: Termentry elements-->
<!ELEMENT hypernyms %hypernyms.content;>
<!ATTLIST hypernyms %hypernyms.attributes;>

<!-- LONG NAME: Hyponyms -->
<!ENTITY % hyponyms.content "((%hyponym;)+)">
<!ENTITY % hyponyms.attributes "%termLinkGroup-atts;
type
CDATA
'hyponyms'">
<!ENTITY % hyponyms.attributes "%termLinkGroup-atts;">
<!--doc:The <hyponyms> element contains references to <hyponym> elements.
Category: Termentry elements-->
<!ELEMENT hyponyms %hyponyms.content;>
<!ATTLIST hyponyms %hyponyms.attributes;>

<!-- LONG NAME: Instances Of -->
<!ENTITY % instancesOf.content "((%instanceOf;)+)">
<!ENTITY % instancesOf.attributes "%termLinkGroup-atts;
type
CDATA
'instancesOf'">
<!ENTITY % instancesOf.attributes "%termLinkGroup-atts;">
<!--doc:The <instancesOf> element contains references to <instanceOf> elements.
Category: Termentry elements-->
<!ELEMENT instancesOf %instancesOf.content;>
<!ATTLIST instancesOf %instancesOf.attributes;>

<!-- LONG NAME: Parts Of -->
<!ENTITY % partsOf.content "((%partOf;)+)">
<!ENTITY % partsOf.attributes "%termLinkGroup-atts;
type
CDATA
'partsOf'">
<!ENTITY % partsOf.attributes "%termLinkGroup-atts;">
<!--doc:The <partsOf> element contains references to <partOf> elements.
Category: Termentry elements-->
<!ELEMENT partsOf %partsOf.content;>
<!ATTLIST partsOf %partsOf.attributes;>

<!-- LONG NAME: Related Terms -->
<!ENTITY % relatedTerms.content "((%relatedTerm;)+)">
<!ENTITY % relatedTerms.attributes "%termLinkGroup-atts;
type
CDATA
'relatedTerms'">
<!ENTITY % relatedTerms.attributes "%termLinkGroup-atts;">
<!--doc:The <relatedTerms> element contains references to <relatedTerm> elements.
Category: Termentry elements-->
<!ELEMENT relatedTerms %relatedTerms.content;>
Expand Down Expand Up @@ -741,42 +723,60 @@ Category: Termentry elements-->
<!ATTLIST verb %genericTerm.attributes;>

<!-- LONG NAME: Antonym -->
<!ENTITY % antonym.attributes "%termLink-atts;">
<!ENTITY % antonym.attributes "%termLink-atts;
type
CDATA
'termentry'">
<!--doc:The <antonym> element refers to the antonym of a term.
Category: Termentry elements-->
<!ELEMENT antonym %link.content;>
<!ATTLIST antonym %antonym.attributes;>

<!-- LONG NAME: Hypernym -->
<!ENTITY % hypernym.attributes "%termLink-atts;">
<!ENTITY % hypernym.attributes "%termLink-atts;
type
CDATA
'termentry'">
<!--doc:The <hypernym> element refers to the hypernym of a term.
Category: Termentry elements-->
<!ELEMENT hypernym %link.content;>
<!ATTLIST hypernym %hypernym.attributes;>

<!-- LONG NAME: Hyponym -->
<!ENTITY % hyponym.attributes "%termLink-atts;">
<!ENTITY % hyponym.attributes "%termLink-atts;
type
CDATA
'termentry'">
<!--doc:The <hyponym> element refers to the hyponym of a term.
Category: Termentry elements-->
<!ELEMENT hyponym %link.content;>
<!ATTLIST hyponym %hyponym.attributes;>

<!-- LONG NAME: Instance Of -->
<!ENTITY % instanceOf.attributes "%termLink-atts;">
<!ENTITY % instanceOf.attributes "%termLink-atts;
type
CDATA
'termentry'">
<!--doc:The <instanceOf> element indicates, that the current term is an instance ot the referenced term.
Category: Termentry elements-->
<!ELEMENT instanceOf %link.content;>
<!ATTLIST instanceOf %instanceOf.attributes;>

<!-- LONG NAME: Part Of -->
<!ENTITY % partOf.attributes "%termLink-atts;">
<!ENTITY % partOf.attributes "%termLink-atts;
type
CDATA
'termentry'">
<!--doc:The <partOf> element indicates, that the current term is part ot the referenced term.
Category: Termentry elements-->
<!ELEMENT partOf %link.content;>
<!ATTLIST partOf %partOf.attributes;>

<!-- LONG NAME: Related Term -->
<!ENTITY % relatedTerm.attributes "%termLink-atts;">
<!ENTITY % relatedTerm.attributes "%termLink-atts;
type
CDATA
'termentry'">
<!--doc:The <relatedTerm> element refers to a related term.
Category: Termentry elements-->
<!ELEMENT relatedTerm %link.content;>
Expand Down
Loading

0 comments on commit f2f8a9d

Please sign in to comment.