metanorma-jis 0.0.1 → 0.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 389469990940f3daa6877a9bfd6f3903ef3705e4a3bc0446de19e2d2c1a52930
4
- data.tar.gz: b0cbac18b0e1cf0223d52ebe4cce6d2c7956a7a79a70e974369cf8d556c8bf9a
3
+ metadata.gz: 7202e095e949d4def144db9e549bfaa78fc453096fb6607d83024924da0bd0b8
4
+ data.tar.gz: 765d9791c6428d6e8f55db74d14c6fbea884502ae78b8590c0435d4370f91ea9
5
5
  SHA512:
6
- metadata.gz: c14b13c90635a211a98d25a65850166c7d515aa49857ba99394664a571cee113f3c91db7e32c5ad523a51676b6a83536aec9fe8ccd0908c277bc1f748768e906
7
- data.tar.gz: 5b6e900e60f71d0f4f4fb363269ef974fbdfa99690bc1a4292b8d05c20f195b7afe8878433368adbc95c5177a7b6f929f3d29cfb42c9da0a49f0bd690e5d189f
6
+ metadata.gz: 331443ed139aa8c3c6024781d1723d2965ef45a4714eba88294898bbffa2bab14ab6af52963da9e6b98f07389b582362a3fe637bec13da2c95bb9de30c3109bb
7
+ data.tar.gz: 71d1aeacef86ad9a9113f28327ac88a4acb56f1ffdad9a2c98a7a9233e235b50446f1fb314bbd05665644dc12beb418e4bbbe43f89d6d6d9708d95ade43a1f03
@@ -24,8 +24,10 @@ class Html2Doc
24
24
  def list2para_nest(item, level, list)
25
25
  item["class"] = list2para_style(list.name, level)
26
26
  item.xpath("./p").each do |p|
27
- p["class"] = list2para_style(list.name, level)
27
+ p["class"] = list2para_class(list.name, level)
28
28
  p["style"] = item["style"]
29
+ (a = list2para_style(list.name, level)) && !a.empty? and
30
+ p["style"] = "#{a};#{p['style']}"
29
31
  p["id"] = item["id"]
30
32
  end
31
33
  item.at("./p") or return
@@ -56,17 +58,50 @@ class Html2Doc
56
58
  end
57
59
  end
58
60
 
59
- def list2para_style(listtype, depth)
61
+ def list2para_class(listtype, depth)
60
62
  case listtype
61
- when "ul", "ol"
63
+ when "ol" then "MsoList"
64
+ when "ul"
62
65
  case depth
63
- when "1" then "MsoList"
64
- when "2", "3", "4", "5" then "MsoList#{depth}"
65
- else "MsoList6"
66
+ when "1" then "MsoListBullet"
67
+ when "2", "3", "4", "5" then "MsoListBullet#{depth}"
68
+ else "MsoListBullet6"
66
69
  end
67
70
  end
68
71
  end
69
72
 
73
+ def list2para_style(listtype, depth)
74
+ case listtype
75
+ when "ol"
76
+ ret = case depth
77
+ when "1" then "margin-left: 36.0pt;"
78
+ when "2" then "margin-left: 54.0pt;"
79
+ when "3" then "margin-left: 72.0pt;"
80
+ when "4" then "margin-left: 90.0pt;"
81
+ when "5" then "margin-left: 108.0pt;"
82
+ when "6" then "margin-left: 126.0pt;"
83
+ when "7" then "margin-left: 144.0pt;"
84
+ when "8" then "margin-left: 162.0pt;"
85
+ else "margin-left: 180.0pt;"
86
+ end
87
+ "#{ret}text-indent:-18.0pt;"
88
+ when "ul"
89
+ ret = case depth
90
+ when "1" then "margin-left: 36.0pt;"
91
+ when "2" then "margin-left: 45.95pt;"
92
+ when "3" then "margin-left: 72.0pt;"
93
+ when "4" then "margin-left: 90.0pt;"
94
+ when "5" then "margin-left: 108.0pt;"
95
+ when "6" then "margin-left: 126.0pt;"
96
+ when "7" then "margin-left: 144.0pt;"
97
+ when "8" then "margin-left: 162.0pt;"
98
+ else "margin-left: 180.0pt;"
99
+ end
100
+ "#{ret}text-indent:-18.0pt;"
101
+
102
+ end
103
+ end
104
+
70
105
  def lists(docxml, liststyles)
