Skip to content

Commit

Permalink
justification annex in ITU contrbibutions: #514
Browse files Browse the repository at this point in the history
  • Loading branch information
opoudjis committed May 11, 2024
1 parent f3f3fb7 commit 5d09396
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 11 deletions.
10 changes: 5 additions & 5 deletions lib/isodoc/itu/presentation_contribution.rb
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,11 @@ def contribution_justification(doc)
<th rowspan="#{authcount}">Approval process:</th><td><td>#{@meta.get[:approvalprocess]}</td>
</tr>
#{auths_tail}
<tr><td colspan="5"><p><strong>Scope</strong> (defines the intent or object of the Recommendation and the aspects covered, thereby indicating the limits of its applicability):</p>>#{extract_clause_data(annex, 'scope')}</td></tr>
<tr><td colspan="5"><p><strong>Summary</strong> (provides a brief overview of the purpose and contents of the Recommendation, thus permitting readers to judge its usefulness for their work):</p>>#{extract_clause_data(annex, 'summary')}</td></tr>
<tr><td colspan="5"><p><strong>Relations to ITU-T Recommendations or to other standards</strong> (approved or uder development):</p>>#{extract_clause_data(annex, 'relatedstandards')}</td></tr>
<tr><td colspan="5"><p><strong>Liaisons with other study groups or with other standards bodies:</strong></p>>#{extract_clause_data(annex, 'liaisons')}</td></tr>
<tr><td colspan="5"><p><strong>Supporting members that are committing to contributing actively to the work item::</strong></p>>#{extract_clause_data(annex, 'supportingmembers')}</td></tr>
<tr><td colspan="5"><p><strong>Scope</strong> (defines the intent or object of the Recommendation and the aspects covered, thereby indicating the limits of its applicability):</p>#{extract_clause_data(annex, 'scope')}</td></tr>
<tr><td colspan="5"><p><strong>Summary</strong> (provides a brief overview of the purpose and contents of the Recommendation, thus permitting readers to judge its usefulness for their work):</p>#{extract_clause_data(annex, 'summary')}</td></tr>
<tr><td colspan="5"><p><strong>Relations to ITU-T Recommendations or to other standards</strong> (approved or under development):</p>#{extract_clause_data(annex, 'relatedstandards')}</td></tr>
<tr><td colspan="5"><p><strong>Liaisons with other study groups or with other standards bodies:</strong></p>#{extract_clause_data(annex, 'liaisons')}</td></tr>
<tr><td colspan="5"><p><strong>Supporting members that are committing to contributing actively to the work item:</strong></p>#{extract_clause_data(annex, 'supportingmembers')}</td></tr>
</tbody>
</table>
TABLE
Expand Down
9 changes: 5 additions & 4 deletions lib/isodoc/itu/presentation_preface.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def editor_table_entries(eds, ed_lbl, mail_lbl)
def rearrange_clauses(docxml)
super
insert_preface_sections(docxml)
a = docxml.at(ns("//preface/abstract")) or return
a = docxml.at(ns("//preface/abstract"))
keywords_abstract_swap(a, keywords(docxml), docxml)
c = docxml.at(ns("//preface/clause[@type='contribution-metadata']")) and
a and c.next = a
Expand All @@ -73,15 +73,16 @@ def rearrange_clauses(docxml)

def keywords_abstract_swap(abstract, keywords, docxml)
@doctype == "contribution" and return
keywords or return
if abstract then abstract.next = keywords
k = keywords or return
if abstract then abstract.next = k
else
p = contribution_table_insert_pt(docxml)
p.next = keywords
p.next = k
end
end

def abstract_render(abstract)
abstract or return
@doctype == "contribution" or return
abstract.at(ns("./title"))&.remove
abstract.children = <<~TABLE
Expand Down
100 changes: 98 additions & 2 deletions spec/isodoc/section_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1429,11 +1429,107 @@
<p>This is the first clause</p>
</clause>
</sections>
</itu-standard>`
<annex id="A1" displayorder="4">
<title>
<strong>Annex A</strong>
<br/>
<br/>
<strong>Annex</strong>
</title>
</annex>
<annex id="A2" type="justification" displayorder="5">
<title>
<strong>Annex B</strong>
<br/>
<br/>
<strong>A.13 justification for proposed draft new SG17-C1000 “Main Title”</strong>
</title>
<table class="contribution-metadata" unnumbered="true" width="100%">
<colgroup>
<col width="15.9%"/>
<col width="6.1%"/>
<col width="45.5%"/>
<col width="17.4%"/>
<col width="15.1%"/>
</colgroup>
<tbody>
<tr>
<th align="left">Question(s):</th>
<td/>
<th align="left">Proposed new ITU-T </th>
<td>iKronos, 01 Jan 2000/02 Jan 2000</td>
</tr>
<tr>
<th align="left">Reference and title:</th>
<td colspan="4">Draft new on “Main Title”</td>
</tr>
<tr>
<th>Base text:</th>
<td colspan="2"/>
<th>Timing:</th>
<td/>
</tr>
<tr>
<th rowspan="2">Editor(s):</th>
<td colsoan="2">Fred Flintstone<br/>
Bedrock Quarry<br/>
Canada,
E-mail<tab/>[email protected]
</td>
<th rowspan="2">Approval process:</th>
<td>
<td/>
</td>
<tr>
<td colspan="2">Barney Rubble<br/>
Bedrock Quarry 2<br/>
USA,
E-mail<tab/>[email protected]
</td>
</tr>
<tr>
<td colspan="2"><br/><br/>
,
E-mail<tab/></td>
</tr>
<tr>
<td colspan="5">
<p><strong>Scope</strong> (defines the intent or object of the Recommendation and the aspects covered, thereby indicating the limits of its applicability):</p>
</td>
</tr>
<tr>
<td colspan="5">
<p><strong>Summary</strong> (provides a brief overview of the purpose and contents of the Recommendation, thus permitting readers to judge its usefulness for their work):</p>
</td>
</tr>
<tr>
<td colspan="5">
<p><strong>Relations to ITU-T Recommendations or to other standards</strong> (approved or under development):</p>
</td>
</tr>
<tr>
<td colspan="5">
<p>
<strong>Liaisons with other study groups or with other standards bodies:</strong>
</p>
</td>
</tr>
<tr>
<td colspan="5">
<p>
<strong>Supporting members that are committing to contributing actively to the work item:</strong>
</p>
</td>
</tr>
</tr>
</tbody>
</table>
</annex>
</itu-standard>
OUTPUT
xml = Nokogiri::XML(IsoDoc::ITU::PresentationXMLConvert.new(presxml_options)
.convert("test", input, true))
xml = xml.xpath("//xmlns:preface | //xmlns:sections").to_xml
xml = xml.xpath("//xmlns:preface | //xmlns:sections | //xmlns:annex").to_xml
expect(xmlpp(strip_guid("<itu-standard>#{xml}</itu-standard>")))
.to be_equivalent_to xmlpp(presxml)

Expand Down

0 comments on commit 5d09396

Please sign in to comment.