Skip to content

Commit

Permalink
Merge pull request #212 from metanorma/fix/presxml-oct24
Browse files Browse the repository at this point in the history
refactor termdomain from upstream: https://github.com/metanorma/isodo…
  • Loading branch information
opoudjis authored Nov 10, 2024
2 parents bf56313 + e6d2624 commit 78d049e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Gemfile.devel
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
gem "metanorma-standoc", git: "https://github.com/metanorma/metanorma-standoc", branch: "main"
gem "isodoc", git: "https://github.com/metanorma/isodoc", branch: "fix/presxml-oct24"
4 changes: 4 additions & 0 deletions lib/isodoc/ietf/references.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ def bibliography_prep(docxml)
i18nhash: @i18n.get)
end

def implicit_reference(bib)
bib["hidden"] == "true"
end

def bibliography1(node, out)
out.references **attr_code(anchor: node["id"]) do |div|
title = node.at(ns("./title")) and div.name do |name|
Expand Down
15 changes: 14 additions & 1 deletion lib/isodoc/ietf/terms.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
module IsoDoc
module Ietf
class RfcConvert < ::IsoDoc::Convert
def set_termdomain(termdomain)
@termdomain = termdomain
end

def definition_parse(node, out)
node.children.each { |n| parse(n, out) }
end
Expand All @@ -27,6 +31,10 @@ def admitted_term_parse(node, out)
end

def term_parse(node, out)
if domain = node.at(ns("./domain"))
set_termdomain(domain.text)
domain["hidden"] = "true"
end
name = node.at(ns(".//name"))
out.name do |p|
name.children.each { |n| parse(n, p) }
Expand All @@ -38,7 +46,12 @@ def termnote_parse(node, out)
end

def termdef_parse(node, out)
set_termdomain("")
if domain = node.at(ns("./domain"))
set_termdomain(domain.text)
domain["hidden"] = "true"
else
set_termdomain("")
end
node.xpath(ns("./definition")).size > 1 and
@isodoc.multidef(node)
clause_parse(node, out)
Expand Down

0 comments on commit 78d049e

Please sign in to comment.