Sha256: 75bc1327fafb26aec9488128ebf80a16b109881f6fd9dfda1fa4b64243dbeff8

Contents?: true

Size: 1.22 KB

Versions: 20

Compression:

Stored size: 1.22 KB

Contents

module IsoDoc
  module Function
    module Blocks
      def recommendation_name(name, out)
        return if name.nil?

        out.p **{ class: "RecommendationTitle" } do |p|
          name.children.each { |n| parse(n, p) }
        end
      end

      def reqt_attrs(node, klass)
        attr_code(class: klass, id: node["id"], style: keep_style(node))
      end

      def recommendation_parse(node, out)
        out.div **reqt_attrs(node, "recommend") do |t|
          recommendation_parse1(node, t)
        end
      end

      def recommendation_parse1(node, out)
        recommendation_name(node.at(ns("./name")), out)
        node.children.each do |n|
          parse(n, out) unless n.name == "name"
        end
      end

      def requirement_parse(node, out)
        out.div **reqt_attrs(node, "require") do |t|
          recommendation_parse1(node, t)
        end
      end

      def permission_parse(node, out)
        out.div **reqt_attrs(node, "permission") do |t|
          recommendation_parse1(node, t)
        end
      end

      def div_parse(node, out)
        out.div **reqt_attrs(node, node["type"]) do |t|
          node.children.each do |n|
            parse(n, t)
          end
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
isodoc-2.5.1 lib/isodoc/function/reqt.rb
isodoc-2.5.0 lib/isodoc/function/reqt.rb
isodoc-2.4.5 lib/isodoc/function/reqt.rb
isodoc-2.4.4 lib/isodoc/function/reqt.rb
isodoc-2.4.3 lib/isodoc/function/reqt.rb
isodoc-2.4.2 lib/isodoc/function/reqt.rb
isodoc-2.4.1 lib/isodoc/function/reqt.rb
isodoc-2.4.0 lib/isodoc/function/reqt.rb
isodoc-2.3.6 lib/isodoc/function/reqt.rb
isodoc-2.3.5 lib/isodoc/function/reqt.rb
isodoc-2.3.4.1 lib/isodoc/function/reqt.rb
isodoc-2.3.4 lib/isodoc/function/reqt.rb
isodoc-2.3.3 lib/isodoc/function/reqt.rb
isodoc-2.3.2 lib/isodoc/function/reqt.rb
isodoc-2.3.1 lib/isodoc/function/reqt.rb
isodoc-2.3.0 lib/isodoc/function/reqt.rb
isodoc-2.2.3.1 lib/isodoc/function/reqt.rb
isodoc-2.2.3 lib/isodoc/function/reqt.rb
isodoc-2.2.2.2 lib/isodoc/function/reqt.rb
isodoc-2.2.1 lib/isodoc/function/reqt.rb