W3C home > Mailing lists > Public > spec-prod@w3.org > April to June 2010

ReSpec2 section references and figures

From: Gregg Kellogg <gregg@kellogg-assoc.com>
Date: Mon, 24 May 2010 19:39:06 -0400
To: Spec Prod <spec-prod@w3.org>
Message-ID: <E174CE19-9FA4-44D0-971E-D30545DD1EB2@kellogg-assoc.com>
I'm using ReSpec2 for documenting the Connected Media Experience (http://connectedmediaexperience.org) and have made some contributions to making it more functional. There are a couple of features we would find useful for our efforts that may be more generally useful, and could be added to the ReSpec2 core functionality if there's interest:

Figures

Proposed: Figures may be designated by setting class to figure. An automatically numbered title will be generated with content set from the title or alt attribute of the same element.

Figures may be referenced within the document using an a element, as with Definitions. To generate a reference including the figure number, use an a element with empty content.

<img class="figure" id="my-image" src="images/image.jpg" alt="Cool Image"/>
<p>Check out <a href="#my-image"></a>.</p>

will generate the following output:

<img class="figure" id="my-image" src="images/image.jpg" alt="Cool Image"/>
<p class="figure-title"><span class="figno">1</span>: Cool Image</p>
<p>Check out <a class="figno-ref" href="#my-image">1</p>

A Table of Figures could be generated fairly easily too.

Internal Section References

Normal section references may be created using an a element with an href pointing to the id of a specific section. If the content of the a element is left empty, ReSpec will fill it in with the auto-numbered section reference as follows:

<section id="this">
<h2>This Section</h2>
<p>Reference to <a href="#this"></a>.</p>
</section>

would result in the following output:

<section id="this">
<h3><span class="secno">2.4 </span>This Section</h3>
<p>Reference to <a class="secno-ref" href="#this">2.4</a>.</p>
</section>

Gregg
Received on Monday, 24 May 2010 23:40:14 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 10 March 2012 06:19:17 GMT