71
106
  super
72
107
  docxml.xpath("//p[ol | ul]").each do |p|
@@ -28,7 +28,7 @@ module IsoDoc
28
28
  out.p(class: "zzSTDTitle2") do |p|
29
29
  p << @meta.get[:docsubtitleintro]
30
30
  p << " &#x2014; " if @meta.get[:docsubtitleintro] && @meta.get[:docsubtitlemain]
31
- p << @meta.get[:doctitlemain]
31
+ p << @meta.get[:docsubtitlemain]
32
32
  p << " &#x2014; " if @meta.get[:docsubtitlemain] && @meta.get[:docsubtitlepart]
33
33
  end
34
34
  a = @meta.get[:docsubtitlepart] and out.p(class: "zzSTDTitle2") do |p|
@@ -36,6 +36,44 @@ module IsoDoc
36
36
  p << "<br/><b>#{a}</b>"
37
37
  end
38
38
  end
39
+
40
+ def termnote_parse(node, out)
41
+ name = node&.at(ns("./name"))&.remove
42
+ out.div **note_attrs(node) do |div|
43
+ div.p do |p|
44
+ if name
45
+ p.span class: "note_label" do |s|
46
+ name.children.each { |n| parse(n, s) }
47
+ end
48
+ p << termnote_delim
49
+ end
50
+ para_then_remainder(node.first_element_child, node, p, div)
51
+ end
52
+ end
53
+ end
54
+
55
+ def admonition_name_parse(_node, div, name)
56
+ div.span class: "note_label" do |s|
57
+ name.children.each { |n| parse(n, s) }
58
+ s << " &#x2014; "
59
+ end
60
+ end
61
+
62
+ def admitted_term_parse(node, out)
63
+ out.p class: "Terms", style: "text-align:left;" do |p|
64
+ p << l10n("#{@i18n.alternative}: ")
65
+ node.children.each { |c| parse(c, p) }
66
+ end
67
+ end
68
+
69
+ def para_class(node)
70
+ super || node["class"]
71
+ end
72
+
73
+ def make_tr_attr(cell, row, totalrows, header, bordered)
74
+ cell["border"] == "0" and bordered = false
75
+ super
76
+ end
39
77
  end
40
78
  end
41
79
  end
@@ -99,29 +99,27 @@ p.NormRef, li.NormRef, div.NormRef {
99
99
  mso-fareast-language: JA; }
100
100
 
101
101
  p.FigureTitle, li.FigureTitle, div.FigureTitle {
102
- mso-style-name: "Figure Title";
102
+ mso-style-name: 図題(参考付図);
103
+ /* title (reference figure) */
103
104
  mso-style-unhide: no;
104
- mso-style-qformat: yes;
105
- mso-style-parent: "";
106
- mso-style-parent: "List Paragraph";
107
- mso-style-link: "Figure Title Char";
108
- margin-top: 0cm;
105
+ mso-style-parent: 図題;
106
+ mso-style-next: 段落;
107
+ margin-top: 3.0pt;
109
108
  margin-right: 0cm;
110
- margin-bottom: 6.0pt;
111
- margin-left: 36.0pt;
112
- mso-add-space: auto;
109
+ margin-bottom: 0cm;
110
+ margin-left: 0cm;
113
111
  text-align: center;
114
- text-indent: -30.35pt;
115
- line-height: 12.0pt;
116
- mso-pagination: widow-orphan;
117
- /*mso-list:l9 level1 lfo17;*/
118
- tab-stops: 20.15pt;
112
+ line-height: 17.0pt;
113
+ mso-line-height-rule: exactly;
114
+ mso-pagination: none;
119
115
  font-size: {{normalfontsize}};
120
- font-family: {{bodyfont}};
116
+ font-family: "Times New Roman",serif;
117
+ mso-fareast-font-family: {{headerfont}};
118
+ mso-font-kerning: 1.0pt;
119
+ mso-ansi-language: EN-US;
120
+ mso-fareast-language: JA;
121
121
  font-weight: bold;
122
- mso-fareast-font-family: "SimSun",serif;
123
- mso-bidi-font-family: {{bodyfont}};
124
- mso-ansi-language: EN-GB; }
122
+ mso-bidi-font-weight: normal; }
125
123
 
