Skip to content

Commit

Permalink
update: #487
Browse files Browse the repository at this point in the history
  • Loading branch information
opoudjis committed Aug 21, 2024
2 parents 2af1c75 + 2e2b96b commit 5fcac74
Show file tree
Hide file tree
Showing 66 changed files with 70,504 additions and 48,245 deletions.
1 change: 1 addition & 0 deletions Gemfile.devel
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
gem "pubid-itu", git: "https://github.com/metanorma/pubid-itu", branch: "annex-to-ob"
62 changes: 39 additions & 23 deletions lib/isodoc/itu/base_convert.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,8 @@ def para_class(node)
end

def ol_depth(node)
return super unless node["class"] == "steps" ||
node.at(".//ancestor::xmlns:ol[@class = 'steps']")

node["class"] == "steps" ||
node.at(".//ancestor::xmlns:ol[@class = 'steps']") or return super
depth = node.ancestors("ul, ol").size + 1
type = :arabic
type = :alphabet if [2, 7].include? depth
Expand Down Expand Up @@ -78,27 +77,28 @@ def annex_obligation_subtitle(annex, div)
end

def annex(node, out)
@meta.get[:doctype_original] == "recommendation-annex" or
page_break(out)
out.div **attr_code(id: node["id"], class: "Section3") do |s|
annex_name(node, nil, s) unless node.at(ns("./title"))
node.elements.each do |c1|
if c1.name == "title" then annex_name(node, c1, s)
else
parse(c1, s)
end
@meta.get[:doctype_original] == "recommendation-annex" or
page_break(out)
out.div **attr_code(id: node["id"], class: "Section3") do |s|
annex_name(node, nil, s) unless node.at(ns("./title"))
node.elements.each do |c1|
if c1.name == "title" then annex_name(node, c1, s)
else
parse(c1, s)
end
end
end
end

def info(isoxml, out)
@meta.ip_notice_received isoxml, out
@meta.techreport isoxml, out
@meta.contribution isoxml, out
super
end

def note_p_parse(node, div)
name = node&.at(ns("./name"))&.remove
name = node.at(ns("./name"))&.remove
div.p do |p|
name and p.span class: "note_label" do |s|
name.children.each { |n| parse(n, s) }
Expand All @@ -110,7 +110,7 @@ def note_p_parse(node, div)
end

def note_parse1(node, div)
name = node&.at(ns("./name"))&.remove
name = node.at(ns("./name"))&.remove
div.p do |p|
name and p.span class: "note_label" do |s|
name.children.each { |n| parse(n, s) }
Expand All @@ -124,8 +124,7 @@ def table_footnote_reference_format(node)
end

def note_parse(node, out)
return if node["type"] == "title-footnote"

node["type"] == "title-footnote" and return
super
end

Expand All @@ -148,15 +147,32 @@ def clause(clause, out)
end
end

=begin
def scope(isoxml, out, num)
return super unless @meta.get[:doctype_original] == "resolution"
def dl_parse(node, out)
node.ancestors("table, formula, figure").empty? or return super
dl1(node)
table_parse(node, out)
end

def dl1(dlist)
ret = dl2tbody(dlist)
n = dlist.at(ns("./colgroup")) and ret = "#{n.remove.to_xml}#{ret}"
n = dlist.at(ns("./name")) and ret = "#{n.remove.to_xml}#{ret}"
dlist.name = "table"
dlist["class"] = "dl"
dlist.children.first.previous = ret
end

f = isoxml.at(ns("//clause[@type = 'scope']")) or return num
clause_core(f, out)
num + 1
def dl2tbody(dlist)
ret = ""
dlist.elements.select { |n| %w{dt dd}.include? n.name }
.each_slice(2) do |dt, dd|
ret += "<tr><th width='20%'>#{dt.children.to_xml}</th>" \
"<td width='80%'>#{dd.children.to_xml}</td></tr>"
dt.replace(" ")
dd.remove
end
"<tbody>#{ret}</tbody>"
end
=end
end
end
end
68 changes: 68 additions & 0 deletions lib/isodoc/itu/html/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,25 +87,91 @@
</div>

