diff options
| author | Frerich Raabe <raabe@froglogic.com> | 2015-09-23 22:53:50 +0200 |
|---|---|---|
| committer | Frerich Raabe <raabe@froglogic.com> | 2015-09-24 18:26:55 +0200 |
| commit | 35f12b5095799e41b563f47a7923a1d01015c71c (patch) | |
| tree | 11c156045a0811fee4512366e387034ea1991e1f /tests/docbook-xref.docbook | |
| parent | f6538144f0763ae17b60c78810ed52ab96df308d (diff) | |
| download | pandoc-35f12b5095799e41b563f47a7923a1d01015c71c.tar.gz | |
Added proper support for DocBook 'xref' elements
'xref' is used to create cross references to other parts of the
document. It is an empty element - the cross reference text depends on
various attributes. Quoting 'DocBook: The Definitive Guide':
1. If the endterm attribute is specified on xref, the content of the
element pointed to by endterm will be used as the text of the
cross-reference.
2. Otherwise, if the object pointed to has a specified XRefLabel, the
content of that attribute will be used as the cross-reference text.
Diffstat (limited to 'tests/docbook-xref.docbook')
| -rw-r--r-- | tests/docbook-xref.docbook | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/tests/docbook-xref.docbook b/tests/docbook-xref.docbook new file mode 100644 index 000000000..ebcd94d00 --- /dev/null +++ b/tests/docbook-xref.docbook @@ -0,0 +1,70 @@ +<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" + "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"> +<book><title>An Example Book</title> +<chapter id="ch01"><title>XRef Samples</title> +<para> +This paragraph demonstrates several features of +<sgmltag>XRef</sgmltag>. +</para> +<itemizedlist> +<listitem><para>A straight link generates the +cross-reference text: <xref linkend="ch02"/>. +</para></listitem> +<listitem><para>A link to an element with an +<sgmltag class="attribute">XRefLabel</sgmltag>: +<xref linkend="ch03"/>. +</para></listitem> +<listitem><para>A link with an +<sgmltag class="attribute">EndTerm</sgmltag>: +<xref linkend="ch04" endterm="ch04short"/>. +</para></listitem> +<listitem><para>A link to an +<sgmltag>cmdsynopsis</sgmltag> element: <xref linkend="cmd01"/>. +</para></listitem> +<listitem><para>A link to an +<sgmltag>funcsynopsis</sgmltag> element: <xref linkend="func01"/>. +</para></listitem> +</itemizedlist> +</chapter> + +<chapter id="ch02"> + <title>The Second Chapter</title> + <para>Some content here</para> +</chapter> + +<chapter id="ch03" xreflabel="Chapter the Third"> + <title>The Third Chapter</title> + <para>Some content here</para> +</chapter> + +<chapter id="ch04"> + <title>The Fourth Chapter</title> + <titleabbrev id="ch04short">Chapter 4</titleabbrev> + <para>Some content here</para> + +<cmdsynopsis id="cmd01"> + <command>chgrp</command> + <arg>-R + <group> + <arg>-H</arg> + <arg>-L</arg> + <arg>-P</arg> + </group> + </arg> + <arg>-f</arg> + <arg choice='plain'><replaceable>group</replaceable></arg> + <arg rep='repeat' choice='plain'><replaceable>file</replaceable></arg> +</cmdsynopsis> + + +<funcsynopsis id="func01"> +<funcprototype> +<funcdef>int <function>max</function></funcdef> +<paramdef>int <parameter>int1</parameter></paramdef> +<paramdef>int <parameter>int2</parameter></paramdef> +</funcprototype> +</funcsynopsis> + +</chapter> +</book> + |
