<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Electropubs Blog</title>
	<atom:link href="http://electropubs.com/wordpress/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://electropubs.com/wordpress</link>
	<description>Documentation Services</description>
	<lastBuildDate>Thu, 06 Oct 2011 14:12:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Sections and Articles</title>
		<link>http://electropubs.com/wordpress/?p=57</link>
		<comments>http://electropubs.com/wordpress/?p=57#comments</comments>
		<pubDate>Mon, 03 Oct 2011 12:38:23 +0000</pubDate>
		<dc:creator>nparker</dc:creator>
				<category><![CDATA[DITA]]></category>
		<category><![CDATA[HTML5]]></category>

		<guid isPermaLink="false">http://electropubs.com/wordpress/?p=57</guid>
		<description><![CDATA[I&#8217;ve been wondering how best to map DITA elements to HTML5&#8242;s new semantic tags. &#60;header&#62; and &#60;footer&#62; These two tags are straightforward. I&#8217;ll wrap them around the contents of any custom HTML specified with the arg.hdr and arg.ftr DITA parameters. &#60;article&#62; The HTML5 specification describes an article as being &#8220;a self-contained composition in a document, [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been wondering how best to map DITA elements to HTML5&#8242;s new semantic tags.</p>
<h2>&lt;header&gt; and &lt;footer&gt;</h2>
<p>These two tags are straightforward. I&#8217;ll wrap them around the contents of any custom HTML specified with the <strong>arg.hdr</strong> and <strong>arg.ftr</strong> DITA parameters.</p>
<h2>&lt;article&gt;</h2>
<p>The HTML5 specification describes an article as being &#8220;a self-contained composition in a document, page, application, or site that is, in principle, independently distributable or reusable&#8221;. That seems to closely match the DITA concept of a topic. So there are two possibilities:</p>
<ol>
<li>Don&#8217;t use <tt>&lt;article&gt;</tt> at all in the generated HTML5, except if topics are being chunked together in a single physical file.</li>
<li>Start the body of each topic with <tt>&lt;article&gt;</tt>, for example:<br />
<code>&lt;body&gt;<br />
&lt;article&gt;<br />
...<br />
&lt;article&gt;<br />
&lt;/body&gt;</code></li>
</ol>
<h2>&lt;section&gt;</h2>
<p>In HTML5, a section is used to logically subdivide a document or article:<br />
<a href="http://electropubs.com/wordpress/wp-content/uploads/2011/09/article_structure.png"><img class="size-full wp-image-62 alignnone" title="article_structure" src="http://electropubs.com/wordpress/wp-content/uploads/2011/09/article_structure.png" alt="" width="166" height="245" /></a></p>
<div>This clearly corresponds to a DITA section, which &#8220;represents an organizational division in a topic&#8221;.</div>
<h2>&lt;nav&gt;</h2>
<p>The HTML5 spec says that nav is &#8220;a section of a page that links to other pages or to parts <em>within</em> the page&#8221;. The purpose of introducing such tags to HTML5 is to indicate to search engines that they don&#8217;t need to index the content in them, so speeding up searches.  Although it doesn&#8217;t quite match because the links are not internal, I think this is a good match for the related links section of a DITA topic.</p>
<h2>&lt;aside&gt;</h2>
<p>This new HTML element represents &#8220;a section of a page that consists of content that is tangentially related to the content around the <strong>aside </strong>element, and which could be considered separate from that content&#8221;. It&#8217;s plainly important that content in the <strong>aside </strong>is distinctly styled: for example, as a right-aligned sidebar in printed material, or as a floating box with a distinctive background color or border in a web page. So perhaps the best match in DITA terms is the <strong>abstract </strong>element.</p>
<h2>&lt;hgroup&gt;</h2>
<p>This element is supposed to group consecutive headers together, for example:<br />
<code>&lt;hgroup&gt;<br />
&lt;h1&gt;Main Title&lt;/h1&gt;<br />
&lt;h2&gt;Secondary Title&lt;/h2&gt;<br />
&lt;/hgroup&gt;</code></p>
<p>Stacked headings with no intervening text are considered bad practise in technical document, and DITA&#8217;s DTDs reinforce that by not allowing them. The only time it could happen in DITA is when the <strong>titlealt </strong> element is used to provide an alternative header (for example, one that appears in search results or in a table of contents). But only one of the titles appears in the document at any one time. So I&#8217;m inclined not to use <strong>hgroup</strong> at all.</p>
]]></content:encoded>
			<wfw:commentRss>http://electropubs.com/wordpress/?feed=rss2&#038;p=57</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>A step back: getting mathML and SVG working in DITA</title>
		<link>http://electropubs.com/wordpress/?p=33</link>
		<comments>http://electropubs.com/wordpress/?p=33#comments</comments>
		<pubDate>Fri, 23 Sep 2011 13:12:46 +0000</pubDate>
		<dc:creator>nparker</dc:creator>
				<category><![CDATA[DITA]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[specialization]]></category>
		<category><![CDATA[specializing foreign or unknown]]></category>

		<guid isPermaLink="false">http://electropubs.com/wordpress/?p=33</guid>
		<description><![CDATA[One interesting feature of HTML5 is its ability to render inline SVG and mathML markup to display 2D graphics, syntax diagrams, and equations. For example: &#60;html&#62; &#60;body&#62; &#60;h1&#62;My first SVG&#60;/h1&#62; &#60;svg xmlns="http://www.w3.org/2000/svg" version="1.1"&#62; stroke-width="2" fill="red" /&#62; &#60;/svg&#62; &#60;/body&#62; &#60;/html&#62; This sort of markup works in most modern browsers.  It&#8217;s called inline SVG because the SVG [...]]]></description>
			<content:encoded><![CDATA[<p>One interesting feature of HTML5 is its ability to render inline SVG and mathML markup to display 2D graphics, syntax diagrams, and equations. For example:</p>
<pre>&lt;html&gt;
&lt;body&gt;
&lt;h1&gt;My first SVG&lt;/h1&gt;
&lt;svg xmlns="http://www.w3.org/2000/svg" version="1.1"&gt;
stroke-width="2" fill="red" /&gt;
&lt;/svg&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p>This sort of markup works in most modern browsers.  It&#8217;s called <strong>inline SVG</strong> because the SVG tags are embedded directly within the HTML code, in contrast to<strong> external SVG</strong> in which an SVG file is referenced in exactly the same way as you would a GIF or JPEG:</p>
<pre> &lt;img src="images/myDiagram.svg" alt="An external SVG graphic"/&gt;</pre>
<p>My plan for the DITA to HTML5 plugin is to pass inline SVG or mathML markup directly through from DITA topics to HTML5.</p>
<p>Unfortunately, getting inline SVG and mathML to work in DITA is not straightforward. In fact, I&#8217;ve just spent the last two days doing some <strong>specialization</strong>, the mysterious science of customizing the set of tags that authors can use in DITA, in order to get it to work. The reason that native SVG and mathML support has never been included in the DITA Open Toolkit seems to be that there simply hasn&#8217;t been much demand for it (and it was difficult to display in older browsers). SVG is still the only vectorial graphics format supported by DITA and hopefully one day it&#8217;ll be fully integrated into the open toolkit.</p>
<p>My main sources of information about specialization have been Eliot Kimber&#8217;s excellent <a title="DITA Configuration and Specialization" href="http://xiruss.org/tutorials/dita-specialization/">DITA Configuration and Specialization</a> tutorial and <em>Introduction to DITA</em> by Jennifer Linton and Kylene Bruski.</p>
<p>Specialization can be used to modify DITA&#8217;s original set of elements and attributes in several ways:</p>
<ul>
<li>If you don&#8217;t need a particular <strong>domain </strong>(a related set of tags, for example, the User Interface domain), removing it completely so that authors no longer see any of the domain&#8217;s tags in the list of available elements.</li>
<li>Modifying the properties of particular tags, for example, so that &lt;p&gt; must contain plain text only and none of the inline formatting tags like <tt>&lt;b&gt;</tt> or <tt>&lt;i&gt;</tt> that are normally available.</li>
<li>Creating new attributes for existing tags.</li>
<li>Adding new custom domains.</li>
</ul>
<p>In DITA parlance, these techniques are called respectively &#8221;Document Type Shell&#8221;, &#8220;Topic Constraint&#8221;, &#8220;Attribute Specialization&#8221;, and &#8220;Element Domain Specialization&#8221;. Conclusion: you don&#8217;t have to be a geek to specialize, but it helps. We&#8217;re going to be doing element domain specialization.</p>
<p>To be honest, though, following Eliot&#8217;s tutorial was a lot easier than I anticipated. Using oXygenXML, DITA1.5.3 and a few articles I found on Google, I got inline SVG and mathML working without too much trouble. I suspect I&#8217;ll have more problems packaging it as a plugin so that others can use it, but that&#8217;s for later. And there are still a lot of things I don&#8217;t understand. For now, I&#8217;m going to switch to technical author mode to describe how to implement the specializations.</p>
<p>&nbsp;</p>
<h2>Preparing a Test Environment</h2>
<ol>
<li>Copy the entire <em>{dita-ot-root}</em><tt>/dtd/technicalContent</tt> folder (where <em>{dita-ot-root}</em> is the root folder of your DITA-Open Toolkit installation) to a temporary folder.</li>
<li>Create a new DITA concept topic and change the DOCTYPE line to point to the <tt>concept.dtd </tt>in your temporary folder, for example:
<pre>&lt;!DOCTYPE concept SYSTEM "C:/temp/technicalContent/dtd/concept.dtd"&gt;</pre>
<p><strong>Note: </strong>If your editor adds a PUBLIC identifier as well as or instead of a SYSTEM identifier when it creates a new topic, I would recommend removing it, as a PUBLIC identifier takes precedence over the SYSTEM one and your topic will validate even if the SYSTEM identifier is wrong or a problem occurs in the specialization files.</li>
<li>Validate the topic to check that the DTDs in your working folder are being used.</li>
<li>Save the topic with a .dita or .xml extension.</li>
</ol>
<h2>Adding Inline mathML support to DITA</h2>
<p>Domain specialization requires you to create two files, a <tt>.mod</tt> (module) and a <tt>.ent</tt> (entity), then to update the DTD. This example only shows the concept DTD, but you&#8217;d need to do it to the other topic types&#8217; DTDs too (there must be a way of doing it to the base DTD, ditabase.dtd, so that it works for all topic types, but I couldn&#8217;t figure that out).</p>
<ol>
<li>Copy and paste this <a title="this file" href="http://www.electropubs.com/downloads/mathmlDomain2.mod" target="_blank">.mod file</a> (which I&#8217;ve taken from a specialization article I found) and save it in your temporary <tt>technicalContent/dtd</tt> folder as <tt>mathmlDomain2.mod.</tt></li>
<li>Copy and paste this <a title=".ent file" href="http://www.electropubs.com/downloads/mathmlDomain2.ent" target="_blank">.ent file</a> and save it in the <tt>technicalContent/dtd</tt> folder as <tt>mathmlDomain2.ent.</tt></li>
<li>Edit the <tt>concept.dtd </tt>file in your temporary folder and make the following changes:
<ul>
<li>Add these lines to the bottom of the <tt>DOMAIN ENTITY DECLARATIONS </tt>section:
<pre>&lt;!ENTITY % math-d-dec SYSTEM "mathmlDomain2.ent"&gt;
%math-d-dec;</pre>
</li>
<li>In the <tt>DOMAIN EXTENSIONS </tt>section, add the lines:
<pre>&lt;!ENTITY % foreign "foreign | %math-d-foreign;"&gt;
&lt;!ENTITY % unknown "unknown | %math-d-unknown;"&gt;</pre>
</li>
<li>In the <tt>DOMAINS ATTRIBUTE OVERRIDE </tt>section, add the line:
<pre>&amp;math-d-att;</pre>
</li>
<li>In the <tt>DOMAIN ELEMENT INTEGRATION </tt>section, add the following lines:
<pre>&lt;!ENTITY % math-d-def SYSTEM "mathmlDomain2.mod"&gt;
%math-d-def;</pre>
</li>
</ul>
<p>Save the changes and validate your concept topic to check that you haven&#8217;t messed things up.</li>
</ol>
<p>That&#8217;s it! Position the cursor within a <tt>&lt;p&gt;</tt> element in your concept topic and you should now see new elements like <tt>&lt;equation&gt;</tt> and <tt>&lt;math&gt;</tt> in the list of available elements. To test it on something meaningful, you can use the following sample code:</p>
<pre>&lt;equation&gt;
  &lt;math type="presentation"&gt;
   &lt;mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"
    display="block"&gt;
    &lt;mml:semantics&gt;
     &lt;mml:mrow&gt;
      &lt;mml:mrow&gt;
       &lt;mml:mi mathvariant="bold"&gt;a&lt;/mml:mi&gt;
       &lt;mml:mo&gt;=&lt;/mml:mo&gt;
       &lt;mml:mfrac&gt;
        &lt;mml:mrow&gt;
         &lt;mml:mi mathvariant="bold"&gt;F&lt;/mml:mi&gt;
        &lt;/mml:mrow&gt;
        &lt;mml:mi&gt;m&lt;/mml:mi&gt;
       &lt;/mml:mfrac&gt;
       &lt;mml:mo&gt;=&lt;/mml:mo&gt;
       &lt;mml:mfrac&gt;
        &lt;mml:mrow&gt;
         &lt;mml:mi&gt;q&lt;/mml:mi&gt;
         &lt;mml:mo&gt;[&lt;/mml:mo&gt;
         &lt;mml:mi mathvariant="bold"&gt;E&lt;/mml:mi&gt;
         &lt;mml:mo&gt;+&lt;/mml:mo&gt;
         &lt;mml:mfenced&gt;
          &lt;mml:mrow&gt;
           &lt;mml:mi mathvariant="bold"&gt;v&lt;/mml:mi&gt;
           &lt;mml:mi&gt;X&lt;/mml:mi&gt;
           &lt;mml:mi mathvariant="bold"&gt;B&lt;/mml:mi&gt;
          &lt;/mml:mrow&gt;
         &lt;/mml:mfenced&gt;
         &lt;mml:mo&gt;]&lt;/mml:mo&gt;
        &lt;/mml:mrow&gt;
        &lt;mml:mi&gt;m&lt;/mml:mi&gt;
       &lt;/mml:mfrac&gt;
      &lt;/mml:mrow&gt;
     &lt;/mml:mrow&gt;
    &lt;/mml:semantics&gt;
   &lt;/mml:math&gt;
  &lt;/math&gt;
 &lt;/equation&gt;</pre>
<h2>Adding Inline SVG support</h2>
<p>SVG integration follows the same basic procedure: create two files; a .mod (module) and a .ent (entity) then update the DTD file.</p>
<ol>
<li>Copy and paste this <a title="this file" href="http://www.electropubs.com/downloads/svgDomain.mod" target="_blank">.mod file</a> and save it in the <tt>technicalContent/dtd</tt> folder as <tt>svgDomain.mod.</tt></li>
<li>Copy and paste this <a title=".ent file" href="http://www.electropubs.com/downloads/svgDomain.ent" target="_blank">.ent file</a> and save it in the <tt>technicalContent/dtd</tt> folder as <tt>svgDomain.ent.</tt></li>
<li>If you don&#8217;t already have it, do a Google search for the <tt>svg11.dtd</tt> file and copy it into the <tt>technicalContent/dtd</tt> folder.</li>
<li>Edit the <tt>concept.dtd </tt>file in your temporary folder and make the following changes:
<ul>
<li>In the <tt>DOMAIN ENTITY DECLARATIONS </tt>section, add the lines:
<pre>&lt;!ENTITY % svg-d-dec SYSTEM "svgDomain.ent"&gt;
%svg-d-dec;</pre>
</li>
<li>In the <tt>DOMAIN EXTENSIONS </tt>section, modify the line that you previously edited for mathML to:
<pre>&lt;!ENTITY % foreign "foreign | %math-d-foreign; <strong>| %svg-d-foreign;</strong>"&gt;</pre>
</li>
<li>In the <tt>DOMAINS ATTRIBUTE OVERRIDE </tt>section, add the line:
<pre>&amp;svg-d-att;</pre>
</li>
<li>In the <tt>DOMAIN ELEMENT INTEGRATION </tt>section, add the following lines:
<pre>&lt;!ENTITY % svg-d-def SYSTEM "svgDomain.mod"&gt;
%svg-d-def;</pre>
</li>
</ul>
<p>Save the changes and validate your concept topic again to check that everything works.</li>
</ol>
<p>That&#8217;s it! Position the cursor within a <tt>&lt;p&gt;</tt> element in your concept topic and you should now see the new <tt>&lt;svg&gt;</tt> element in the list of available elements. To test it on something meaningful, you can use the following sample code:</p>
<pre>&lt;svg&gt;
   &lt;svg:svg xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"&gt;
      &lt;svg:ellipse cx="300" cy="150" rx="200" ry="80" style="fill:rgb(200,100,50);
            stroke:rgb(0,0,100);stroke-width:2"/&gt;
    &lt;/svg:svg&gt;
&lt;/svg&gt;</pre>
<h3>Conclusions and Next Steps</h3>
<p>Just to prove it does work, here&#8217;s a screenshot from oXygenXML showing a bit of inline SVG and mathML:</p>
<p>&nbsp;</p>
<p><a href="http://electropubs.com/wordpress/wp-content/uploads/2011/09/mathML_SVG_screenshot.png"><img class="alignnone size-full wp-image-49" title="mathML_SVG_screenshot" src="http://electropubs.com/wordpress/wp-content/uploads/2011/09/mathML_SVG_screenshot.png" alt="Inline mathML and SVG in a DITA Topic" width="303" height="411" /></a></p>
<p>The next steps are:</p>
<ol>
<li>To package this as a plugin so that anyone can add it to their DITA Open Toolkit</li>
<li>To update my DITA to HTML5 transformation so that the inline mathML and SVG appear in my HTML5 topics.</li>
</ol>
<p>More on that at a later date&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://electropubs.com/wordpress/?feed=rss2&#038;p=33</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>An HTML5 plugin for DITA</title>
		<link>http://electropubs.com/wordpress/?p=15</link>
		<comments>http://electropubs.com/wordpress/?p=15#comments</comments>
		<pubDate>Tue, 20 Sep 2011 10:03:22 +0000</pubDate>
		<dc:creator>nparker</dc:creator>
				<category><![CDATA[DITA]]></category>
		<category><![CDATA[HTML5]]></category>

		<guid isPermaLink="false">http://electropubs.com/wordpress/?p=15</guid>
		<description><![CDATA[Does anyone need to export content from DITA to HTML5? I&#8217;ve been somewhat surprised at the lack of any real discussion on this topic so far apart from a few posts on the DITA-USERS forum about video codec compatibility and a good article by Don Day. The current explosive growth in the number of smart devices [...]]]></description>
			<content:encoded><![CDATA[<p>Does anyone need to export content from DITA to HTML5? I&#8217;ve been somewhat surprised at the lack of any real discussion on this topic so far apart from a few posts on the DITA-USERS forum about video codec compatibility and a <a title="DITA and HTML5" href="http://learningbywrote.com/blog/2011/09/what-html5s-most-discussed-benefits-mean-for-dita/">good article</a> by Don Day.</p>
<p>The current explosive growth in the number of smart devices deployed will inevitably lead to a strong demand for technical documentation on mobile platforms. PDF- and HTML-based documents as well as eBooks can, of course, already be used on smart devices by means of native viewers, mobile browsers and eBook readers. The PDF and HTML user experience is generally poor, involving a lot of tapping, pinching, scrolling and rotating to get content to display correctly. Although the eBook user experience is much better, especially on tablets, eBook readers are proprietary native applications and mobile platform owners have imposed all sorts of restrictions on content.</p>
<p>HTML5 promises to offer a superior user experience for mobile users.  Mobile browsers already do a good job of automatically resizing and reformatting HTML5-based content to match devices&#8217; screen sizes and resolutions. HTML5 content can be rich, dynamic, and interactive so is well suited to eLearning applications, for example.</p>
<p>So I&#8217;ve decided to try and create an HTML5 plugin for DITA! I hope this plugin will provide support for:</p>
<ul>
<li>HTML&#8217;s new semantic elements such as &lt;nav&gt;, &lt;header&gt;, and &lt;footer&gt;</li>
<li>Inline SVG graphics</li>
<li>MathML equations</li>
<li>Offline storage</li>
</ul>
<p>The latest generation of browsers, including Firefox, Chrome, Safari, and Webkit-based mobile browsers, already support all these features. Internet Explorer is lagging behind as usual, but Microsoft has promised that IE10 will fully support the HTML5 standard. HTML5 is still evolving, so it looks like definitive support for things like metadata and the many Javascript APIs will have to wait for a while yet. But the core functionality is remarkably stable and well-supported, so there&#8217;s already enough to be getting on with&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://electropubs.com/wordpress/?feed=rss2&#038;p=15</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

