Skip to content

Commit

Permalink
debug: remove fmt-related//xref: metanorma/isodoc#632
Browse files Browse the repository at this point in the history
  • Loading branch information
opoudjis committed Jan 7, 2025
1 parent d78bfd8 commit b65b9ec
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 22 deletions.
20 changes: 18 additions & 2 deletions lib/isodoc/ieee/presentation_terms.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ def related_term(term)
#require "debug"; binding.b
#coll = term_related_reorder(term.xpath(ns("./fmt-related/semx")))
r = term.at(ns("./fmt-related"))
r.xpath(ns(".//xref | .//eref | .//termref")).each(&:remove)
coll = sort_related(r.xpath(ns("./semx")))
r.children = term_related_collapse(coll)
end
Expand Down Expand Up @@ -248,6 +249,20 @@ def admitted_to_related1(adm, pref, out)
TERM
end

#KILL
def related1(node)
require "debug"; binding.b
p, ref, orig = related1_prep(node)
label = @i18n.relatedterms[orig["type"]].upcase
if p
node.children =(l10n("<p><strong>#{label}:</strong> " \
"<em>#{to_xml(p)}</em></p>"))
else
node.children = (l10n("<p><strong>#{label}:</strong> " \
"<strong>**RELATED TERM NOT FOUND**</strong></p>"))
end
end

def term_reorder(xmldoc)
xmldoc.xpath(ns("//terms")).each { |t| term_reorder1(t) }
end
Expand Down Expand Up @@ -370,7 +385,8 @@ def collapse_unwrap_definition(defn)
[defn.elements, multiblock]
end

def termsource1(elem)
# KILL
def termsource1xx(elem)
while elem&.next_element&.name == "termsource"
elem << "; #{to_xml(elem.next_element.remove.children)}"
end
Expand All @@ -380,7 +396,7 @@ def termsource1(elem)

def termsource_label(elem, sources)
adapt = termsource_adapt(elem["status"]) and
s = "#{adapt}#{sources}"
sources = "#{adapt}#{sources}"
elem.replace(l10n(sources))
end

Expand Down
20 changes: 0 additions & 20 deletions spec/isodoc/terms_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2656,11 +2656,6 @@
, n
</semx>
</fmt-preferred>
<xref target="second">
<semx element="autonum" source="A">1</semx>
<span class="fmt-autonum-delim">.</span>
<semx element="autonum" source="second">1</semx>
</xref>
</semx>
;
<semx element="related" source="_">
Expand All @@ -2678,11 +2673,6 @@
, n
</semx>
</fmt-preferred>
<xref target="second">
<semx element="autonum" source="A">1</semx>
<span class="fmt-autonum-delim">.</span>
<semx element="autonum" source="second">1</semx>
</xref>
</semx>
.
<em>Syn:</em>
Expand Down Expand Up @@ -2710,11 +2700,6 @@
, n
</semx>
</fmt-preferred>
<xref target="second">
<semx element="autonum" source="A">1</semx>
<span class="fmt-autonum-delim">.</span>
<semx element="autonum" source="second">1</semx>
</xref>
</semx>
.
</p>
Expand Down Expand Up @@ -2844,11 +2829,6 @@
<em>Contrast:</em>
<semx element="related" source="_">
**RELATED TERM NOT FOUND**
<xref target="second">
<semx element="autonum" source="A">1</semx>
<span class="fmt-autonum-delim">.</span>
<semx element="autonum" source="second">2</semx>
</xref>
</semx>
.
<em>See also:</em>
Expand Down

0 comments on commit b65b9ec

Please sign in to comment.