Skip to content

Commit

Permalink
Presentation XML refactor, terms: metanorma/isodoc#630
Browse files Browse the repository at this point in the history
  • Loading branch information
opoudjis committed Jan 7, 2025
1 parent 4358a43 commit 9f7160b
Show file tree
Hide file tree
Showing 3 changed files with 891 additions and 750 deletions.
2 changes: 2 additions & 0 deletions Gemfile.devel
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
gem "isodoc", git: "https://github.com/metanorma/isodoc", branch: "feature/presentation-terms"
gem "mn-requirements", git: "https://github.com/metanorma/mn-requirements", branch: "main"
18 changes: 15 additions & 3 deletions lib/isodoc/ogc/presentation_xml_convert.rb
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,20 @@ def ol_depth(node)
%i(arabic alphabet roman alphabet_upper roman_upper)[(idx - 1) % 5]
end

def termsource1(elem)
# KILL
def termsource1xx(elem)
while elem&.next_element&.name == "termsource"
elem << "; #{to_xml(elem.next_element.remove.children)}"
end
elem.children = l10n("[<strong>#{@i18n.source}:</strong> " \
"#{to_xml(elem.children).strip}]")
end

def termsource_label(elem, sources)
elem.replace(l10n("[<strong>#{@i18n.source}:</strong> " \
"#{sources}]"))
end

def bibliography_bibitem_number_skip(bibitem)
implicit_reference(bibitem) ||
bibitem.at(ns(".//docidentifier[@type = 'metanorma-ordinal']")) ||
Expand Down Expand Up @@ -181,13 +187,19 @@ def biblio_ref_entry_code(ordinal, ids, _id, standard, datefn, _bib)
end

def deprecates(elem)
elem << "&#xa0;<span class='DeprecatedLabel'>#{@i18n.deprecated}</span>"
elem.xpath(ns(".//semx[@element = 'deprecates']")).each do |s|
s.next = "&#xa0;<span class='DeprecatedLabel'>#{@i18n.deprecated}</span>"
end
end

def admits(elem)
elem << "&#xa0;<span class='AdmittedLabel'>#{@i18n.admitted}</span>"
elem.xpath(ns(".//semx[@element = 'admitted']")).each do |s|
s.next = "&#xa0;<span class='AdmittedLabel'>#{@i18n.admitted}</span>"
end
end

def designation_boldface(desgn); end

def source_label(elem)
labelled_ancestor(elem) and return
#lbl = "<span class='fmt-element-name'>#{lower2cap @i18n.sourcecode}</span>"
Expand Down
Loading

0 comments on commit 9f7160b

Please sign in to comment.