126
124
  p.FigureTitleCxSpFirst, li.FigureTitleCxSpFirst, div.FigureTitleCxSpFirst {
127
125
  mso-style-name: "Figure TitleCxSpFirst";
@@ -404,28 +402,28 @@ p.SourceTitle {
404
402
  mso-ansi-language: EN-GB; }
405
403
 
406
404
  p.Tabletitle, li.Tabletitle, div.Tabletitle, p.ListTitle {
407
- mso-style-name: "Table title";
405
+ mso-style-name: 表題(解説表);
406
+ /* Title (explanatory table) */
408
407
  mso-style-unhide: no;
409
- mso-style-qformat: yes;
410
- mso-style-parent: "";
408
+ mso-style-parent: Title;
409
+ mso-style-next: 単位;
411
410
  margin-top: 0cm;
412
411
  margin-right: 0cm;
413
- margin-bottom: 6.0pt;
414
- margin-left: 36.0pt;
412
+ margin-bottom: 3.0pt;
413
+ margin-left: 0cm;
415
414
  text-align: center;
416
- text-indent: -18.0pt;
417
- line-height: 12.0pt;
418
- page-break-after: avoid;
419
- line-height: 12.0pt;
420
- mso-pagination: widow-orphan;
421
- /* mso-list:l8 level1 lfo16; */
422
- tab-stops: 20.15pt;
415
+ line-height: 17.0pt;
416
+ mso-line-height-rule: exactly;
417
+ mso-pagination: none;
423
418
  font-size: {{normalfontsize}};
419
+ font-family: "Times New Roman",serif;
420
+ mso-fareast-font-family: {{headerfont}};
421
+ mso-font-kerning: 1.0pt;
422
+ mso-ansi-language: EN-US;
423
+ mso-fareast-language: JA;
424
424
  font-weight: bold;
425
- font-family: {{bodyfont}};
426
- mso-fareast-font-family: "SimSun",serif;
427
- mso-bidi-font-family: {{bodyfont}};
428
- mso-ansi-language: EN-GB; }
425
+ mso-bidi-font-weight: normal;
426
+ mso-no-proof: yes; }
429
427
 
