From f2a22e71dffef0e795d73ecffeaa195733dde67e Mon Sep 17 00:00:00 2001 From: Julia Diaz Date: Thu, 26 Oct 2023 23:18:33 +0100 Subject: Modify JATS reader to handle BITS too (#9138) Add provision for title-group, book, book-part-wrapper, book-meta, book-part-meta, book-title, book-title-group, index, toc, legend, title, collection-meta --- test/command/8867.md | 49 ++++++++ test/command/bits-book-meta.md | 104 ++++++++++++++++ test/command/bits-book-part-wrapper-meta.md | 95 ++++++++++++++ test/command/bits-book-part-wrapper.md | 149 ++++++++++++++++++++++ test/command/bits-book.md | 186 ++++++++++++++++++++++++++++ test/command/bits-index-elements.md | 83 +++++++++++++ test/command/bits-legend.md | 45 +++++++ test/command/bits-named-boook-parts.md | 68 ++++++++++ test/command/bits-title-display-as.md | 175 ++++++++++++++++++++++++++ test/command/bits-title-supress.md | 122 ++++++++++++++++++ test/command/bits-toc-elements.md | 69 +++++++++++ 11 files changed, 1145 insertions(+) create mode 100644 test/command/8867.md create mode 100644 test/command/bits-book-meta.md create mode 100644 test/command/bits-book-part-wrapper-meta.md create mode 100644 test/command/bits-book-part-wrapper.md create mode 100644 test/command/bits-book.md create mode 100644 test/command/bits-index-elements.md create mode 100644 test/command/bits-legend.md create mode 100644 test/command/bits-named-boook-parts.md create mode 100644 test/command/bits-title-display-as.md create mode 100644 test/command/bits-title-supress.md create mode 100644 test/command/bits-toc-elements.md (limited to 'test/command') diff --git a/test/command/8867.md b/test/command/8867.md new file mode 100644 index 000000000..f5a5a901f --- /dev/null +++ b/test/command/8867.md @@ -0,0 +1,49 @@ +``` +% pandoc -f jats -t native -s + + + + + + © 2023, Ellerman et al + 2023 + Ellerman et al + + https://creativecommons.org/licenses/by/4.0/ + This document is distributed under a Creative Commons Attribution 4.0 International license. + + + +^D +Pandoc + Meta + { unMeta = + fromList + [ ( "copyright" + , MetaMap + (fromList + [ ( "holder" , MetaString "Ellerman et al" ) + , ( "statement" + , MetaString "\169 2023, Ellerman et al" + ) + , ( "year" , MetaString "2023" ) + ]) + ) + , ( "license" + , MetaMap + (fromList + [ ( "link" + , MetaString + "https://creativecommons.org/licenses/by/4.0/" + ) + , ( "text" + , MetaString + "This document is distributed under a Creative Commons Attribution 4.0 International license." + ) + , ( "type" , MetaString "open-access" ) + ]) + ) + ] + } + [] +``` \ No newline at end of file diff --git a/test/command/bits-book-meta.md b/test/command/bits-book-meta.md new file mode 100644 index 000000000..53a64c7d7 --- /dev/null +++ b/test/command/bits-book-meta.md @@ -0,0 +1,104 @@ +``` +% pandoc -f jats -t native -s + + + handbook-648 + + The NCBI Handbook + + + + McEntyre + Jo + + + + Ostell + Jim + + + + + National Center for Biotechnology Information (NCBI), National Library of Medicine, National Institutes of Health, Bethesda, MD 20892-6510 + + + 11 + 2002 + + + National Center for Biotechnology Information (NCBI), National Library of Medicine, National Institutes of Health + Bethesda, MD + + 1 + + + + + + + + + + +^D +Pandoc + Meta + { unMeta = + fromList + [ ( "author" + , MetaList + [ MetaInlines [ Str "Jo" , Space , Str "McEntyre" ] ] + ) + , ( "date" , MetaInlines [ Str "2002-11" ] ) + , ( "institute" + , MetaList + [ MetaInlines + [ Str "National" + , Space + , Str "Center" + , Space + , Str "for" + , Space + , Str "Biotechnology" + , Space + , Str "Information" + , Space + , Str "(NCBI)," + , Space + , Str "National" + , Space + , Str "Library" + , Space + , Str "of" + , Space + , Str "Medicine," + , Space + , Str "National" + , Space + , Str "Institutes" + , Space + , Str "of" + , Space + , Str "Health," + , Space + , Str "Bethesda," + , Space + , Str "MD" + , Space + , Str "20892-6510" + ] + ] + ) + , ( "title" + , MetaInlines + [ Str "The" + , Space + , Str "NCBI" + , Space + , Str "Handbook" + ] + ) + ] + } + [] +``` \ No newline at end of file diff --git a/test/command/bits-book-part-wrapper-meta.md b/test/command/bits-book-part-wrapper-meta.md new file mode 100644 index 000000000..33f932068 --- /dev/null +++ b/test/command/bits-book-part-wrapper-meta.md @@ -0,0 +1,95 @@ +``` +% pandoc -f jats -t native -s + + + + + Balisage Series on Markup Technologies + + + +

The Balisage Series on Markup Technologies + is an occasional series...

+
+
+ + + + Proceedings of Balisage: The Markup Conference + 2013 + + + +

Balisage is a peer-reviewed conference...

+ +
+
+^D +Pandoc + Meta + { unMeta = + fromList + [ ( "abstract" + , MetaBlocks + [ Para + [ Str "Balisage" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "peer-reviewed" + , Space + , Str "conference..." + ] + ] + ) + , ( "title" + , MetaInlines + [ Str "Proceedings" + , Space + , Str "of" + , Space + , Str "Balisage:" + , Space + , Str "The" + , Space + , Str "Markup" + , Space + , Str "Conference" + , SoftBreak + , Str "2013" + ] + ) + ] + } + [ Para + [ Str "The" + , Space + , Emph + [ Str "Balisage" + , Space + , Str "Series" + , Space + , Str "on" + , Space + , Str "Markup" + , Space + , Str "Technologies" + ] + , SoftBreak + , Str "is" + , Space + , Str "an" + , Space + , Str "occasional" + , Space + , Str "series..." + ] + ] +``` \ No newline at end of file diff --git a/test/command/bits-book-part-wrapper.md b/test/command/bits-book-part-wrapper.md new file mode 100644 index 000000000..206ad951c --- /dev/null +++ b/test/command/bits-book-part-wrapper.md @@ -0,0 +1,149 @@ +``` +% pandoc -f jats -t native + + + + + Balisage Series on Markup Technologies + + + +

The Balisage Series on Markup Technologies + is an occasional series...

+
+
+ + + + Proceedings of Balisage: The Markup Conference + 2013 + + + +

Balisage is a peer-reviewed conference...

+ +
+ + + + + + The Databases + + + + + History +

Initially, GenBank was built and maintained at Los Alamos + National Laboratory.

+
+ + + Back matter of book part + + References + + + + + + Olson + M + + + Hood + L + + + Cantor + C + + + Botstein + D + + + A common language for physical mapping of the human genome + Science + 1989 + 245 + 4925 + 1434 + 1435 + 2781285 + + + + +
+
+^D +[ Para + [ Str "The" + , Space + , Emph + [ Str "Balisage" + , Space + , Str "Series" + , Space + , Str "on" + , Space + , Str "Markup" + , Space + , Str "Technologies" + ] + , SoftBreak + , Str "is" + , Space + , Str "an" + , Space + , Str "occasional" + , Space + , Str "series..." + ] +, Header 2 ( "bid.3" , [] , [] ) [ Str "History" ] +, Para + [ Str "Initially," + , Space + , Str "GenBank" + , Space + , Str "was" + , Space + , Str "built" + , Space + , Str "and" + , Space + , Str "maintained" + , Space + , Str "at" + , Space + , Str "Los" + , Space + , Str "Alamos" + , SoftBreak + , Str "National" + , Space + , Str "Laboratory." + ] +, Header + 2 + ( "" , [] , [] ) + [ Str "Back" + , Space + , Str "matter" + , Space + , Str "of" + , Space + , Str "book" + , Space + , Str "part" + ] +, Header 1 ( "" , [] , [] ) [ Str "References" ] +, Div ( "refs" , [] , [] ) [] +] +``` \ No newline at end of file diff --git a/test/command/bits-book.md b/test/command/bits-book.md new file mode 100644 index 000000000..6515d35ee --- /dev/null +++ b/test/command/bits-book.md @@ -0,0 +1,186 @@ +``` +% pandoc -f jats -t native + + + + + + About this book + + + + + The NCBI Handbook +

Bioinformatics consists of a computational approach + to biomedical information management and analysis.

+
+
+
+
+ + + + + + The Databases + + + + + History +

Initially, GenBank was built and maintained at Los Alamos + National Laboratory.

+
+ + + Back matter of book part + + References + + + + + + Olson + M + + + Hood + L + + + Cantor + C + + + Botstein + D + + + A common language for physical mapping of the human genome + Science + 1989 + 245 + 4925 + 1434 + 1435 + 2781285 + + + + +
+
+ + + Acknowledgments +

We gratefully acknowledge the work of Vladimir Soussov, + as well as the entire NCBI Entrez team...

+
+
+
+^D +[ Header + 2 + ( "" , [] , [] ) + [ Str "The" , Space , Str "NCBI" , Space , Str "Handbook" ] +, Para + [ Str "Bioinformatics" + , Space + , Str "consists" + , Space + , Str "of" + , Space + , Str "a" + , Space + , Str "computational" + , Space + , Str "approach" + , SoftBreak + , Str "to" + , Space + , Str "biomedical" + , Space + , Str "information" + , Space + , Str "management" + , Space + , Str "and" + , Space + , Str "analysis." + ] +, Header 2 ( "bid.3" , [] , [] ) [ Str "History" ] +, Para + [ Str "Initially," + , Space + , Str "GenBank" + , Space + , Str "was" + , Space + , Str "built" + , Space + , Str "and" + , Space + , Str "maintained" + , Space + , Str "at" + , Space + , Str "Los" + , Space + , Str "Alamos" + , SoftBreak + , Str "National" + , Space + , Str "Laboratory." + ] +, Header + 2 + ( "" , [] , [] ) + [ Str "Back" + , Space + , Str "matter" + , Space + , Str "of" + , Space + , Str "book" + , Space + , Str "part" + ] +, Header 1 ( "" , [] , [] ) [ Str "References" ] +, Div ( "refs" , [] , [] ) [] +, Header 2 ( "bid.394" , [] , [] ) [ Str "Acknowledgments" ] +, Para + [ Str "We" + , Space + , Str "gratefully" + , Space + , Str "acknowledge" + , Space + , Str "the" + , Space + , Str "work" + , Space + , Str "of" + , Space + , Str "Vladimir" + , Space + , Str "Soussov," + , SoftBreak + , Str "as" + , Space + , Str "well" + , Space + , Str "as" + , Space + , Str "the" + , Space + , Str "entire" + , Space + , Str "NCBI" + , Space + , Str "Entrez" + , Space + , Str "team..." + ] +] +``` \ No newline at end of file diff --git a/test/command/bits-index-elements.md b/test/command/bits-index-elements.md new file mode 100644 index 000000000..6ba03cc38 --- /dev/null +++ b/test/command/bits-index-elements.md @@ -0,0 +1,83 @@ +``` +% pandoc -f jats -t native + + + Index group + +

Content of index group

+ + + Index + +

Content of index

+ + + N + +

Content of index div

+ + Navy + . + Armed forces + . + + + Necessary and proper clause, congressional power + + + Newsgathering as commerce + +
+
+
+^D +[ Header + 1 ( "" , [] , [] ) [ Str "Index" , Space , Str "group" ] +, Para + [ Str "Content" + , Space + , Str "of" + , Space + , Str "index" + , Space + , Str "group" + ] +, Header 2 ( "" , [] , [] ) [ Str "Index" ] +, Para + [ Str "Content" , Space , Str "of" , Space , Str "index" ] +, Header 3 ( "" , [] , [] ) [ Str "N" ] +, Para + [ Str "Content" + , Space + , Str "of" + , Space + , Str "index" + , Space + , Str "div" + ] +, Plain [ Str "Navy" ] +, Plain [ Str "." ] +, Plain [ Str "Armed" , Space , Str "forces" ] +, Plain [ Str "." ] +, Plain + [ Str "Necessary" + , Space + , Str "and" + , Space + , Str "proper" + , Space + , Str "clause," + , Space + , Str "congressional" + , Space + , Str "power" + ] +, Plain + [ Str "Newsgathering" + , Space + , Str "as" + , Space + , Str "commerce" + ] +] +``` \ No newline at end of file diff --git a/test/command/bits-legend.md b/test/command/bits-legend.md new file mode 100644 index 000000000..0217e68fe --- /dev/null +++ b/test/command/bits-legend.md @@ -0,0 +1,45 @@ +``` +% pandoc -f jats -t native + + + + Field of Application + + + Key + + + I +

input

+
+ + O +

output

+
+ ... +
+
+ +
+^D +[ Figure + ( "fig_A.1" , [] , [] ) + (Caption + Nothing + [ Plain + [ Str "Field" + , Space + , Str "of" + , Space + , Str "Application" + ] + ]) + [ Header 1 ( "" , [] , [] ) [ Str "Key" ] + , DefinitionList + [ ( [ Str "I" ] , [ [ Para [ Str "input" ] ] ] ) + , ( [ Str "O" ] , [ [ Para [ Str "output" ] ] ] ) + ] + , Para [ Image ( "" , [] , [] ) [] ( "1234" , "" ) ] + ] +] +``` \ No newline at end of file diff --git a/test/command/bits-named-boook-parts.md b/test/command/bits-named-boook-parts.md new file mode 100644 index 000000000..8a879423e --- /dev/null +++ b/test/command/bits-named-boook-parts.md @@ -0,0 +1,68 @@ +``` +% pandoc -f jats -t native + + +

This is the dedication text.

+
+
+^D +[ Header 1 ( "" , [] , [] ) [ Str "Dedication" ] +, Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "the" + , Space + , Str "dedication" + , Space + , Str "text." + ] +] +``` + +``` +% pandoc -f jats -t native + + +

