@manuscripts/transform 4.3.53 → 4.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/dist/cjs/jats/__tests__/jats-roundtrip.test.js +3 -3
  2. package/dist/cjs/version.js +1 -1
  3. package/dist/es/jats/__tests__/jats-roundtrip.test.js +3 -3
  4. package/dist/es/version.js +1 -1
  5. package/dist/types/jats/__tests__/utils.d.ts +1 -1
  6. package/dist/types/version.d.ts +1 -1
  7. package/package.json +22 -21
  8. package/src/errors.ts +28 -0
  9. package/src/getVersion.ts +21 -0
  10. package/src/index.ts +28 -0
  11. package/src/jats/__tests__/__fixtures__/debug-example.xml +136 -0
  12. package/src/jats/__tests__/__fixtures__/jats-abstract-no-body.xml +163 -0
  13. package/src/jats/__tests__/__fixtures__/jats-citations.xml +472 -0
  14. package/src/jats/__tests__/__fixtures__/jats-comments.xml +46 -0
  15. package/src/jats/__tests__/__fixtures__/jats-document.xml +134 -0
  16. package/src/jats/__tests__/__fixtures__/jats-example-doc.xml +1235 -0
  17. package/src/jats/__tests__/__fixtures__/jats-example-front-only.xml +26 -0
  18. package/src/jats/__tests__/__fixtures__/jats-example-full.xml +209 -0
  19. package/src/jats/__tests__/__fixtures__/jats-example-no-back.xml +156 -0
  20. package/src/jats/__tests__/__fixtures__/jats-example-no-body.xml +91 -0
  21. package/src/jats/__tests__/__fixtures__/jats-example.xml +221 -0
  22. package/src/jats/__tests__/__fixtures__/jats-fn-group.xml +60 -0
  23. package/src/jats/__tests__/__fixtures__/jats-import-no-refs.xml +1077 -0
  24. package/src/jats/__tests__/__fixtures__/jats-import.xml +1561 -0
  25. package/src/jats/__tests__/__fixtures__/jats-roundtrip.xml +133 -0
  26. package/src/jats/__tests__/__fixtures__/jats-tables-example.xml +2043 -0
  27. package/src/jats/__tests__/__fixtures__/math-fragment.xml +12 -0
  28. package/src/jats/__tests__/__snapshots__/citeproc.test.ts.snap +57 -0
  29. package/src/jats/__tests__/__snapshots__/create-article-node.test.ts.snap +65 -0
  30. package/src/jats/__tests__/__snapshots__/jats-exporter.test.ts.snap +7 -0
  31. package/src/jats/__tests__/__snapshots__/jats-importer.test.ts.snap +59605 -0
  32. package/src/jats/__tests__/__snapshots__/jats-roundtrip.test.ts.snap +18 -0
  33. package/src/jats/__tests__/citations.ts +25 -0
  34. package/src/jats/__tests__/citeproc.test.ts +195 -0
  35. package/src/jats/__tests__/create-article-node.test.ts +29 -0
  36. package/src/jats/__tests__/data/section-categories.ts +212 -0
  37. package/src/jats/__tests__/files.ts +24 -0
  38. package/src/jats/__tests__/jats-exporter.test.ts +223 -0
  39. package/src/jats/__tests__/jats-importer.test.ts +567 -0
  40. package/src/jats/__tests__/jats-roundtrip.test.ts +66 -0
  41. package/src/jats/__tests__/utils.ts +90 -0
  42. package/src/jats/exporter/citeproc.ts +265 -0
  43. package/src/jats/exporter/jats-exporter.ts +2090 -0
  44. package/src/jats/exporter/jats-versions.ts +50 -0
  45. package/src/jats/exporter/labels.ts +101 -0
  46. package/src/jats/importer/create-article-node.ts +52 -0
  47. package/src/jats/importer/jats-comments.ts +111 -0
  48. package/src/jats/importer/jats-dom-parser.ts +1260 -0
  49. package/src/jats/importer/jats-parser-utils.ts +234 -0
  50. package/src/jats/importer/jats-transformations.ts +591 -0
  51. package/src/jats/importer/parse-jats-article.ts +106 -0
  52. package/src/jats/index.ts +21 -0
  53. package/src/jats/types.ts +16 -0
  54. package/src/lib/__tests__/footnotes.test.ts +36 -0
  55. package/src/lib/citeproc.ts +30 -0
  56. package/src/lib/credit-roles.ts +91 -0
  57. package/src/lib/deafults.ts +17 -0
  58. package/src/lib/footnotes.ts +85 -0
  59. package/src/lib/html.ts +56 -0
  60. package/src/lib/section-categories.ts +27 -0
  61. package/src/lib/utils.ts +145 -0
  62. package/src/lib/xml.ts +28 -0
  63. package/src/schema/__tests__/docs.ts +1911 -0
  64. package/src/schema/__tests__/groups.test.ts +61 -0
  65. package/src/schema/__tests__/migration.test.ts +23 -0
  66. package/src/schema/groups.ts +36 -0
  67. package/src/schema/index.ts +286 -0
  68. package/src/schema/marks.ts +254 -0
  69. package/src/schema/migration/migrate.ts +77 -0
  70. package/src/schema/migration/migration-script.ts +26 -0
  71. package/src/schema/migration/migration-scripts/1.2.5.ts +44 -0
  72. package/src/schema/migration/migration-scripts/2.3.22.ts +52 -0
  73. package/src/schema/migration/migration-scripts/3.0.12.ts +33 -0
  74. package/src/schema/migration/migration-scripts/3.0.21.ts +50 -0
  75. package/src/schema/migration/migration-scripts/3.0.30.ts +65 -0
  76. package/src/schema/migration/migration-scripts/3.0.31.ts +40 -0
  77. package/src/schema/migration/migration-scripts/3.0.41.ts +37 -0
  78. package/src/schema/migration/migration-scripts/3.0.55.ts +42 -0
  79. package/src/schema/migration/migration-scripts/3.0.56.ts +114 -0
  80. package/src/schema/migration/migration-scripts/4.2.13.ts +37 -0
  81. package/src/schema/migration/migration-scripts/4.2.15.ts +48 -0
  82. package/src/schema/migration/migration-scripts/4.3.23.ts +55 -0
  83. package/src/schema/migration/migration-scripts/4.3.34.ts +132 -0
  84. package/src/schema/migration/migration-scripts/4.3.35.ts +41 -0
  85. package/src/schema/migration/migration-scripts/index.ts +49 -0
  86. package/src/schema/nodes/abstracts.ts +29 -0
  87. package/src/schema/nodes/affiliation.ts +88 -0
  88. package/src/schema/nodes/affiliations.ts +30 -0
  89. package/src/schema/nodes/alt_text.ts +36 -0
  90. package/src/schema/nodes/alt_title.ts +40 -0
  91. package/src/schema/nodes/alt_titles_section.ts +58 -0
  92. package/src/schema/nodes/attachment.ts +46 -0
  93. package/src/schema/nodes/attachments.ts +45 -0
  94. package/src/schema/nodes/attribution.ts +38 -0
  95. package/src/schema/nodes/author_notes.ts +44 -0
  96. package/src/schema/nodes/award.ts +52 -0
  97. package/src/schema/nodes/awards.ts +45 -0
  98. package/src/schema/nodes/backmatter.ts +31 -0
  99. package/src/schema/nodes/bibliography_element.ts +58 -0
  100. package/src/schema/nodes/bibliography_item.ts +108 -0
  101. package/src/schema/nodes/bibliography_section.ts +60 -0
  102. package/src/schema/nodes/blockquote_element.ts +79 -0
  103. package/src/schema/nodes/body.ts +29 -0
  104. package/src/schema/nodes/box_element.ts +67 -0
  105. package/src/schema/nodes/caption.ts +67 -0
  106. package/src/schema/nodes/caption_title.ts +67 -0
  107. package/src/schema/nodes/citation.ts +70 -0
  108. package/src/schema/nodes/comment.ts +50 -0
  109. package/src/schema/nodes/comments.ts +28 -0
  110. package/src/schema/nodes/contributor.ts +87 -0
  111. package/src/schema/nodes/contributors.ts +40 -0
  112. package/src/schema/nodes/core_section.ts +27 -0
  113. package/src/schema/nodes/corresp.ts +49 -0
  114. package/src/schema/nodes/cross_reference.ts +64 -0
  115. package/src/schema/nodes/doc.ts +21 -0
  116. package/src/schema/nodes/embed.ts +55 -0
  117. package/src/schema/nodes/equation.ts +65 -0
  118. package/src/schema/nodes/equation_element.ts +61 -0
  119. package/src/schema/nodes/figure.ts +65 -0
  120. package/src/schema/nodes/figure_element.ts +73 -0
  121. package/src/schema/nodes/footnote.ts +95 -0
  122. package/src/schema/nodes/footnotes_element.ts +69 -0
  123. package/src/schema/nodes/footnotes_section.ts +61 -0
  124. package/src/schema/nodes/general_table_footnote.ts +42 -0
  125. package/src/schema/nodes/graphical_abstract_section.ts +62 -0
  126. package/src/schema/nodes/hard_break.ts +36 -0
  127. package/src/schema/nodes/hero_image.ts +46 -0
  128. package/src/schema/nodes/highlight_marker.ts +68 -0
  129. package/src/schema/nodes/image_element.ts +49 -0
  130. package/src/schema/nodes/inline_equation.ts +68 -0
  131. package/src/schema/nodes/inline_footnote.ts +66 -0
  132. package/src/schema/nodes/keyword.ts +61 -0
  133. package/src/schema/nodes/keyword_group.ts +63 -0
  134. package/src/schema/nodes/keywords.ts +59 -0
  135. package/src/schema/nodes/keywords_element.ts +64 -0
  136. package/src/schema/nodes/link.ts +79 -0
  137. package/src/schema/nodes/list.ts +134 -0
  138. package/src/schema/nodes/listing.ts +91 -0
  139. package/src/schema/nodes/listing_element.ts +61 -0
  140. package/src/schema/nodes/long_desc.ts +36 -0
  141. package/src/schema/nodes/manuscript.ts +86 -0
  142. package/src/schema/nodes/missing_figure.ts +59 -0
  143. package/src/schema/nodes/paragraph.ts +77 -0
  144. package/src/schema/nodes/placeholder.ts +62 -0
  145. package/src/schema/nodes/placeholder_element.ts +60 -0
  146. package/src/schema/nodes/pullquote_element.ts +81 -0
  147. package/src/schema/nodes/quote_image.ts +64 -0
  148. package/src/schema/nodes/section.ts +69 -0
  149. package/src/schema/nodes/section_label.ts +39 -0
  150. package/src/schema/nodes/section_title.ts +58 -0
  151. package/src/schema/nodes/subtitle.ts +40 -0
  152. package/src/schema/nodes/subtitles.ts +51 -0
  153. package/src/schema/nodes/supplement.ts +77 -0
  154. package/src/schema/nodes/supplements.ts +60 -0
  155. package/src/schema/nodes/table.ts +144 -0
  156. package/src/schema/nodes/table_col.ts +76 -0
  157. package/src/schema/nodes/table_element.ts +67 -0
  158. package/src/schema/nodes/table_element_footer.ts +42 -0
  159. package/src/schema/nodes/text.ts +31 -0
  160. package/src/schema/nodes/title.ts +43 -0
  161. package/src/schema/nodes/trans_abstract.ts +58 -0
  162. package/src/schema/nodes/trans_graphical_abstract.ts +67 -0
  163. package/src/schema/types.ts +240 -0
  164. package/src/tests.ts +33 -0
  165. package/src/transformer/id.ts +23 -0
  166. package/src/transformer/index.ts +21 -0
  167. package/src/transformer/node-names.ts +73 -0
  168. package/src/transformer/node-title.ts +111 -0
  169. package/src/transformer/node-types.ts +39 -0
  170. package/src/transformer/node-validator.ts +82 -0
  171. package/src/types.ts +25 -0
  172. package/src/version.ts +1 -0
