/[volute]/trunk/projects/ivoapub/ivoatex/tth-ivoa.xslt
ViewVC logotype

Annotation of /trunk/projects/ivoapub/ivoatex/tth-ivoa.xslt

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5924 - (hide annotations)
Thu Jan 14 08:18:19 2021 UTC (3 months, 3 weeks ago) by msdemlei
File size: 15932 byte(s)
ivoatex: Limiting the HTML body width to 21cm.


1 volute@g-vo.org 2694 <?xml version="1.0"?>
2     <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3     xmlns="http://www.w3.org/1999/xhtml"
4     version="1.0">
5    
6     <!-- The parameter docbase is the location where the final document
7     will be served from. This will always have the following value
8     in final versions, but draft versions may appear for a while at
9     a different location, and this can be parameterised when this
10     stylesheet is invoked. -->
11     <xsl:param name='docbase'>http://www.ivoa.net/documents/</xsl:param>
12    
13     <xsl:param name="CSS_HREF" select="''"/>
14    
15     <xsl:output method="xml" encoding="utf-8"/>
16 volute@g-vo.org 2739 <xsl:output cdata-section-elements="pre"/>
17 volute@g-vo.org 2694
18     <xsl:template match="*">
19     <xsl:copy>
20     <xsl:apply-templates select="*|@*|text()"/>
21     </xsl:copy>
22     </xsl:template>
23    
24     <xsl:template match="@*">
25     <xsl:copy/>
26     </xsl:template>
27    
28     <xsl:template match="head">
29     <xsl:copy>
30 msdemlei 5583 <title><xsl:value-of select="//h1[1]"/></title>
31 volute@g-vo.org 2694 <xsl:element name="link">
32     <xsl:attribute name="rel">stylesheet</xsl:attribute>
33     <xsl:attribute name="type">text/css</xsl:attribute>
34     <xsl:attribute name="href">
35     <xsl:value-of select="$CSS_HREF"/>
36     </xsl:attribute>
37     </xsl:element>
38 volute@g-vo.org 2698 <xsl:call-template name="selectDoctypeStyle"/>
39    
40 volute@g-vo.org 2911 <xsl:apply-templates select="//span[@class='customcss']"/>
41    
42 volute@g-vo.org 2746 <style type="text/css">
43     <xsl:text disable-output-escaping="yes">
44 volute@g-vo.org 2698 div#versionstatement, div#dateline {
45     color: #005A9C;
46     font-size: 150%;
47     }
48    
49     p.parsep {
50     overflow: hidden;
51     height: 0pt;
52     margin-top:0.5ex;
53     margin-bottom:0.5ex;
54     }
55    
56 msdemlei 3331 div.generated {
57     padding-left: 5mm;
58     border-left: 4pt solid #dddddd;
59     }
60    
61 volute@g-vo.org 2698 div.admonition {
62     width: 30em;
63     position: relative;
64     float: right;
65     background-color: #dddddd;
66     font-size: 80%;
67     margin: 1ex;
68     padding: 3pt;
69     overflow: auto;
70     }
71    
72     p.admonition-type {
73     background-color: #444444;
74     color: #ffffff;
75     margin-top: 0px;
76     padding-left: 5pt;
77     padding-top: 5pt;
78     padding-bottom: 5pt;
79     font-weight: bold;
80     }
81 volute@g-vo.org 2699
82     a.tth_citation, a.tth_citeref {
83     color: #002A5C;
84     text-decoration: none;
85     }
86 volute@g-vo.org 2698
87 volute@g-vo.org 2769 .xmlel {
88     font-family: monospace;
89     font-style: italic;
90     }
91    
92 volute@g-vo.org 2837 .vorent {
93     font-variant: small-caps;
94     }
95    
96 volute@g-vo.org 2746 table {
97     border-collapse: collapse;
98     border-spacing: 0px;
99     }
100    
101 volute@g-vo.org 2755 table.tabular {
102     margin-top: 2ex;
103     margin-bottom: 1ex;
104     margin-left: 0.5em;
105     }
106    
107 volute@g-vo.org 2746 table.tabular > * > tr > td, table.tabular > tr > td {
108     border-top: 1pt solid gray;
109     border-bottom: 1pt solid gray;
110 volute@g-vo.org 2755 padding: 2pt;
111 volute@g-vo.org 2746 }
112 volute@g-vo.org 2755
113     dt {
114     margin-top: 0.5ex;
115     }
116 volute@g-vo.org 2822
117     .redaction {
118     background-color: #ffff33;
119     }
120 volute@g-vo.org 2896
121     span.nolinkurl {
122     font-family: monospace;
123     }
124 volute@g-vo.org 2908
125     .basicstyle__footnotesize {
126     font-size: 80%;
127     }
128 msdemlei 4478
129     pre {
130     counter-reset: pre_line;
131     }
132    
133     pre span {
134     counter-increment: pre_line;
135     }
136    
137 msdemlei 4485 div.numbers_left pre span:before {
138 msdemlei 4478 content: counter(pre_line);
139     text-align: right;
140     user-select: none;
141     min-width: 1.5em;
142     display: inline-block;
143     padding-right: 1em;
144     }
145 msdemlei 4620
146     img.archdiag {
147     display: block;
148     width: 90%;
149     margin-left: auto;
150     margin-right: auto;
151 msdemlei 5923 max-width: 19cm;
152 msdemlei 4620 }
153 msdemlei 4623
154     ul.authors, ul.previousversions, ul.editors {
155     list-style-type: none;
156     padding-left: 0pt;
157     margin-top: 2pt;
158     margin-bottom: 2pt;
159     }
160 msdemlei 5924
161     body div {
162     max-width: 21cm;
163     }
164 volute@g-vo.org 2911 </xsl:text></style>
165 volute@g-vo.org 2746
166 volute@g-vo.org 2694 <xsl:apply-templates/>
167     </xsl:copy>
168     </xsl:template>
169    
170     <xsl:template match="div[@id='titlepage']">
171     <xsl:copy>
172     <table cellspacing="0" cellpadding="0" width="450">
173     <tr>
174     <td><a href="http://www.ivoa.net/"><img height="169" alt="IVOA" src="http://www.ivoa.net/icons/IVOA_wb_300.jpg" width="300" border="0"/></a></td>
175     <td>
176     <div style="padding: 3.6pt 7.2pt;">
177     <p><b><i><span style="font-size: 14pt; color: rgb(0, 90, 156);"><span>&#xa0;</span>I</span></i></b><i><span style="font-size: 14pt; color: rgb(0, 90, 156);">nternational</span></i></p>
178     <p><b><i><span style="font-size: 14pt; color: rgb(0, 90, 156);"><span>&#xa0;&#xa0;&#xa0;</span>V</span></i></b><i><span style="font-size: 14pt; color: rgb(0, 90, 156);">irtual</span></i></p>
179     <p><b><i><span style="font-size: 14pt; color: rgb(0, 90, 156);"><span>&#xa0;</span><span>&#xa0;&#xa0;</span>O</span></i></b><i><span style="font-size: 14pt; color: rgb(0, 90, 156);">bservatory</span></i></p>
180     <p><b><i><span style="font-size: 14pt; color: rgb(0, 90, 156);">A</span></i></b><i><span style="font-size: 14pt; color: rgb(0, 90, 156);">lliance</span></i><i>
181     </i></p>
182     </div>
183     <i></i></td>
184     </tr>
185     </table>
186     <br/>
187     </xsl:copy>
188    
189     <h1><xsl:value-of select="h1[@align='center']"/></h1>
190     <div id="versionstatement">
191 msdemlei 3690 Version <xsl:value-of select="span[@id='version']"/>
192 volute@g-vo.org 2694 </div>
193     <div id="dateline">
194 msdemlei 3690 <xsl:apply-templates select="span[@id='doctype']" mode="humanreadable"/>
195 volute@g-vo.org 2694 <xsl:text> </xsl:text>
196 msdemlei 3690 <xsl:apply-templates select="span[@id='docdate']"/>
197 volute@g-vo.org 2694 </div>
198     <dl id="docmeta">
199    
200     <dt>Working Group</dt>
201 msdemlei 3690 <xsl:copy-of select="dd[@id='ivoagroup']"/>
202 volute@g-vo.org 2694
203     <dt>This Version</dt>
204     <dd>
205     <xsl:call-template name="currentlink"/>
206     </dd>
207    
208     <dt>Latest Version</dt>
209     <dd>
210     <xsl:call-template name="latestlink"/>
211     </dd>
212    
213     <dt>Previous Versions</dt>
214     <dd>
215     <ul class="previousversions">
216 msdemlei 3690 <xsl:apply-templates select="li[@class='previousversion']"/>
217 volute@g-vo.org 2694 </ul>
218     </dd>
219    
220     <dt>Author(s)</dt>
221     <dd>
222     <ul class="authors">
223 msdemlei 3690 <xsl:apply-templates select="li[@class='author']"/>
224 volute@g-vo.org 2694 </ul>
225     </dd>
226    
227 major.brian 2903 <dt>Editor(s)</dt>
228 major.brian 2845 <dd>
229     <ul class="editors">
230 msdemlei 3690 <xsl:apply-templates select="li[@class='editor']"/>
231 major.brian 2845 </ul>
232     </dd>
233    
234 volute@g-vo.org 2823 <xsl:if test="span[@id='vcsRev']">
235 volute@g-vo.org 2822 <dt>Version Control</dt>
236 volute@g-vo.org 2823 <dd>Revision <xsl:value-of select="span[@id='vcsRev']"
237     /><xsl:if test="span[@id='vcsDate']">, last change
238     <xsl:value-of select="span[@id='vcsDate']"/>
239 volute@g-vo.org 2822 </xsl:if>
240 volute@g-vo.org 2827 <xsl:if test="span[@id='vcsURL']"><br/>
241     <a>
242     <xsl:attribute name="href">
243     <xsl:value-of select="span[@id='vcsURL']"/>
244     </xsl:attribute>Source file in VCS</a>
245     </xsl:if>
246 volute@g-vo.org 2822 </dd>
247     </xsl:if>
248 volute@g-vo.org 2694 </dl>
249     </xsl:template>
250    
251     <xsl:template match="a/@name">
252     <xsl:if test="not(starts-with(., 'CITE'))">
253     <xsl:copy/>
254     </xsl:if>
255     </xsl:template>
256    
257     <xsl:template match="a/@href">
258     <xsl:if test="not(starts-with(., '#CITE'))">
259     <xsl:copy/>
260     </xsl:if>
261     </xsl:template>
262    
263     <xsl:template match="style[./@type='text/css']">
264     </xsl:template>
265    
266 volute@g-vo.org 2911 <xsl:template match="span[@class='customcss']">
267     <link type="text/css" rel="stylesheet">
268     <xsl:attribute name="href"><xsl:value-of select="@ref"/></xsl:attribute>
269     </link>
270     </xsl:template>
271    
272 volute@g-vo.org 2694 <xsl:template match="dd/div[./@class='p']">
273     </xsl:template>
274    
275     <xsl:template match="span[@id='doctype']" mode="humanreadable">
276 volute@g-vo.org 2698 <xsl:variable name="doctype" select="."/>
277 volute@g-vo.org 2694 <xsl:choose>
278 volute@g-vo.org 2770 <xsl:when test="$doctype='WD'">
279     <xsl:text>IVOA Working Draft </xsl:text>
280     </xsl:when>
281     <xsl:when test="$doctype='PR'">
282     <xsl:text>IVOA Proposed Recommendation </xsl:text>
283     </xsl:when>
284     <xsl:when test="$doctype='REC'">
285     <xsl:text>IVOA Recommendation </xsl:text>
286     </xsl:when>
287     <xsl:when test="$doctype='NOTE'">
288     <xsl:text>IVOA Note </xsl:text>
289     </xsl:when>
290 msdemlei 3524 <xsl:when test="$doctype='PEN'">
291     <xsl:text>Proposed Endorsed Note </xsl:text>
292 volute@g-vo.org 2770 </xsl:when>
293 msdemlei 3524 <xsl:when test="$doctype='EN'">
294     <xsl:text>Endorsed Note </xsl:text>
295     </xsl:when>
296 volute@g-vo.org 2770 <xsl:otherwise>
297     <xsl:message terminate='yes'>doctype must be one of
298 msdemlei 3524 WD, PR, REC, NOTE, EN, PEN not
299 volute@g-vo.org 2770 '<xsl:value-of select="$doctype"/>'</xsl:message>
300     </xsl:otherwise>
301 volute@g-vo.org 2694 </xsl:choose>
302     </xsl:template>
303    
304     <xsl:template match="div[@id='statusOfThisDocument']">
305 volute@g-vo.org 2698 <xsl:variable name="doctype" select="."/>
306 volute@g-vo.org 2694 <p id="statusdecl"><em>
307     <xsl:choose>
308 volute@g-vo.org 2698 <xsl:when test="$doctype='NOTE'">
309 volute@g-vo.org 2694 This is an IVOA Note expressing suggestions from and
310     opinions of the authors. It is intended to share best
311     practices, possible approaches, or other perspectives on
312     interoperability with the Virtual Observatory. It should
313     not be referenced or otherwise interpreted as a standard
314     specification.
315     </xsl:when>
316 volute@g-vo.org 2698 <xsl:when test="$doctype='WD'">
317 volute@g-vo.org 2694 This is an IVOA Working Draft for review by IVOA members
318     and other interested parties. It is a draft document and
319     may be updated, replaced, or obsoleted by other documents
320     at any time. It is inappropriate to use IVOA Working Drafts
321     as reference materials or to cite them as other than "work
322     in progress".
323     </xsl:when>
324 volute@g-vo.org 2698 <xsl:when test="$doctype='PR'">
325 volute@g-vo.org 2694 This is an IVOA Proposed Recommendation made available for
326     public review. It is appropriate to reference this document
327     only as a recommended standard that is under review and
328     which may be changed before it is accepted as a full
329     Recommendation.
330     </xsl:when>
331 volute@g-vo.org 2698 <xsl:when test="$doctype='REC'">
332 volute@g-vo.org 2694 This document has been reviewed by IVOA Members and other
333     interested parties, and has been endorsed by the IVOA
334     Executive Committee as an IVOA Recommendation. It is a
335     stable document and may be used as reference material or
336     cited as a normative reference from another document.
337     IVOA's role in making the Recommendation is to draw
338     attention to the specification and to promote its
339     widespread deployment. This enhances the functionality and
340     interoperability inside the Astronomical Community.
341     </xsl:when>
342 msdemlei 3524 <xsl:when test="$doctype='PEN'">
343 msdemlei 3537 This is an IVOA Proposed Endorsed Note for review by IVOA
344     members and other interested parties. It is appropriate to
345     reference this document only as a Proposed Endorsed Note that
346     is under review and may change before it is endorsed or may
347     not be endorsed.
348 volute@g-vo.org 2770 </xsl:when>
349 msdemlei 3524 <xsl:when test="$doctype='EN'">
350     This document is an IVOA Endorsed Note. It has been reviewed
351     and endorsed by the IVOA Technical Coordination Group as a
352     stable, citable document which constitutes valuable information
353     for the IVOA community and beyond.
354     </xsl:when>
355 volute@g-vo.org 2694 <xsl:otherwise>
356 volute@g-vo.org 2770 <xsl:message terminate='yes'>Invalid document
357     status (this cannot happen).</xsl:message>
358 volute@g-vo.org 2694 </xsl:otherwise>
359     </xsl:choose>
360     </em></p>
361 msdemlei 5700
362     <p>A list of current IVOA Recommendations and other technical documents
363     can be found in the <a href="http://www.ivoa.net/documents">IVOA
364     document repository</a>.</p>
365 volute@g-vo.org 2694 </xsl:template>
366    
367 volute@g-vo.org 2698 <xsl:template name="selectDoctypeStyle">
368     <xsl:variable name="doctype" select="//span[@id='doctype']"/>
369     <link rel="stylesheet" type="text/css">
370     <xsl:attribute name="href">
371     <xsl:choose>
372     <xsl:when test="$doctype='WD'"
373     >http://www.ivoa.net/misc/ivoa_wd.css</xsl:when>
374     <xsl:when test="$doctype='PR'"
375     >http://www.ivoa.net/misc/ivoa_pr.css</xsl:when>
376     <xsl:when test="$doctype='REC'"
377     >http://www.ivoa.net/misc/ivoa_rec.css</xsl:when>
378     <xsl:when test="$doctype='NOTE'"
379     >http://www.ivoa.net/misc/ivoa_note.css</xsl:when>
380 msdemlei 3524 <xsl:when test="$doctype='PEN'"
381     >http://www.ivoa.net/misc/ivoa_note.css</xsl:when>
382     <xsl:when test="$doctype='EN'"
383     >http://www.ivoa.net/misc/ivoa_note.css</xsl:when>
384 volute@g-vo.org 2698 </xsl:choose>
385     </xsl:attribute>
386     </link>
387     </xsl:template>
388    
389 volute@g-vo.org 2908 <!-- To somewhat support keyval-style arguments (as in, e.g., listings)
390     this allows translating them into css classes. Essentially,
391     generate a div with a keyvals attribute; see lstlisting in tthdefs -->
392    
393     <xsl:template match="*[@keyvals]">
394     <div>
395     <xsl:attribute name="class">
396     <xsl:value-of select="translate(@keyvals, ',=\\', ' __')"/>
397     </xsl:attribute>
398     <xsl:apply-templates/>
399     </div>
400     </xsl:template>
401    
402 msdemlei 4478 <!-- In verbatim listings, we may want to play tricks with lines.
403     So, let's mark them up with spans. -->
404    
405     <xsl:template name="split-into-lines">
406     <xsl:param name="arg"/>
407     <span class="verbline"><xsl:value-of
408     select="substring-before($arg, '&#xa;')"/>
409     <xsl:text>&#xa;</xsl:text>
410     </span>
411    
412     <xsl:if test="substring-after($arg, '&#xa;')">
413     <xsl:call-template name="split-into-lines">
414     <xsl:with-param name="arg" select="substring-after($arg, '&#xa;')"/>
415     </xsl:call-template>
416     </xsl:if>
417     </xsl:template>
418    
419     <xsl:template match="pre">
420     <pre>
421     <xsl:copy-of select="@*"/>
422     <xsl:call-template name="split-into-lines">
423     <xsl:with-param name="arg" select="."/>
424     </xsl:call-template>
425     </pre>
426     </xsl:template>
427    
428 volute@g-vo.org 2694 <!-- Make a link to the current version on the ivoa doc server.
429     The format of the URI here is as mandated by the IVOA
430     Document Standards Standard Document (ahem). -->
431     <xsl:template name="currentlink">
432 msdemlei 3690 <xsl:variable name="docdate" select="span[@id='docdate']"/>
433 volute@g-vo.org 2694 <xsl:variable name="currenturl">
434     <xsl:value-of select="$docbase"/>
435 msdemlei 3690 <xsl:value-of select="//span[@id='docname']"/>
436 volute@g-vo.org 2694 <xsl:text>/</xsl:text>
437     <xsl:value-of select="concat(
438     substring($docdate, 1, 4),
439     substring($docdate, 6, 2),
440     substring($docdate, 9, 2))"/>
441     </xsl:variable>
442     <xsl:element name="a">
443     <xsl:attribute name="class">currentlink</xsl:attribute>
444     <xsl:attribute name="href">
445     <xsl:value-of select="$currenturl"/>
446     </xsl:attribute>
447     <xsl:value-of select="$currenturl"/>
448     </xsl:element>
449     </xsl:template>
450    
451     <!-- Make a link to the LATEST version on the ivoa doc server.
452     This is a URL without a version, which will redirect, on the
453     doc server, to the versioned URL. -->
454     <xsl:template name="latestlink">
455     <xsl:variable name="currenturl">
456     <xsl:value-of select="$docbase"/>
457     <xsl:value-of select="//span[@id='docname']"/>
458     </xsl:variable>
459     <xsl:element name="a">
460     <xsl:attribute name="class">latestlink</xsl:attribute>
461     <xsl:attribute name="href">
462     <xsl:value-of select="$currenturl"/>
463     </xsl:attribute>
464     <xsl:value-of select="$currenturl"/>
465     </xsl:element>
466     </xsl:template>
467    
468 msdemlei 5923 <!-- I want to style the role diagram; ideally, we'd add a class
469     through LaTeX, but TTH doesn't have a straightforward facility
470     for doing this. Hence, I'm adding a class manually. -->
471     <xsl:template match="img[@src='role_diagram.svg']">
472     <xsl:copy>
473     <xsl:attribute name="class">archdiag</xsl:attribute>
474     <xsl:apply-templates select="@*|node()"/>
475     </xsl:copy>
476     </xsl:template>
477    
478     <!-- tth has given up detecting p elements in TeX source and hacks in
479 volute@g-vo.org 2698 div class="p" elements as paragraph separators. These
480     are potentially very confusing to browsers. We hence
481     replace them with hopefully less confusing constructs -->
482     <xsl:template match="div[@class='p']">
483     <p class="parsep"><span> </span></p>
484     </xsl:template>
485    
486 volute@g-vo.org 2694 <xsl:template match="body">
487     <xsl:apply-templates/>
488     </xsl:template>
489    
490     </xsl:stylesheet>

msdemlei@ari.uni-heidelberg.de
ViewVC Help
Powered by ViewVC 1.1.26