This is the foreword text.

+
+
+^D +[ Header 1 ( "" , [] , [] ) [ Str "Foreword" ] +, Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "the" + , Space + , Str "foreword" + , Space + , Str "text." + ] +] +``` + +``` +% pandoc -f jats -t native + + +

This is the preface text.

+
+
+^D +[ Header 1 ( "" , [] , [] ) [ Str "Preface" ] +, Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "the" + , Space + , Str "preface" + , Space + , Str "text." + ] +] +``` \ No newline at end of file diff --git a/test/command/bits-title-display-as.md b/test/command/bits-title-display-as.md new file mode 100644 index 000000000..88bec9bc0 --- /dev/null +++ b/test/command/bits-title-display-as.md @@ -0,0 +1,175 @@ +``` +% pandoc -f jats -t native + + THE EUROPEAN UNION EXPLAINED + +^D +[ Header + 1 + ( "" , [] , [] ) + [ Str "THE" + , Space + , Str "EUROPEAN" + , Space + , Str "UNION" + , Space + , Str "EXPLAINED" + ] +] +``` + +``` +% pandoc -f jats -t native + + THE EUROPEAN UNION EXPLAINED + +^D +[ Header + 3 + ( "" , [] , [] ) + [ Str "THE" + , Space + , Str "EUROPEAN" + , Space + , Str "UNION" + , Space + , Str "EXPLAINED" + ] +] +``` + +``` +% pandoc -f jats -t native + + + The European Parliament +