430
428
  p.TabletitleCxSpFirst, li.TabletitleCxSpFirst, div.TabletitleCxSpFirst {
431
429
  mso-style-name: "Table titleCxSpFirst";
@@ -816,7 +814,7 @@ p.zzHelp, li.zzHelp, div.zzHelp {
816
814
  font-size: {{normalfontsize}};
817
815
  mso-bidi-font-size: 10.0pt;
818
816
  font-family: {{bodyfont}};
819
- mso-fareast-font-family: "MS Mincho";
817
+ mso-fareast-font-family: {{bodyfont}};
820
818
  mso-bidi-font-family: "Times New Roman";
821
819
  color: green;
822
820
  mso-ansi-language: EN-GB;
@@ -957,7 +955,7 @@ p.zzSTDTitle1, li.zzSTDTitle1, div.zzSTDTitle1 {
957
955
  mso-pagination: none;
958
956
  font-size: 10.0pt;
959
957
  font-family: "Times New Roman",serif;
960
- mso-fareast-font-family: "MS Gothic";
958
+ mso-fareast-font-family: {{headerfont}};
961
959
  mso-font-kerning: 1.0pt;
962
960
  mso-ansi-language: EN-US;
963
961
  mso-fareast-language: JA;
@@ -1188,7 +1186,7 @@ table.MsoISOTable td, table.MsoISOTableBig td {
1188
1186
  table.MsoISOTable p, table.MsoISOTableBig p {
1189
1187
  font-size: {{smallerfontsize}}; }
1190
1188
 
1191
- table.MsoTableGrid {
1189
+ table.MsoTableGrid, table.MsoTableGridBig {
1192
1190
  mso-style-name: "Table Grid";
1193
1191
  mso-tstyle-rowband-size: 0;
1194
1192
  mso-tstyle-colband-size: 0;
@@ -1205,6 +1203,15 @@ table.MsoTableGrid {
1205
1203
  font-size: {{smallerfontsize}};
1206
1204
  font-family: {{bodyfont}}; }
1207
1205
 
1206
+ table.MsoTableGrid tr {
1207
+ page-break-inside: avoid; }
1208
+
1209
+ table.MsoTableGridBig tr {
1210
+ page-break-inside: auto; }
1211
+
1212
+ table.MsoTableGridBig td {
1213
+ page-break-inside: auto; }
1214
+
1208
1215
  div.formula {
1209
1216
  tab-stops: right 487.45pt; }
1210
1217
 
@@ -1356,20 +1363,28 @@ div.Example, td.Example {
1356
1363
  margin-bottom: 6.0pt; }
1357
1364
 
1358
1365
  p.Example, li.Example, div.Example {
1366
+ mso-style-name: 例1;
1367
+ /* Example 1 */
1359
1368
  mso-style-unhide: no;
1360
- mso-style-qformat: yes;
1361
- margin-top: 0cm;
1369
+ mso-style-parent: "";
1370
+ mso-style-next: 例1_段落;
1371
+ margin-top: 3.0pt;
1362
1372
  margin-right: 0cm;
1363
- margin-bottom: 6.0pt;
1364
- margin-left: 0cm;
1373
+ margin-bottom: 0cm;
1374
+ margin-left: 29.8pt;
1365
1375
  text-align: justify;
1366
- line-height: 12.0pt;
1367
- mso-pagination: widow-orphan;
1368
- /* tab-stops:20.15pt; */
1369
- mso-fareast-font-family: Calibri;
1370
- mso-bidi-font-family: "Times New Roman";
1371
- mso-ansi-language: EN-GB;
1372
- mso-fareast-language: EN-US; }
1376
+ text-justify: inter-ideograph;
1377
+ text-indent: -19.85pt;
1378
+ line-height: 15.0pt;
1379
+ mso-line-height-rule: exactly;
1380
+ mso-pagination: none;
1381
+ font-size: {{normalfontsize}};
1382
+ font-family: "Times New Roman",serif;
1383
+ mso-fareast-font-family: {{bodyfont}};
1384
+ mso-font-kerning: 1.0pt;
1385
+ mso-ansi-language: EN-US;
1386
+ mso-fareast-language: JA;
1387
+ mso-no-proof: yes; }
1373
1388
 
1374
1389
  span.ExampleChar {
1375
1390
  mso-style-name: "Example Char";
@@ -1409,7 +1424,7 @@ div.Note table.dl {
1409
1424
 
1410
1425
  span.note_label, span.example_label, td.example_label, td.note_label {
1411
1426
  font-size: {{smallerfontsize}};
1412
- font-family: {{bodyfont}}; }
1427
+ font-family: {{headerfont}}; }
1413
1428
 
1414
1429
  /* styles as yet unallocated */
1415
1430
  p.a, li.a, div.a {
@@ -2043,7 +2058,7 @@ p.a3, li.a3, div.a3 {
2043
2058
  mso-fareast-language: JA;
2044
2059
  mso-no-proof: yes; }
2045
2060
 
2046
- p.a4, li.a4, div.a4 {
2061
+ p.MsoListBullet, li.MsoListBullet, div.MsoListBullet {
2047
2062
  mso-style-name: ダーシ1;
2048
2063
  /* Darcy 1 */
2049
2064
  mso-style-unhide: no;
@@ -2089,7 +2104,7 @@ p.a5, li.a5, div.a5 {
2089
2104
  mso-fareast-language: JA;
2090
2105
  mso-no-proof: yes; }
2091
2106
 
2092
- p.a6, li.a6, div.a6 {
2107
+ p.MsoListBullet2, li.MsoListBullet2, div.MsoListBullet2 {
2093
2108
  mso-style-name: ダーシ2;
2094
2109
  /* Darcy 2 */
2095
2110
  mso-style-unhide: no;
@@ -2135,7 +2150,7 @@ p.a7, li.a7, div.a7 {
2135
2150
  mso-fareast-language: JA;
2136
2151
  mso-no-proof: yes; }
2137
2152
 
2138
- p.a8, li.a8, div.a8 {
2153
+ p.MsoListBullet3, li.MsoListBullet3, div.MsoListBullet3 {
2139
2154
  mso-style-name: ダーシ3;
2140
2155
  /* Darcy 3 */
2141
2156
  mso-style-unhide: no;
@@ -2181,7 +2196,7 @@ p.a9, li.a9, div.a9 {
2181
2196
  mso-fareast-language: JA;
2182
2197
  mso-no-proof: yes; }
2183
2198
 
2184
- p.aa, li.aa, div.aa {
2199
+ p.MsoListBullet4, li.MsoListBullet4, div.MsoListBullet4 {
2185
2200
  mso-style-name: ダーシ4;
2186
2201
  /* Darcy 4 */
2187
2202
  mso-style-unhide: no;
@@ -2227,7 +2242,7 @@ p.ab, li.ab, div.ab {
2227
2242
  mso-fareast-language: JA;
2228
2243
  mso-no-proof: yes; }
2229
2244
 
2230
- p.ac, li.ac, div.ac {
2245
+ p.MsoListBullet5, li.MsoListBullet5, div.MsoListBullet5 {
2231
2246
  mso-style-name: ダーシ5;
2232
2247
  /* Darcy 5 */
2233
2248
  mso-style-unhide: no;
@@ -2273,7 +2288,7 @@ p.ad, li.ad, div.ad {
2273
2288
  mso-fareast-language: JA;
2274
2289
  mso-no-proof: yes; }
2275
2290
 
2276
- p.ae, li.ae, div.ae {
2291
+ p.MsoListBullet6, li.MsoListBullet6, div.MsoListBullet6 {
2277
2292
  mso-style-name: ダーシ6;
2278
2293
  /* Darcy 6 */
2279
2294
  mso-style-unhide: no;
@@ -2837,29 +2852,6 @@ span.TR0 {
2837
2852
  mso-style-unhide: no;
2838
2853
  mso-style-parent: ""; }
2839
2854
 
2840
- p.afffa, li.afffa, div.afffa {
2841
- mso-style-name: 段落;
2842
- /* paragraph */
2843
- mso-style-unhide: no;
2844
- mso-style-parent: "";
2845
- margin-top: 10.0pt;
2846
- margin-right: 0cm;
2847
- margin-bottom: 0cm;
2848
- margin-left: 0cm;
2849
- text-align: justify;
2850
- text-justify: inter-ideograph;
2851
- text-indent: 9.95pt;
2852
- line-height: 15.0pt;
2853
- mso-line-height-rule: exactly;
2854
- mso-pagination: none;
2855
- font-size: {{normalfontsize}};
2856
- font-family: "Times New Roman",serif;
2857
- mso-fareast-font-family: {{bodyfont}};
2858
- mso-font-kerning: 1.0pt;
2859
- mso-ansi-language: EN-US;
2860
- mso-fareast-language: JA;
2861
- mso-no-proof: yes; }
2862
-
2863
2855
  p.afffb, li.afffb, div.afffb {
2864
2856
  mso-style-name: 罫線段落;
2865
2857
  /* ruled paragraph */
@@ -3917,30 +3909,7 @@ p.afffffffd, li.afffffffd, div.afffffffd {
3917
3909
  mso-bidi-font-weight: normal;
3918
3910
  mso-no-proof: yes; }
3919
3911
 
3920
- p.afffffffe, li.afffffffe, div.afffffffe {
3921
- mso-style-name: 図題(参考付図);
3922
- /* title (reference figure) */
3923
- mso-style-unhide: no;
3924
- mso-style-parent: 図題;
3925
- mso-style-next: 段落;
3926
- margin-top: 3.0pt;
3927
- margin-right: 0cm;
3928
- margin-bottom: 0cm;
3929
- margin-left: 0cm;
3930
- text-align: center;
3931
- line-height: 17.0pt;
3932
- mso-line-height-rule: exactly;
3933
- mso-pagination: none;
3934
- font-size: {{normalfontsize}};
3935
- font-family: "Times New Roman",serif;
3936
- mso-fareast-font-family: {{headerfont}};
3937
- mso-font-kerning: 1.0pt;
3938
- mso-ansi-language: EN-US;
3939
- mso-fareast-language: JA;
3940
- font-weight: bold;
3941
- mso-bidi-font-weight: normal; }
3942
-
3943
- p.affffffff, li.affffffff, div.affffffff {
3912
+ p.SubfigureCaption, li.SubfigureCaption, div.SubfigureCaption {
3944
3913
  mso-style-name: 図題(付図);
3945
3914
  /* Subtitle (Appendix) */
3946
3915
  mso-style-unhide: no;
@@ -5445,7 +5414,7 @@ span.affffffffffff5 {
5445
5414
  mso-fareast-font-family: {{headerfont}};
5446
5415
  mso-hansi-font-family: Arial; }
5447
5416
 
5448
- p.affffffffffff6, li.affffffffffff6, div.affffffffffff6 {
5417
+ p.UnitStatement, li.UnitStatement, div.UnitStatement {
5449
5418
  mso-style-name: 単位;
5450
5419
  /* unit */
5451
5420
  mso-style-unhide: no;
@@ -7586,30 +7555,6 @@ p.afffffffffffffffff4, li.afffffffffffffffff4, div.afffffffffffffffff4 {
7586
7555
  mso-ansi-language: EN-US;
7587
7556
  mso-fareast-language: JA; }
7588
7557
 
7589
- p.afffffffffffffffff5, li.afffffffffffffffff5, div.afffffffffffffffff5 {
7590
- mso-style-name: 表題(解説表);
7591
- /* Title (explanatory table) */
7592
- mso-style-unhide: no;
7593
- mso-style-parent: Title;
7594
- mso-style-next: 単位;
7595
- margin-top: 0cm;
7596
- margin-right: 0cm;
7597
- margin-bottom: 3.0pt;
7598
- margin-left: 0cm;
7599
- text-align: center;
7600
- line-height: 17.0pt;
7601
- mso-line-height-rule: exactly;
7602
- mso-pagination: none;
7603
- font-size: {{normalfontsize}};
7604
- font-family: "Times New Roman",serif;
7605
- mso-fareast-font-family: {{headerfont}};
7606
- mso-font-kerning: 1.0pt;
7607
- mso-ansi-language: EN-US;
7608
- mso-fareast-language: JA;
7609
- font-weight: bold;
7610
- mso-bidi-font-weight: normal;
7611
- mso-no-proof: yes; }
7612
-
7613
7558
  p.afffffffffffffffff6, li.afffffffffffffffff6, div.afffffffffffffffff6 {
7614
7559
  mso-style-name: 表題(解説付表);
7615
7560
  /* Title (explanatory table) */
@@ -9193,30 +9138,6 @@ p.afffffffffffffffffffffd, li.afffffffffffffffffffffd, div.affffffffffffffffffff
9193
9138
  mso-bidi-font-weight: normal;
9194
9139
  mso-no-proof: yes; }
9195
9140
 
9196
- p.afffffffffffffffffffffe, li.afffffffffffffffffffffe, div.afffffffffffffffffffffe {
9197
- mso-style-name: 例1;
9198
- /* Example 1 */
9199
- mso-style-unhide: no;
9200
- mso-style-parent: "";
9201
- mso-style-next: 例1_段落;
9202
- margin-top: 3.0pt;
9203
- margin-right: 0cm;
9204
- margin-bottom: 0cm;
9205
- margin-left: 29.8pt;
9206
- text-align: justify;
9207
- text-justify: inter-ideograph;
9208
- text-indent: -19.85pt;
9209
- line-height: 15.0pt;
9210
- mso-line-height-rule: exactly;
9211
- mso-pagination: none;
9212
- font-size: {{normalfontsize}};
9213
- font-family: "Times New Roman",serif;
9214
- mso-fareast-font-family: {{bodyfont}};
9215
- mso-font-kerning: 1.0pt;
9216
- mso-ansi-language: EN-US;
9217
- mso-fareast-language: JA;
9218
- mso-no-proof: yes; }
9219
-
9220
9141
  p.affffffffffffffffffffff, li.affffffffffffffffffffff, div.affffffffffffffffffffff {
9221
9142
  mso-style-name: 例1(番号のみ);
9222
9143
  /* Example 1 (number only) */