@@ -0,0 +1,133 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD with OASIS Tables with MathML3 v1.2 20190208//EN" "http://jats.nlm.nih.gov/archiving/1.2/JATS-archive-oasis-article1-mathml3.dtd">
3
+ <article xmlns:xlink="http://www.w3.org/1999/xlink" article-type="research-article">
4
+ <front>
5
+ <journal-meta>
6
+ <journal-id journal-id-type="nlm-ta">Human Psychopharmacology: Clinical and Experimental</journal-id>
7
+ <journal-title-group>
8
+ <journal-title>Human Psychopharmacology: Clinical and Experimental</journal-title>
9
+ <abbrev-journal-title abbrev-type="pubmed">Human Psychopharmacology: Clinical and Experimental</abbrev-journal-title>
10
+ </journal-title-group>
11
+ <issn pub-type="ppub">0885-6222</issn>
12
+ <issn pub-type="epub">1540-1235</issn>
13
+ <publisher>
14
+ <publisher-name>John Wiley and Sons</publisher-name>
15
+ </publisher>
16
+ </journal-meta>
17
+ <article-meta>
18
+ <article-id pub-id-type="publisher-id">HUP-19-0076</article-id>
19
+ <title-group>
20
+ <article-title>A complete manuscript</article-title>
21
+ </title-group>
22
+ <contrib-group>
23
+ <contrib contrib-type="author">
24
+ <name>
25
+ <surname>Macintosh</surname>
26
+ <given-names>Alfred</given-names>
27
+ </name>
28
+ <email xlink:href="macintosh@hotmail.com">flinserl@hotmail.com</email>
29
+ <xref ref-type="aff" rid="EDN3-2020-0111-aff3">
30
+ <sup>3</sup>
31
+ </xref>
32
+ </contrib>
33
+ <contrib contrib-type="author" corresp="yes">
34
+ <name>
35
+ <surname>Adam</surname>
36
+ <given-names>Rein</given-names>
37
+ </name>
38
+ <email xlink:href="adam.brys@some.be">rein.brys@inbo.be</email>
39
+ </contrib>
40
+ </contrib-group>
41
+ <author-notes>
42
+ <corresp id="EDN3-2020-0111-cor1">Corresponding authors, John Macintosh:
43
+ <email xlink:href="macintosh@hotmail.com">macintosh@hotmail.com</email>, ORCID 0000-0003-1215-2987, Adam Brys:
44
+ <email xlink:href="adam.brys@some.be">adam.brys@some.be</email>, ORCID 0000-0002-0688-3268
45
+ </corresp>
46
+ <fn fn-type="con">
47
+ <p content-type="fn-title">Author contributions</p>
48
+ <p>JM and AB wrote the manuscript. All co-authors provided comments and helped revising the manuscript.</p>
49
+ </fn>
50
+ <fn fn-type="abbr">
51
+ <p content-type="fn-title">Abbreviations</p>
52
+ <p>In this story, the Galactic Exploration Unit (GEU) plays a crucial role in interstellar diplomacy and scientific discovery.</p>
53
+ </fn>
54
+ <p>rana nofal testing</p>
55
+ </author-notes>
56
+ </article-meta>
57
+ </front>
58
+ <body>
59
+ <sec id="MPSection_2E0A7E51-F531-47C3-B585-AA86506D3DE4">
60
+ <title>Figures</title>
61
+ <fig id="MPFigure_035B52CA-C486-4AC1-B44E-40F36F422686" fig-type="half-left">
62
+ <label>label</label>
63
+ <caption>
64
+ <title>Caption title</title>
65
+ <p>Test1</p>
66
+ <p>Test2</p>
67
+ </caption>
68
+ <p>A paragraph</p>
69
+ <graphic xlink:href="graphic/111111.jpeg"/>
70
+ <graphic xlink:href="graphic/222222.jpeg" specific-use="MISSING" />
71
+ <graphic xlink:href="graphic/333333.jpeg"/>
72
+ <attrib>Source: Wikipedia.</attrib>
73
+ </fig>
74
+ </sec>
75
+ </body>
76
+ <back>
77
+ <fn-group>
78
+ <fn fn-type="financial-disclosure">
79
+ <p content-type="fn-title">FUNDING INFORMATION</p>
80
+ <p>This work was supported by the National Natural Science Foundation of China (81771439), Jiangsu Provincial Key
81
+ <xref ref-type="bibr" rid="HUP-19-0076-bib-0001">1</xref>Research and Development Program (BE2020661 and BE2018662), Jiangsu Provincial Health Commission Science Research Program (QNRC2016228, H2019056 and LGY2018010), Jiangsu Provincial Six Talent Peaks Project (WSN-165), Suzhou Municipal Health Commission Science Research Program (SZYJTD201715, LCZX201820, Kjxw2018048 and Gwzx201801), Suzhou Municipal Sci-Tech Bureau Program (SZS201722, SS201706, SYS2019113 and SS2019009), and CAS Key Laboratory of Mental Health, Institute of Psychology (KLMH2019K03).
82
+ </p>
83
+ </fn>
84
+ </fn-group>
85
+ <ref-list>
86
+ <title>References</title>
87
+ <ref id="HUP-19-0076-bib-0001">
88
+ <element-citation publication-type="journal">
89
+ <person-group person-group-type="author">
90
+ <string-name>
91
+ <surname>Caldwell</surname>
92
+ <given-names>C.B.</given-names>
93
+ </string-name>
94
+ <string-name>
95
+ <surname>Gottesman</surname>
96
+ <given-names>I.I.</given-names>
97
+ </string-name>
98
+ </person-group>
99
+ <year>1992</year>
100
+ <article-title>Schizophrenia-a high-risk factor for suicide: clues to risk reduction.</article-title>
101
+ <source>Suicide Life Threat Behav.</source>
102
+ <volume>22</volume>
103
+ <issue>4</issue>
104
+ <fpage>479</fpage>
105
+ <lpage>493</lpage>
106
+ </element-citation>
107
+ </ref>
108
+ <ref id="HUP-19-0076-bib-0002">
109
+ <element-citation publication-type="journal">
110
+ <person-group person-group-type="author">
111
+ <string-name>
112
+ <surname>Hor</surname>
113
+ <given-names>K.</given-names>
114
+ </string-name>
115
+ <string-name>
116
+ <surname>Taylor</surname>
117
+ <given-names>M.</given-names>
118
+ </string-name>
119
+ </person-group>
120
+ <year>2010</year>
121
+ <article-title>Suicide and schizophrenia: a systematic review of rates and risk factors.</article-title>
122
+ <source>J Psychopharmacol.</source>
123
+ <volume>24</volume>
124
+ <issue>4</issue>
125
+ <supplement>Suppl</supplement>
126
+ <fpage>81</fpage>
127
+ <lpage>90</lpage>
128
+ <pub-id pub-id-type="doi">https://doi.org/10.1177/1359786810385490</pub-id>
129
+ </element-citation>
130
+ </ref>
131
+ </ref-list>
132
+ </back>
133
+ </article>