Members of the European Parliament (MEPs) are directly elected by EU citizens.

+ + Composition of the European Parliament +

The seats in the European Parliament are allocated among the Member States.

+
+ + Composition of the European Parliament - II +

Most MEPs are associated with a national political party in their home country.

+
+
+ +^D +[ Header + 1 + ( "" , [] , [] ) + [ Str "The" + , Space + , Str "European" + , Space + , Str "Parliament" + ] +, Para + [ Str "Members" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "European" + , Space + , Str "Parliament" + , Space + , Str "(MEPs)" + , Space + , Str "are" + , Space + , Str "directly" + , Space + , Str "elected" + , Space + , Str "by" + , Space + , Str "EU" + , Space + , Str "citizens." + ] +, Header + 3 + ( "" , [] , [] ) + [ Str "Composition" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "European" + , Space + , Str "Parliament" + ] +, Para + [ Str "The" + , Space + , Str "seats" + , Space + , Str "in" + , Space + , Str "the" + , Space + , Str "European" + , Space + , Str "Parliament" + , Space + , Str "are" + , Space + , Str "allocated" + , Space + , Str "among" + , Space + , Str "the" + , Space + , Str "Member" + , Space + , Str "States." + ] +, Header + 2 + ( "" , [] , [] ) + [ Str "Composition" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "European" + , Space + , Str "Parliament" + , Space + , Str "-" + , Space + , Str "II" + ] +, Para + [ Str "Most" + , Space + , Str "MEPs" + , Space + , Str "are" + , Space + , Str "associated" + , Space + , Str "with" + , Space + , Str "a" + , Space + , Str "national" + , Space + , Str "political" + , Space + , Str "party" + , Space + , Str "in" + , Space + , Str "their" + , Space + , Str "home" + , Space + , Str "country." + ] +] +``` \ No newline at end of file diff --git a/test/command/bits-title-supress.md b/test/command/bits-title-supress.md new file mode 100644 index 000000000..e30841e10 --- /dev/null +++ b/test/command/bits-title-supress.md @@ -0,0 +1,122 @@ +``` +% pandoc -f jats -t native + + The European Parliament +