<div style='mso-element:header' id=eh2>
{% if doctype == "Contribution" %}
<p class=MsoHeader><span lang=EN-GB>- </span><!--[if supportFields]><span
lang=EN-GB><span style='mso-element:field-begin'></span><span
style='mso-spacerun:yes'> </span>PAGE<span style='mso-spacerun:yes'>  </span>\*
MERGEFORMAT <span style='mso-element:field-separator'></span></span><![endif]--><span
lang=EN-GB><span style='mso-no-proof:yes'>2</span></span><!--[if supportFields]><span
lang=EN-GB><span style='mso-element:field-end'></span></span><![endif]--><span
lang=EN-GB> -</span></p>

<p class=MsoHeader><span lang=EN-GB><span style='mso-no-proof:yes'>{{ docnumber}}</span></span></p>
{% else %}
<p class=MsoHeader align=left style='text-align:left;line-height:12.0pt;
mso-line-height-rule:exactly'><span lang=EN-GB>{% if document_td or document_provisional %}{% if document_td %}{{ document_td }}{% endif %}{% if document_td and document_provisional %}; {% endif %}{% if document_provisional %}{{ document_provisional }}{% endif %}{% endif %}</span></p>
{% endif %}
</div>

<div style='mso-element:header' id=eh2l>
{% if doctype == "Contribution" %}
<p class=MsoHeader><span lang=EN-GB>- </span><!--[if supportFields]><span
lang=EN-GB><span style='mso-element:field-begin'></span><span
style='mso-spacerun:yes'> </span>PAGE<span style='mso-spacerun:yes'>  </span>\*
MERGEFORMAT <span style='mso-element:field-separator'></span></span><![endif]--><span
lang=EN-GB><span style='mso-no-proof:yes'>2</span></span><!--[if supportFields]><span
lang=EN-GB><span style='mso-element:field-end'></span></span><![endif]--><span
lang=EN-GB> -</span></p>
<p class=MsoHeader><span lang=EN-GB><span style='mso-no-proof:yes'>{{ docnumber}}</span></span></p>

{% else %}
<p class=MsoHeaderLandscape align=left style='text-align:left;line-height:12.0pt;
mso-line-height-rule:exactly'><span lang=EN-GB>{% if document_td or document_provisional %}{% if document_td %}{{ document_td }}{% endif %}{% if document_td and document_provisional %}; {% endif %}{% if document_provisional %}{{ document_provisional }}{% endif %}{% endif %}</span></p>
{% endif %}
</div>

<div style='mso-element:header' id=h2>
{% if doctype == "Contribution" %}
<p class=MsoHeader><span lang=EN-GB>- </span><!--[if supportFields]><span
lang=EN-GB><span style='mso-element:field-begin'></span><span
style='mso-spacerun:yes'> </span>PAGE<span style='mso-spacerun:yes'>  </span>\*
MERGEFORMAT <span style='mso-element:field-separator'></span></span><![endif]--><span
lang=EN-GB><span style='mso-no-proof:yes'>2</span></span><!--[if supportFields]><span
lang=EN-GB><span style='mso-element:field-end'></span></span><![endif]--><span
lang=EN-GB> -</span></p>
<p class=MsoHeader><span lang=EN-GB><span style='mso-no-proof:yes'>{{ docnumber}}</span></span></p>
{% else %}
<p class=MsoHeader align=right style='text-align:right;line-height:12.0pt;
mso-line-height-rule:exactly'><span lang=EN-GB>{% if document_td or document_provisional %}{% if document_td %}{{ document_td }}{% endif %}{% if document_td and document_provisional %}; {% endif %}{% if document_provisional %}{{ document_provisional }}{% endif %}{% endif %}</span></p>
{% endif %}
</div>

