isodoc 1.8.4 → 2.0.2
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/.github/workflows/rake.yml +3 -31
- data/Gemfile +0 -1
- data/isodoc.gemspec +1 -1
- data/lib/isodoc/function/references.rb +32 -23
- data/lib/isodoc/function/section_titles.rb +22 -3
- data/lib/isodoc/function/utils.rb +1 -0
- data/lib/isodoc/html_function/postprocess.rb +9 -2
- data/lib/isodoc/presentation_function/bibdata.rb +0 -6
- data/lib/isodoc/presentation_function/section.rb +29 -7
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc/xref/xref_sect_gen.rb +7 -3
- data/spec/isodoc/blocks_spec.rb +3 -2
- data/spec/isodoc/postproc_spec.rb +28 -0
- data/spec/isodoc/presentation_xml_spec.rb +208 -37
- data/spec/isodoc/ref_spec.rb +332 -300
- data/spec/isodoc/section_spec.rb +167 -196
- metadata +4 -4
data/spec/isodoc/section_spec.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
RSpec.describe IsoDoc do
|
4
|
+
=begin
|
4
5
|
it "processes prefatory blocks" do
|
5
6
|
input = <<~INPUT
|
6
7
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
@@ -996,6 +997,7 @@ RSpec.describe IsoDoc do
|
|
996
997
|
<br/>
|
997
998
|
Variant 1
|
998
999
|
</h1>
|
1000
|
+
<p style='display:none;' class='variant-title-sub'>Variant 1</p>
|
999
1001
|
<div id='Q'>
|
1000
1002
|
<h2>
|
1001
1003
|
A.1.  Annex A.1
|
@@ -1032,6 +1034,7 @@ RSpec.describe IsoDoc do
|
|
1032
1034
|
<br/>
|
1033
1035
|
<div>
|
1034
1036
|
<h1 class='Section3'>Bibliography</h1>
|
1037
|
+
<p style='display:none;' class='variant-title-sub'>Variant 1</p>
|
1035
1038
|
<div>
|
1036
1039
|
<h2 class='Section3'>
|
1037
1040
|
Bibliography Subsection
|
@@ -1274,6 +1277,7 @@ RSpec.describe IsoDoc do
|
|
1274
1277
|
<br/>
|
1275
1278
|
Variant 1
|
1276
1279
|
</h1>
|
1280
|
+
<p style='display:none;' class='variant-title-sub'>Variant 1</p>
|
1277
1281
|
<div id='Q'>
|
1278
1282
|
<h2>
|
1279
1283
|
A.1.
|
@@ -1320,6 +1324,7 @@ RSpec.describe IsoDoc do
|
|
1320
1324
|
</p>
|
1321
1325
|
<div>
|
1322
1326
|
<h1 class='Section3'>Bibliography</h1>
|
1327
|
+
<p style='display:none;' class='variant-title-sub'>Variant 1</p>
|
1323
1328
|
<div>
|
1324
1329
|
<h2 class='Section3'>
|
1325
1330
|
Bibliography Subsection
|
@@ -1491,149 +1496,135 @@ RSpec.describe IsoDoc do
|
|
1491
1496
|
.new({ suppressheadingnumbers: true })
|
1492
1497
|
.convert("test", input, true))).to be_equivalent_to xmlpp(output)
|
1493
1498
|
end
|
1494
|
-
|
1499
|
+
=end
|
1495
1500
|
it "processes floating titles" do
|
1496
1501
|
input = <<~INPUT
|
1497
1502
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
1498
1503
|
<preface>
|
1504
|
+
<floating-title depth="1">A0</p>
|
1499
1505
|
<introduction id="B" obligation="informative">
|
1500
1506
|
<title>Introduction</title>
|
1501
|
-
<
|
1507
|
+
<floating-title depth="1">A</p>
|
1502
1508
|
<clause id="B1" obligation="informative">
|
1503
1509
|
<title>Introduction Subsection</title>
|
1504
|
-
<
|
1510
|
+
<floating-title depth="2">B</p>
|
1505
1511
|
<clause id="B2" obligation="informative">
|
1506
1512
|
<title>Introduction Sub-subsection</title>
|
1507
|
-
<
|
1513
|
+
<floating-title depth="1">C</p>
|
1508
1514
|
</clause>
|
1509
1515
|
</clause>
|
1510
1516
|
</introduction>
|
1511
1517
|
</preface>
|
1512
1518
|
<sections>
|
1513
|
-
<clause id="
|
1514
|
-
<title>Introduction</title>
|
1515
|
-
<p type="floating-title">A</p>
|
1516
|
-
<clause id="A1" obligation="informative">
|
1517
|
-
<title>Introduction Subsection</title>
|
1518
|
-
<p type="floating-title">B</p>
|
1519
|
-
<clause id="A2" obligation="informative">
|
1520
|
-
<title>Introduction Sub-subsection</title>
|
1521
|
-
<p type="floating-title">C</p>
|
1522
|
-
</clause>
|
1523
|
-
</clause>
|
1524
|
-
</clause>
|
1525
|
-
</sections>
|
1526
|
-
<annex id="C" obligation="informative">
|
1519
|
+
<clause id="C" obligation="informative">
|
1527
1520
|
<title>Introduction</title>
|
1528
|
-
<
|
1521
|
+
<floating-title depth="1">A</p>
|
1529
1522
|
<clause id="C1" obligation="informative">
|
1530
1523
|
<title>Introduction Subsection</title>
|
1531
|
-
<
|
1524
|
+
<floating-title depth="2">B</p>
|
1532
1525
|
<clause id="C2" obligation="informative">
|
1533
1526
|
<title>Introduction Sub-subsection</title>
|
1534
|
-
<
|
1527
|
+
<floating-title depth="1">C</p>
|
1535
1528
|
</clause>
|
1536
1529
|
</clause>
|
1537
|
-
</
|
1530
|
+
</clause>
|
1531
|
+
<floating-title depth="1">D</p>
|
1532
|
+
<clause id="C4"><title>Clause 2</title></clause>
|
1533
|
+
</sections>
|
1538
1534
|
</iso-standard>
|
1539
1535
|
INPUT
|
1540
1536
|
|
1541
1537
|
presxml = <<~PRESXML
|
1542
|
-
|
1543
|
-
|
1544
|
-
|
1545
|
-
|
1546
|
-
|
1547
|
-
|
1548
|
-
|
1549
|
-
|
1550
|
-
|
1551
|
-
|
1552
|
-
|
1553
|
-
|
1554
|
-
|
1555
|
-
|
1556
|
-
|
1557
|
-
|
1558
|
-
|
1559
|
-
|
1560
|
-
|
1561
|
-
|
1562
|
-
|
1563
|
-
|
1564
|
-
|
1565
|
-
|
1566
|
-
|
1567
|
-
|
1568
|
-
|
1569
|
-
|
1570
|
-
|
1571
|
-
|
1572
|
-
|
1573
|
-
|
1574
|
-
|
1575
|
-
|
1576
|
-
|
1577
|
-
|
1578
|
-
|
1579
|
-
|
1580
|
-
|
1581
|
-
|
1582
|
-
|
1538
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
|
1539
|
+
<preface>
|
1540
|
+
<p depth='1' type='floating-title' displayorder='1'>A0</p>
|
1541
|
+
<introduction id='B' obligation='informative' displayorder='2'>
|
1542
|
+
<title>Introduction</title>
|
1543
|
+
<p depth='1' type='floating-title'>A</p>
|
1544
|
+
<clause id='B1' obligation='informative'>
|
1545
|
+
<title depth='2'>Introduction Subsection</title>
|
1546
|
+
<p depth='2' type='floating-title'>B</p>
|
1547
|
+
<clause id='B2' obligation='informative'>
|
1548
|
+
<title depth='3'>Introduction Sub-subsection</title>
|
1549
|
+
<p depth='1' type='floating-title'>C</p>
|
1550
|
+
</clause>
|
1551
|
+
</clause>
|
1552
|
+
</introduction>
|
1553
|
+
</preface>
|
1554
|
+
<sections>
|
1555
|
+
<clause id='C' obligation='informative' displayorder='3'>
|
1556
|
+
<title depth='1'>
|
1557
|
+
1.
|
1558
|
+
<tab/>
|
1559
|
+
Introduction
|
1560
|
+
</title>
|
1561
|
+
<p depth='1' type='floating-title'>A</p>
|
1562
|
+
<clause id='C1' obligation='informative'>
|
1563
|
+
<title depth='2'>
|
1564
|
+
1.1.
|
1565
|
+
<tab/>
|
1566
|
+
Introduction Subsection
|
1567
|
+
</title>
|
1568
|
+
<p depth='2' type='floating-title'>B</p>
|
1569
|
+
<clause id='C2' obligation='informative'>
|
1570
|
+
<title depth='3'>
|
1571
|
+
1.1.1.
|
1572
|
+
<tab/>
|
1573
|
+
Introduction Sub-subsection
|
1574
|
+
</title>
|
1575
|
+
<p depth='1' type='floating-title'>C</p>
|
1576
|
+
</clause>
|
1577
|
+
</clause>
|
1578
|
+
</clause>
|
1579
|
+
<p depth='1' type='floating-title'>D</p>
|
1580
|
+
<clause id='C4' displayorder='4'>
|
1581
|
+
<title depth='1'>
|
1582
|
+
2.
|
1583
|
+
<tab/>
|
1584
|
+
Clause 2
|
1585
|
+
</title>
|
1586
|
+
</clause>
|
1587
|
+
</sections>
|
1583
1588
|
</iso-standard>
|
1584
1589
|
PRESXML
|
1585
1590
|
|
1586
1591
|
html = <<~OUTPUT
|
1587
1592
|
#{HTML_HDR}
|
1588
|
-
|
1589
|
-
|
1590
|
-
|
1591
|
-
<p class='
|
1592
|
-
|
1593
|
-
|
1594
|
-
|
1595
|
-
|
1596
|
-
|
1597
|
-
|
1598
|
-
|
1599
|
-
|
1600
|
-
|
1601
|
-
|
1602
|
-
|
1603
|
-
|
1604
|
-
|
1605
|
-
|
1606
|
-
|
1607
|
-
|
1608
|
-
|
1609
|
-
|
1610
|
-
|
1611
|
-
|
1612
|
-
|
1613
|
-
</div>
|
1614
|
-
<br/>
|
1615
|
-
<div id='C' class='Section3'>
|
1616
|
-
<h1 class='Annex'>
|
1617
|
-
<b>Annex A</b>
|
1618
|
-
<br/>
|
1619
|
-
(informative)
|
1620
|
-
<br/>
|
1621
|
-
<br/>
|
1622
|
-
<b>Introduction</b>
|
1623
|
-
</h1>
|
1624
|
-
<p class='h2'>A</p>
|
1625
|
-
<div id='C1'>
|
1626
|
-
<h2>A.1.  Introduction Subsection</h2>
|
1627
|
-
<p class='h3'>B</p>
|
1628
|
-
<div id='C2'>
|
1629
|
-
<h3>A.1.1.  Introduction Sub-subsection</h3>
|
1630
|
-
<p class='h4'>C</p>
|
1631
|
-
</div>
|
1632
|
-
</div>
|
1633
|
-
</div>
|
1593
|
+
<p class='h1'>A0</p>
|
1594
|
+
<br/>
|
1595
|
+
<div class='Section3' id='B'>
|
1596
|
+
<p class='h1'>A0</p>
|
1597
|
+
<h1 class='IntroTitle'>Introduction</h1>
|
1598
|
+
<p class='h1'>A</p>
|
1599
|
+
<div id='B1'>
|
1600
|
+
<h2>Introduction Subsection</h2>
|
1601
|
+
<p class='h2'>B</p>
|
1602
|
+
<div id='B2'>
|
1603
|
+
<h3>Introduction Sub-subsection</h3>
|
1604
|
+
<p class='h1'>C</p>
|
1605
|
+
</div>
|
1606
|
+
</div>
|
1607
|
+
</div>
|
1608
|
+
<p class='zzSTDTitle1'/>
|
1609
|
+
<div id='C'>
|
1610
|
+
<h1> 1.   Introduction </h1>
|
1611
|
+
<p class='h1'>A</p>
|
1612
|
+
<div id='C1'>
|
1613
|
+
<h2> 1.1.   Introduction Subsection </h2>
|
1614
|
+
<p class='h2'>B</p>
|
1615
|
+
<div id='C2'>
|
1616
|
+
<h3> 1.1.1.   Introduction Sub-subsection </h3>
|
1617
|
+
<p class='h1'>C</p>
|
1634
1618
|
</div>
|
1635
|
-
</
|
1636
|
-
</
|
1619
|
+
</div>
|
1620
|
+
</div>
|
1621
|
+
<div id='C4'>
|
1622
|
+
<p class='h1'>D</p>
|
1623
|
+
<h1> 2.   Clause 2 </h1>
|
1624
|
+
</div>
|
1625
|
+
</div>
|
1626
|
+
</body>
|
1627
|
+
</html>
|
1637
1628
|
OUTPUT
|
1638
1629
|
|
1639
1630
|
word = <<~OUTPUT
|
@@ -1641,93 +1632,73 @@ RSpec.describe IsoDoc do
|
|
1641
1632
|
<head>
|
1642
1633
|
<style></style>
|
1643
1634
|
</head>
|
1644
|
-
|
1645
|
-
|
1646
|
-
|
1647
|
-
|
1648
|
-
|
1649
|
-
|
1650
|
-
|
1651
|
-
|
1652
|
-
|
1653
|
-
|
1654
|
-
|
1655
|
-
|
1656
|
-
|
1657
|
-
|
1658
|
-
|
1659
|
-
|
1660
|
-
|
1661
|
-
|
1662
|
-
|
1663
|
-
|
1664
|
-
|
1665
|
-
</
|
1666
|
-
</div>
|
1667
|
-
<p> </p>
|
1668
|
-
</div>
|
1669
|
-
<p>
|
1670
|
-
<br clear='all' class='section'/>
|
1671
|
-
</p>
|
1672
|
-
<div class='WordSection3'>
|
1673
|
-
<p class='zzSTDTitle1'/>
|
1674
|
-
<div id='A'>
|
1675
|
-
<h1>
|
1676
|
-
1.
|
1677
|
-
<span style='mso-tab-count:1'>  </span>
|
1678
|
-
Introduction
|
1679
|
-
</h1>
|
1680
|
-
<p>A</p>
|
1681
|
-
<div id='A1'>
|
1682
|
-
<h2>
|
1683
|
-
1.1.
|
1684
|
-
<span style='mso-tab-count:1'>  </span>
|
1685
|
-
Introduction Subsection
|
1686
|
-
</h2>
|
1687
|
-
<p>B</p>
|
1688
|
-
<div id='A2'>
|
1689
|
-
<h3>
|
1690
|
-
1.1.1.
|
1691
|
-
<span style='mso-tab-count:1'>  </span>
|
1692
|
-
Introduction Sub-subsection
|
1693
|
-
</h3>
|
1694
|
-
<p>C</p>
|
1695
|
-
</div>
|
1696
|
-
</div>
|
1697
|
-
</div>
|
1698
|
-
<p>
|
1699
|
-
<br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
|
1700
|
-
</p>
|
1701
|
-
<div id='C' class='Section3'>
|
1702
|
-
<h1 class='Annex'>
|
1703
|
-
<b>Annex A</b>
|
1704
|
-
<br/>
|
1705
|
-
(informative)
|
1706
|
-
<br/>
|
1707
|
-
<br/>
|
1708
|
-
<b>Introduction</b>
|
1709
|
-
</h1>
|
1710
|
-
<p>A</p>
|
1711
|
-
<div id='C1'>
|
1712
|
-
<h2>
|
1713
|
-
A.1.
|
1714
|
-
<span style='mso-tab-count:1'>  </span>
|
1715
|
-
Introduction Subsection
|
1716
|
-
</h2>
|
1717
|
-
<p>B</p>
|
1718
|
-
<div id='C2'>
|
1719
|
-
<h3>
|
1720
|
-
A.1.1.
|
1721
|
-
<span style='mso-tab-count:1'>  </span>
|
1722
|
-
Introduction Sub-subsection
|
1723
|
-
</h3>
|
1724
|
-
<p>C</p>
|
1725
|
-
</div>
|
1726
|
-
</div>
|
1635
|
+
<body lang='EN-US' link='blue' vlink='#954F72'>
|
1636
|
+
<div class='WordSection1'>
|
1637
|
+
<p> </p>
|
1638
|
+
</div>
|
1639
|
+
<p>
|
1640
|
+
<br clear='all' class='section'/>
|
1641
|
+
</p>
|
1642
|
+
<div class='WordSection2'>
|
1643
|
+
<p>A0</p>
|
1644
|
+
<p>
|
1645
|
+
<br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
|
1646
|
+
</p>
|
1647
|
+
<div class='Section3' id='B'>
|
1648
|
+
<p>A0</p>
|
1649
|
+
<h1 class='IntroTitle'>Introduction</h1>
|
1650
|
+
<p>A</p>
|
1651
|
+
<div id='B1'>
|
1652
|
+
<h2>Introduction Subsection</h2>
|
1653
|
+
<p>B</p>
|
1654
|
+
<div id='B2'>
|
1655
|
+
<h3>Introduction Sub-subsection</h3>
|
1656
|
+
<p>C</p>
|
1727
1657
|
</div>
|
1728
1658
|
</div>
|
1729
|
-
</
|
1730
|
-
|
1659
|
+
</div>
|
1660
|
+
<p> </p>
|
1661
|
+
</div>
|
1662
|
+
<p>
|
1663
|
+
<br clear='all' class='section'/>
|
1664
|
+
</p>
|
1665
|
+
<div class='WordSection3'>
|
1666
|
+
<p class='zzSTDTitle1'/>
|
1667
|
+
<div id='C'>
|
1668
|
+
<h1>
|
1669
|
+
1.
|
1670
|
+
<span style='mso-tab-count:1'>  </span>
|
1671
|
+
Introduction
|
1672
|
+
</h1>
|
1673
|
+
<p>A</p>
|
1674
|
+
<div id='C1'>
|
1675
|
+
<h2>
|
1676
|
+
1.1.
|
1677
|
+
<span style='mso-tab-count:1'>  </span>
|
1678
|
+
Introduction Subsection
|
1679
|
+
</h2>
|
1680
|
+
<p>B</p>
|
1681
|
+
<div id='C2'>
|
1682
|
+
<h3>
|
1683
|
+
1.1.1.
|
1684
|
+
<span style='mso-tab-count:1'>  </span>
|
1685
|
+
Introduction Sub-subsection
|
1686
|
+
</h3>
|
1687
|
+
<p>C</p>
|
1688
|
+
</div>
|
1689
|
+
</div>
|
1690
|
+
</div>
|
1691
|
+
<div id='C4'>
|
1692
|
+
<p>D</p>
|
1693
|
+
<h1>
|
1694
|
+
2.
|
1695
|
+
<span style='mso-tab-count:1'>  </span>
|
1696
|
+
Clause 2
|
1697
|
+
</h1>
|
1698
|
+
</div>
|
1699
|
+
</div>
|
1700
|
+
</body>
|
1701
|
+
</html>
|
1731
1702
|
OUTPUT
|
1732
1703
|
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
1733
1704
|
.convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: isodoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciimath
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.
|
33
|
+
version: 1.3.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.
|
40
|
+
version: 1.3.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: htmlentities
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|