Members of the European Parliament (MEPs) are directly elected by EU citizens.

+
+^D +[ Header + 1 + ( "" , [] , [] ) + [ Str "The" + , Space + , Str "European" + , Space + , Str "Parliament" + ] +, Para + [ Str "Members" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "European" + , Space + , Str "Parliament" + , Space + , Str "(MEPs)" + , Space + , Str "are" + , Space + , Str "directly" + , Space + , Str "elected" + , Space + , Str "by" + , Space + , Str "EU" + , Space + , Str "citizens." + ] +] +``` + +``` +% pandoc -f jats -t native + + The European Parliament +

Members of the European Parliament (MEPs) are directly elected by EU citizens.

+
+^D +[ Header + 1 + ( "" , [] , [] ) + [ Str "The" + , Space + , Str "European" + , Space + , Str "Parliament" + ] +, Para + [ Str "Members" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "European" + , Space + , Str "Parliament" + , Space + , Str "(MEPs)" + , Space + , Str "are" + , Space + , Str "directly" + , Space + , Str "elected" + , Space + , Str "by" + , Space + , Str "EU" + , Space + , Str "citizens." + ] +] +``` + +``` +% pandoc -f jats -t native + + The European Parliament +

Members of the European Parliament (MEPs) are directly elected by EU citizens.

