aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRowan Rodrik van der Molen <bigsmoke@gmail.com>2021-11-05 17:22:38 +0000
committerGitHub <noreply@github.com>2021-11-05 10:22:38 -0700
commit7a70a46c0319f279fdee3926abff08922be2f02c (patch)
treeb49a26843e0db55f457812e8a95c3d37ef981671 /test
parent5750f60442923780dda91d63dd11b1904446a2d9 (diff)
downloadpandoc-7a70a46c0319f279fdee3926abff08922be2f02c.tar.gz
Support for <indexterm>s when reading DocBook (#7607)
* Support for <indexterm>s when reading DocBook * Update implementation status of `<n-ary>` tags * Remove non-idiomatic parentheses * More complete `<indexterm>` support, with tests Co-authored-by: Rowan Rodrik van der Molen <rowan@ytec.nl>
Diffstat (limited to 'test')
-rw-r--r--test/docbook-reader.docbook12
-rw-r--r--test/docbook-reader.native187
2 files changed, 199 insertions, 0 deletions
diff --git a/test/docbook-reader.docbook b/test/docbook-reader.docbook
index c38abda82..00bd84649 100644
--- a/test/docbook-reader.docbook
+++ b/test/docbook-reader.docbook
@@ -1603,4 +1603,16 @@ or here: &lt;http://example.com/&gt;
</step>
</procedure>
</sect1>
+<sect1 id="indexterms">
+ <title>Index terms</title>
+ <para>
+ In the simplest case, index terms<indexterm><primary>index term</primary></indexterm> consists of just a <code>&lt;primary&gt;</code> element, but <indexterm><primary>index term</primary><secondary>multi-level</secondary></indexterm> they can also consist of a <code>&lt;primary&gt;</code> <emph>and</emph> <code>&lt;secondary&gt;</code> element, and <indexterm><primary>index term</primary><secondary>multi-level</secondary><tertiary>3-level</tertiary></indexterm> can even include a <code>&lt;tertiary&gt;</code> term.
+ </para>
+ <para>
+ Index terms can also refer to other index terms: <indexterm><primary>index cross referencing</primary></indexterm><indexterm><primary>index term</primary><secondary>cross references</secondary><see>index cross referencing</see></indexterm>exclusively, using the <code>&lt;see&gt;</code> tag; or <indexterm><primary>index cross referencing</primary><seealso>cross referencing</seealso></indexterm> as a reference to related terms, using the <code>&lt;seealso&gt;</code> tag.
+ </para>
+ <para>
+ <indexterm><primary>food</primary><secondary>big <foreignphrase>baguette</foreignphrase> <strong>supreme</strong></secondary></indexterm>Nested content in index term elements is flattened.
+ </para>
+</sect1>
</article>
diff --git a/test/docbook-reader.native b/test/docbook-reader.native
index be3819336..7520068b1 100644
--- a/test/docbook-reader.native
+++ b/test/docbook-reader.native
@@ -2930,4 +2930,191 @@ Pandoc
[ Str "A" , Space , Str "Final" , Space , Str "Step" ]
]
]
+ , Header
+ 1
+ ( "indexterms" , [] , [] )
+ [ Str "Index" , Space , Str "terms" ]
+ , Para
+ [ Str "In"
+ , Space
+ , Str "the"
+ , Space
+ , Str "simplest"
+ , Space
+ , Str "case,"
+ , Space
+ , Str "index"
+ , Space
+ , Str "terms"
+ , Span
+ ( "" , [ "indexterm" ] , [ ( "primary" , "index term" ) ] )
+ []
+ , Space
+ , Str "consists"
+ , Space
+ , Str "of"
+ , Space
+ , Str "just"
+ , Space
+ , Str "a"
+ , Space
+ , Code ( "" , [] , [] ) "<primary>"
+ , Space
+ , Str "element,"
+ , Space
+ , Str "but"
+ , Space
+ , Span
+ ( ""
+ , [ "indexterm" ]
+ , [ ( "primary" , "index term" )
+ , ( "secondary" , "multi-level" )
+ ]
+ )
+ []
+ , Space
+ , Str "they"
+ , Space
+ , Str "can"
+ , Space
+ , Str "also"
+ , Space
+ , Str "consist"
+ , Space
+ , Str "of"
+ , Space
+ , Str "a"
+ , Space
+ , Code ( "" , [] , [] ) "<primary>"
+ , Space
+ , Str "and"
+ , Space
+ , Code ( "" , [] , [] ) "<secondary>"
+ , Space
+ , Str "element,"
+ , Space
+ , Str "and"
+ , Space
+ , Span
+ ( ""
+ , [ "indexterm" ]
+ , [ ( "primary" , "index term" )
+ , ( "secondary" , "multi-level" )
+ , ( "tertiary" , "3-level" )
+ ]
+ )
+ []
+ , Space
+ , Str "can"
+ , Space
+ , Str "even"
+ , Space
+ , Str "include"
+ , Space
+ , Str "a"
+ , Space
+ , Code ( "" , [] , [] ) "<tertiary>"
+ , Space
+ , Str "term."
+ ]
+ , Para
+ [ Str "Index"
+ , Space
+ , Str "terms"
+ , Space
+ , Str "can"
+ , Space
+ , Str "also"
+ , Space
+ , Str "refer"
+ , Space
+ , Str "to"
+ , Space
+ , Str "other"
+ , Space
+ , Str "index"
+ , Space
+ , Str "terms:"
+ , Space
+ , Span
+ ( ""
+ , [ "indexterm" ]
+ , [ ( "primary" , "index cross referencing" ) ]
+ )
+ []
+ , Span
+ ( ""
+ , [ "indexterm" ]
+ , [ ( "primary" , "index term" )
+ , ( "secondary" , "cross references" )
+ , ( "see" , "index cross referencing" )
+ ]
+ )
+ []
+ , Str "exclusively,"
+ , Space
+ , Str "using"
+ , Space
+ , Str "the"
+ , Space
+ , Code ( "" , [] , [] ) "<see>"
+ , Space
+ , Str "tag;"
+ , Space
+ , Str "or"
+ , Space
+ , Span
+ ( ""
+ , [ "indexterm" ]
+ , [ ( "primary" , "index cross referencing" )
+ , ( "seealso" , "cross referencing" )
+ ]
+ )
+ []
+ , Space
+ , Str "as"
+ , Space
+ , Str "a"
+ , Space
+ , Str "reference"
+ , Space
+ , Str "to"
+ , Space
+ , Str "related"
+ , Space
+ , Str "terms,"
+ , Space
+ , Str "using"
+ , Space
+ , Str "the"
+ , Space
+ , Code ( "" , [] , [] ) "<seealso>"
+ , Space
+ , Str "tag."
+ ]
+ , Para
+ [ Span
+ ( ""
+ , [ "indexterm" ]
+ , [ ( "primary" , "food" )
+ , ( "secondary" , "big baguette supreme" )
+ ]
+ )
+ []
+ , Str "Nested"
+ , Space
+ , Str "content"
+ , Space
+ , Str "in"
+ , Space
+ , Str "index"
+ , Space
+ , Str "term"
+ , Space
+ , Str "elements"
+ , Space
+ , Str "is"
+ , Space
+ , Str "flattened."
+ ]
]