<div style='mso-element:header' id=h2l>
{% if doctype == "Contribution" %}
<p class=MsoHeader><span lang=EN-GB>- </span><!--[if supportFields]><span
lang=EN-GB><span style='mso-element:field-begin'></span><span
style='mso-spacerun:yes'> </span>PAGE<span style='mso-spacerun:yes'>  </span>\*
MERGEFORMAT <span style='mso-element:field-separator'></span></span><![endif]--><span
lang=EN-GB><span style='mso-no-proof:yes'>2</span></span><!--[if supportFields]><span
lang=EN-GB><span style='mso-element:field-end'></span></span><![endif]--><span
lang=EN-GB> -</span></p>
<p class=MsoHeader><span lang=EN-GB><span style='mso-no-proof:yes'>{{ docnumber}}</span></span></p>
{% else %}
<p class=MsoHeaderLandscape align=right style='text-align:right;line-height:12.0pt;
mso-line-height-rule:exactly'><span lang=EN-GB>{% if document_td or document_provisional %}{% if document_td %}{{ document_td }}{% endif %}{% if document_td and document_provisional %}; {% endif %}{% if document_provisional %}{{ document_provisional }}{% endif %}{% endif %}</span></p>
{% endif %}
</div>

<div style='mso-element:header' id=fh2>
{% if doctype == "Contribution" %}
<p class=MsoHeader></p>
{% else %}
<p class=MsoHeader align=right style='text-align:right;line-height:12.0pt;
mso-line-height-rule:exactly'><span lang=EN-GB>{% if document_td or document_provisional %}{% if document_td %}{{ document_td }}{% endif %}{% if document_td and document_provisional %}; {% endif %}{% if document_provisional %}{{ document_provisional }}{% endif %}{% endif %}</span></p>
{% endif %}
</div>

<div style='mso-element:header' id=fh2l>
{% if doctype == "Contribution" %}
<p class=MsoHeader></p>
{% else %}
<p class=MsoHeaderLandscape align=right style='text-align:right;line-height:12.0pt;
mso-line-height-rule:exactly'><span lang=EN-GB>{% if document_td or document_provisional %}{% if document_td %}{{ document_td }}{% endif %}{% if document_td and document_provisional %}; {% endif %}{% if document_provisional %}{{ document_provisional }}{% endif %}{% endif %}</span></p>
{% endif %}
</div>


{% if doctype != "Contribution" %}
<div style='mso-element:footer' id=ef2>
<p class=FooterQP style='line-height:12.0pt;mso-line-height-rule:exactly'><!--[if supportFields]><span lang=EN-GB style='font-weight:
normal'><span style='mso-element:field-begin'></span></span><span lang=FR-CH
Expand Down Expand Up @@ -198,6 +264,8 @@
lang=EN-GB style='font-weight:normal'><o:p></o:p></span></p>
</div>

{% endif %}

</body>

</html>
11 changes: 7 additions & 4 deletions lib/isodoc/itu/html/html_itu_titlepage.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@

<div class="doc-info-left">
<div class="doc-identifier">
{% if doctype != "Recommendation" %}{{doctype }} {% endif %}{{ docnumeric }}
{% if collectiontitle %}<div>{{ collectiontitle}}</div>{%endif%}
<div>{% if doctype != "Recommendation" %}{{doctype }} {% endif %}{{ docnumeric }}</div>
{% if amendmentid %}<div class="doc-subidentifier">{{ amendmentid }}</div>{% endif %}
{% if corrigendumid %}<div class="doc-subidentifier">{{ corrigendumid }}</div>{% endif %}
{% if edition %} <div> Revision {{ edition }}</div> {% endif %}
Expand All @@ -59,9 +60,11 @@
</div>