+
+^D +[ Para + [ Str "Members" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "European" + , Space + , Str "Parliament" + , Space + , Str "(MEPs)" + , Space + , Str "are" + , Space + , Str "directly" + , Space + , Str "elected" + , Space + , Str "by" + , Space + , Str "EU" + , Space + , Str "citizens." + ] +] +``` \ No newline at end of file diff --git a/test/command/bits-toc-elements.md b/test/command/bits-toc-elements.md new file mode 100644 index 000000000..415a255e1 --- /dev/null +++ b/test/command/bits-toc-elements.md @@ -0,0 +1,69 @@ +``` +% pandoc -f jats -t native + + + TOC group + +

Content of toc group

+ + + TOC + +

Content of TOC

+ + + Mental Health Services + + + + Introduction + + + + + Mental Health of the Population + + + +
+
+^D +[ Header + 1 ( "" , [] , [] ) [ Str "TOC" , Space , Str "group" ] +, Para + [ Str "Content" + , Space + , Str "of" + , Space + , Str "toc" + , Space + , Str "group" + ] +, Header 2 ( "" , [] , [] ) [ Str "TOC" ] +, Para + [ Str "Content" , Space , Str "of" , Space , Str "TOC" ] +, Header + 3 + ( "" , [] , [] ) + [ Str "Mental" + , Space + , Str "Health" + , Space + , Str "Services" + ] +, Header 4 ( "" , [] , [] ) [ Str "Introduction" ] +, Header + 4 + ( "" , [] , [] ) + [ Str "Mental" + , Space + , Str "Health" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "Population" + ] +] +``` \ No newline at end of file -- cgit v1.2.3