metanorma-standoc 1.10.4.1 → 1.10.8
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.
- checksums.yaml +4 -4
- data/README.adoc +19 -23
- data/lib/asciidoctor/standoc/base.rb +11 -13
- data/lib/asciidoctor/standoc/basicdoc.rng +21 -4
- data/lib/asciidoctor/standoc/blocks.rb +27 -22
- data/lib/asciidoctor/standoc/blocks_notes.rb +17 -22
- data/lib/asciidoctor/standoc/cleanup.rb +38 -71
- data/lib/asciidoctor/standoc/cleanup_block.rb +5 -70
- data/lib/asciidoctor/standoc/cleanup_image.rb +6 -7
- data/lib/asciidoctor/standoc/cleanup_inline.rb +27 -98
- data/lib/asciidoctor/standoc/cleanup_maths.rb +113 -21
- data/lib/asciidoctor/standoc/cleanup_ref.rb +5 -0
- data/lib/asciidoctor/standoc/cleanup_reqt.rb +56 -18
- data/lib/asciidoctor/standoc/cleanup_section.rb +1 -0
- data/lib/asciidoctor/standoc/cleanup_section_names.rb +31 -14
- data/lib/asciidoctor/standoc/cleanup_table.rb +68 -0
- data/lib/asciidoctor/standoc/cleanup_terms.rb +1 -1
- data/lib/asciidoctor/standoc/cleanup_text.rb +73 -0
- data/lib/asciidoctor/standoc/cleanup_xref.rb +107 -0
- data/lib/asciidoctor/standoc/converter.rb +13 -0
- data/lib/asciidoctor/standoc/isodoc.rng +241 -61
- data/lib/asciidoctor/standoc/lists.rb +15 -15
- data/lib/asciidoctor/standoc/macros.rb +14 -43
- data/lib/asciidoctor/standoc/macros_note.rb +45 -0
- data/lib/asciidoctor/standoc/macros_terms.rb +33 -15
- data/lib/asciidoctor/standoc/reqt.rb +2 -2
- data/lib/asciidoctor/standoc/reqt.rng +23 -2
- data/lib/asciidoctor/standoc/table.rb +22 -20
- data/lib/asciidoctor/standoc/terms.rb +9 -1
- data/lib/asciidoctor/standoc/validate.rb +23 -14
- data/lib/asciidoctor/standoc/validate_section.rb +5 -2
- data/lib/metanorma/standoc/version.rb +1 -1
- data/metanorma-standoc.gemspec +1 -1
- data/spec/asciidoctor/base_spec.rb +0 -33
- data/spec/asciidoctor/blank_spec.rb +37 -0
- data/spec/asciidoctor/blocks_spec.rb +151 -30
- data/spec/asciidoctor/cleanup_blocks_spec.rb +1018 -0
- data/spec/asciidoctor/cleanup_sections_spec.rb +207 -0
- data/spec/asciidoctor/cleanup_spec.rb +193 -1078
- data/spec/asciidoctor/inline_spec.rb +36 -0
- data/spec/asciidoctor/isobib_cache_spec.rb +8 -8
- data/spec/asciidoctor/lists_spec.rb +6 -6
- data/spec/asciidoctor/macros_plantuml_spec.rb +1 -1
- data/spec/asciidoctor/macros_spec.rb +41 -26
- data/spec/asciidoctor/refs_dl_spec.rb +1 -1
- data/spec/asciidoctor/refs_spec.rb +220 -444
- data/spec/asciidoctor/section_spec.rb +1 -1
- data/spec/asciidoctor/validate_spec.rb +51 -0
- data/spec/assets/xref_error.adoc +1 -0
- data/spec/fixtures/datamodel_description_sections_tree.xml +24 -24
- data/spec/spec_helper.rb +5 -7
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +231 -143
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec1.yml +152 -0
- data/spec/vcr_cassettes/isobib_get_123.yml +52 -36
- data/spec/vcr_cassettes/isobib_get_123_1.yml +103 -71
- data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +112 -80
- data/spec/vcr_cassettes/isobib_get_123_2001.yml +50 -34
- data/spec/vcr_cassettes/isobib_get_124.yml +51 -35
- data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +16 -16
- data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +70 -46
- metadata +11 -4
@@ -1588,4 +1588,211 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1588
1588
|
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1589
1589
|
.to be_equivalent_to xmlpp(output)
|
1590
1590
|
end
|
1591
|
+
|
1592
|
+
it "adds variant titles" do
|
1593
|
+
input = <<~INPUT
|
1594
|
+
#{ASCIIDOC_BLANK_HDR}
|
1595
|
+
|
1596
|
+
== Clause
|
1597
|
+
Text
|
1598
|
+
|
1599
|
+
=== Subclause
|
1600
|
+
|
1601
|
+
[.variant-title,type=toc]
|
1602
|
+
Clause _A_ stem:[x]
|
1603
|
+
|
1604
|
+
[.variant-title,type=sub]
|
1605
|
+
"A" 'B'
|
1606
|
+
|
1607
|
+
Text
|
1608
|
+
|
1609
|
+
[appendix]
|
1610
|
+
== Clause
|
1611
|
+
|
1612
|
+
[.variant-title,type=toc]
|
1613
|
+
Clause _A_ stem:[y]
|
1614
|
+
|
1615
|
+
Text
|
1616
|
+
INPUT
|
1617
|
+
output = <<~OUTPUT
|
1618
|
+
#{BLANK_HDR}
|
1619
|
+
<sections>
|
1620
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
1621
|
+
<title>Clause</title>
|
1622
|
+
<p id='_'>Text</p>
|
1623
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
1624
|
+
<title>Subclause</title>
|
1625
|
+
<variant-title type='sub'>“A” ‘B’</variant-title>
|
1626
|
+
<variant-title type='toc'>
|
1627
|
+
Clause
|
1628
|
+
<em>A</em>
|
1629
|
+
<stem type='MathML'>
|
1630
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1631
|
+
<mi>x</mi>
|
1632
|
+
</math>
|
1633
|
+
</stem>
|
1634
|
+
</variant-title>
|
1635
|
+
<p id='_'>Text</p>
|
1636
|
+
</clause>
|
1637
|
+
</clause>
|
1638
|
+
</sections>
|
1639
|
+
<annex id='_' inline-header='false' obligation='normative'>
|
1640
|
+
<title>Clause</title>
|
1641
|
+
<variant-title type='toc'>
|
1642
|
+
Clause
|
1643
|
+
<em>A</em>
|
1644
|
+
<stem type='MathML'>
|
1645
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1646
|
+
<mi>y</mi>
|
1647
|
+
</math>
|
1648
|
+
</stem>
|
1649
|
+
</variant-title>
|
1650
|
+
<p id='_'>Text</p>
|
1651
|
+
</annex>
|
1652
|
+
</standard-document>
|
1653
|
+
OUTPUT
|
1654
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1655
|
+
.to be_equivalent_to xmlpp(output)
|
1656
|
+
end
|
1657
|
+
|
1658
|
+
it "processes TOC clause" do
|
1659
|
+
input = <<~INPUT
|
1660
|
+
#{ASCIIDOC_BLANK_HDR}
|
1661
|
+
|
1662
|
+
== Clause
|
1663
|
+
Text
|
1664
|
+
|
1665
|
+
[type=toc]
|
1666
|
+
=== Table of contents
|
1667
|
+
|
1668
|
+
Text at the start
|
1669
|
+
|
1670
|
+
==== Toc 1
|
1671
|
+
|
1672
|
+
* <<cl2>>
|
1673
|
+
** <<a1>>
|
1674
|
+
|
1675
|
+
==== Toc 2
|
1676
|
+
|
1677
|
+
* <<cl2,some text>>
|
1678
|
+
** <<a1,some more text>>
|
1679
|
+
|
1680
|
+
[[cl2]]
|
1681
|
+
== Clause2
|
1682
|
+
|
1683
|
+
[.variant-title,type=toc]
|
1684
|
+
Clause _A_ stem:[x]
|
1685
|
+
|
1686
|
+
[.variant-title,type=sub]
|
1687
|
+
"A" 'B'
|
1688
|
+
|
1689
|
+
Text
|
1690
|
+
|
1691
|
+
[[a1]]
|
1692
|
+
[appendix]
|
1693
|
+
== Clause
|
1694
|
+
|
1695
|
+
[.variant-title,type=toc]
|
1696
|
+
Clause _A_ stem:[y]
|
1697
|
+
|
1698
|
+
Text
|
1699
|
+
INPUT
|
1700
|
+
output = <<~OUTPUT
|
1701
|
+
#{BLANK_HDR}
|
1702
|
+
<sections>
|
1703
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
1704
|
+
<title>Clause</title>
|
1705
|
+
<p id='_'>Text</p>
|
1706
|
+
<clause id='_' type='toc' inline-header='false' obligation='normative'>
|
1707
|
+
<title>Table of contents</title>
|
1708
|
+
<p id='_'>Text at the start</p>
|
1709
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
1710
|
+
<title>Toc 1</title>
|
1711
|
+
<toc>
|
1712
|
+
<ul id='_'>
|
1713
|
+
<li>
|
1714
|
+
<p id='_'>
|
1715
|
+
<xref target='cl2'>
|
1716
|
+
Clause
|
1717
|
+
<em>A</em>
|
1718
|
+
<stem type='MathML'>
|
1719
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1720
|
+
<mi>x</mi>
|
1721
|
+
</math>
|
1722
|
+
</stem>
|
1723
|
+
</xref>
|
1724
|
+
</p>
|
1725
|
+
<ul id='_'>
|
1726
|
+
<li>
|
1727
|
+
<p id='_'>
|
1728
|
+
<xref target='a1'>
|
1729
|
+
Clause
|
1730
|
+
<em>A</em>
|
1731
|
+
<stem type='MathML'>
|
1732
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1733
|
+
<mi>y</mi>
|
1734
|
+
</math>
|
1735
|
+
</stem>
|
1736
|
+
</xref>
|
1737
|
+
</p>
|
1738
|
+
</li>
|
1739
|
+
</ul>
|
1740
|
+
</li>
|
1741
|
+
</ul>
|
1742
|
+
</toc>
|
1743
|
+
</clause>
|
1744
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
1745
|
+
<title>Toc 2</title>
|
1746
|
+
<toc>
|
1747
|
+
<ul id='_'>
|
1748
|
+
<li>
|
1749
|
+
<p id='_'>
|
1750
|
+
<xref target='cl2'>some text</xref>
|
1751
|
+
</p>
|
1752
|
+
<ul id='_'>
|
1753
|
+
<li>
|
1754
|
+
<p id='_'>
|
1755
|
+
<xref target='a1'>some more text</xref>
|
1756
|
+
</p>
|
1757
|
+
</li>
|
1758
|
+
</ul>
|
1759
|
+
</li>
|
1760
|
+
</ul>
|
1761
|
+
</toc>
|
1762
|
+
</clause>
|
1763
|
+
</clause>
|
1764
|
+
</clause>
|
1765
|
+
<clause id='cl2' inline-header='false' obligation='normative'>
|
1766
|
+
<title>Clause2</title>
|
1767
|
+
<variant-title type='sub'>“A” ‘B’</variant-title>
|
1768
|
+
<variant-title type='toc'>
|
1769
|
+
Clause
|
1770
|
+
<em>A</em>
|
1771
|
+
<stem type='MathML'>
|
1772
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1773
|
+
<mi>x</mi>
|
1774
|
+
</math>
|
1775
|
+
</stem>
|
1776
|
+
</variant-title>
|
1777
|
+
<p id='_'>Text</p>
|
1778
|
+
</clause>
|
1779
|
+
</sections>
|
1780
|
+
<annex id='a1' inline-header='false' obligation='normative'>
|
1781
|
+
<title>Clause</title>
|
1782
|
+
<variant-title type='toc'>
|
1783
|
+
Clause
|
1784
|
+
<em>A</em>
|
1785
|
+
<stem type='MathML'>
|
1786
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1787
|
+
<mi>y</mi>
|
1788
|
+
</math>
|
1789
|
+
</stem>
|
1790
|
+
</variant-title>
|
1791
|
+
<p id='_'>Text</p>
|
1792
|
+
</annex>
|
1793
|
+
</standard-document>
|
1794
|
+
OUTPUT
|
1795
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1796
|
+
.to be_equivalent_to xmlpp(output)
|
1797
|
+
end
|
1591
1798
|
end
|