<div class="doc-category">
{% if bureau == "T" %}Telecommunication <br/>Standardization Sector <br/>of ITU{% endif %}
{% if bureau == "D" %}Telecommunication <br/>Development Sector <br/>of ITU{% endif %}
{% if bureau == "R" %}Radiocommunication <br/>Sector of ITU{% endif %}
{% if sector %}{{sector}}{%else%}
{% if bureau == "T" %}{{ labels["tsb_full"] }}{% endif %}
{% if bureau == "D" %}{{ labels["bdt_full"] }}{% endif %}
{% if bureau == "R" %}{{ labels["br_full"] }}{% endif %}
{%endif%}
</div>

<div class="coverpage-title">
Expand Down
2 changes: 1 addition & 1 deletion lib/isodoc/itu/html/htmlstyle.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ body {

nav {
@include sidebarNav(
$offsetLeft: 45px,
$offsetLeft: 30px,
$colorBg: #fff,
$width: 323px);

Expand Down
5 changes: 4 additions & 1 deletion lib/isodoc/itu/html/itu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -882,11 +882,14 @@ div.WordSection1
margin:54.45pt 54.45pt 54.45pt 54.45pt;
mso-header-margin:24.1pt;
mso-footer-margin:24.1pt;
{% if doctype == "Service Publication" %}
{% if doctype == "Service Publication" or doctype == "Contribution" %}
mso-page-numbers:1;
{% else %}
mso-page-numbers:roman-lower 1;
{% endif %}
{% if doctype == "Contribution" %}
mso-title-page:yes;
{% endif %}
mso-even-header:url("file:///C:/Doc/FILENAME_files/header.html") eh2;
mso-header:url("file:///C:/Doc/FILENAME_files/header.html") h2;
mso-even-footer:url("file:///C:/Doc/FILENAME_files/header.html") ef2;
Expand Down
Binary file added lib/isodoc/itu/html/logo-small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions lib/isodoc/itu/html/word_itu_intro.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{% if doctype != "Contribution" %}
{% if doctype != "Resolution" %}
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0"
style='border-collapse:collapse;mso-table-layout-alt:fixed;mso-padding-alt:0cm 5.4pt 0cm 5.4pt'>
Expand Down Expand Up @@ -167,3 +168,4 @@
<div id="boilerplate-copyright-destination"/>

{% endif %}
{% endif %}
51 changes: 17 additions & 34 deletions lib/isodoc/itu/html/word_itu_titlepage.html
Original file line number Diff line number Diff line change
Expand Up @@ -223,44 +223,27 @@
width="95" colspan="2"><p class='MsoNormal'>&#xA0;</p></td>
<td width="303" colspan="2" valign="top" style='width:227.45pt;padding:0cm 4.25pt 0cm 4.25pt;
height:48.7pt'>
{% if bureau == "T" %}
<p class="MsoNormal" align="left" style='text-align:left'><span style='mso-bookmark:
_Hlk526346232'><span lang="EN-US" style='font-size:10.0pt;font-family:"Arial",sans-serif;
mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-US'>TELECOMMUNICATION</span></span><span
style='mso-bookmark:_Hlk526346232'><span lang="EN-US" style='font-size:10.0pt;
font-family:"Arial",sans-serif;mso-ansi-language:EN-US'><br/>
</span></span><span style='mso-bookmark:_Hlk526346232'><span lang="EN-US"
style='font-size:10.0pt;font-family:"Arial",sans-serif;mso-bidi-font-family:
"Times New Roman";mso-ansi-language:EN-US'>STANDARDIZATION SECTOR<br/>
OF ITU</span></span><span style='mso-bookmark:_Hlk526346232'><b
style='mso-bidi-font-weight:normal'><span lang="EN-US" style='font-size:10.0pt;
mso-ansi-language:EN-US'><o:p></o:p></span></b></span></p>

{% if sector %}
<p class="MsoNormal" align="left" style='text-align:left'>
<span lang="EN-US" style='font-size:10.0pt;font-family:"Arial",sans-serif;
mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-US'>{{ sector }}</span></p>
{% else %}
{% if bureau == "T" %}
<p class="MsoNormal" align="left" style='text-align:left'>
<span lang="EN-US" style='font-size:10.0pt;font-family:"Arial",sans-serif;
mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-US'>{{ labels["tsb_full"] }}</span></p>
{% endif %}
{% if bureau == "D" %}
<p class="MsoNormal" align="left" style='text-align:left'><span style='mso-bookmark:
_Hlk526346232'><span lang="EN-US" style='font-size:10.0pt;font-family:"Arial",sans-serif;
mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-US'>TELECOMMUNICATION</span></span><span
style='mso-bookmark:_Hlk526346232'><span lang="EN-US" style='font-size:10.0pt;
font-family:"Arial",sans-serif;mso-ansi-language:EN-US'><br/>
</span></span><span style='mso-bookmark:_Hlk526346232'><span lang="EN-US"
style='font-size:10.0pt;font-family:"Arial",sans-serif;mso-bidi-font-family:
"Times New Roman";mso-ansi-language:EN-US'>DEVELOPMENT SECTOR<br/>
OF ITU</span></span><span style='mso-bookmark:_Hlk526346232'><b
style='mso-bidi-font-weight:normal'><span lang="EN-US" style='font-size:10.0pt;
mso-ansi-language:EN-US'><o:p></o:p></span></b></span></p>
<p class="MsoNormal" align="left" style='text-align:left'>
<span lang="EN-US" style='font-size:10.0pt;font-family:"Arial",sans-serif;
mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-US'>{{ labels["bdt_full"] }}</span></p>
{% endif %}
{% if bureau == "R" %}
<p class="MsoNormal" align="left" style='text-align:left'><span style='mso-bookmark:
_Hlk526346232'><span lang="EN-US" style='font-size:10.0pt;font-family:"Arial",sans-serif;
mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-US'>RADIOCOMMUNICATION</span></span><span
style='mso-bookmark:_Hlk526346232'><span lang="EN-US" style='font-size:10.0pt;
font-family:"Arial",sans-serif;mso-ansi-language:EN-US'><br/>
</span></span><span style='mso-bookmark:_Hlk526346232'><span lang="EN-US"
style='font-size:10.0pt;font-family:"Arial",sans-serif;mso-bidi-font-family:
"Times New Roman";mso-ansi-language:EN-US'>SECTOR<br/>
OF ITU</span></span><span style='mso-bookmark:_Hlk526346232'><b
style='mso-bidi-font-weight:normal'><span lang="EN-US" style='font-size:10.0pt;
mso-ansi-language:EN-US'><o:p></o:p></span></b></span></p>
<p class="MsoNormal" align="left" style='text-align:left'>
<span lang="EN-US" style='font-size:10.0pt;font-family:"Arial",sans-serif;
mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-US'>{{ labels["br_full"] }}</span></p>
{% endif %}
{% endif %}

</td>
Expand Down
2 changes: 2 additions & 0 deletions lib/isodoc/itu/html/wordstyle.scss
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ p.MsoHeader, li.MsoHeader, div.MsoHeader
mso-layout-grid-align:none;
punctuation-wrap:simple;
text-autospace:none;
{% if doctype == "Contribution" %}text-align:center;{% endif %}
font-size:9.0pt;
mso-bidi-font-size:10.0pt;
font-family:$bodyfont;
Expand All @@ -188,6 +189,7 @@ p.MsoHeaderLandscape, li.MsoHeaderLandscape, div.MsoHeaderLandscape
mso-layout-grid-align:none;
punctuation-wrap:simple;
text-autospace:none;
{% if doctype == "Contribution" %}text-align:center;{% endif %}
font-size:9.0pt;
mso-bidi-font-size:10.0pt;
font-family:$bodyfont;
Expand Down
10 changes: 10 additions & 0 deletions lib/isodoc/itu/html_convert.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,16 @@ def clause(node, out)
super
end

def convert1(docxml, filename, dir)
case @doctype
when "contribution"
@wordcoverpage = nil
@wordintropage = nil
end
super
end


include BaseConvert
include Init
end
Expand Down
Loading

0 comments on commit 5fcac74

Please sign in to comment.