Sha256: ad7983e0385afeadec35692fdaeb1d8d299330c7dc0c0face9fd4cfff9eca022

Contents?: true

Size: 646 Bytes

Versions: 20

Compression:

Stored size: 646 Bytes

Contents

# frozen_string_literal: true

module Metanorma
  module Plugin
    module Lutaml
      class LutamlFigureInlineMacro < ::Asciidoctor::Extensions::InlineMacroProcessor
        include LutamlDiagramBase

        use_dsl
        named :lutaml_figure

        def process(parent, _target, attrs)
          diagram_key = [attrs["package"], attrs["name"]].compact.join(":")
          return if parent.document.attributes["lutaml_figure_id"].nil?

          xmi_id = parent.document.attributes["lutaml_figure_id"][diagram_key]
          return unless xmi_id

          %(<xref target="figure-#{xmi_id}"></xref>)
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
metanorma-plugin-lutaml-0.7.16 lib/metanorma/plugin/lutaml/lutaml_figure_inline_macro.rb
metanorma-plugin-lutaml-0.7.15 lib/metanorma/plugin/lutaml/lutaml_figure_inline_macro.rb
metanorma-plugin-lutaml-0.7.14 lib/metanorma/plugin/lutaml/lutaml_figure_inline_macro.rb
metanorma-plugin-lutaml-0.7.13 lib/metanorma/plugin/lutaml/lutaml_figure_inline_macro.rb
metanorma-plugin-lutaml-0.7.12 lib/metanorma/plugin/lutaml/lutaml_figure_inline_macro.rb
metanorma-plugin-lutaml-0.7.11 lib/metanorma/plugin/lutaml/lutaml_figure_inline_macro.rb
metanorma-plugin-lutaml-0.7.10 lib/metanorma/plugin/lutaml/lutaml_figure_inline_macro.rb
metanorma-plugin-lutaml-0.7.9 lib/metanorma/plugin/lutaml/lutaml_figure_inline_macro.rb
metanorma-plugin-lutaml-0.7.8 lib/metanorma/plugin/lutaml/lutaml_figure_inline_macro.rb
metanorma-plugin-lutaml-0.7.7 lib/metanorma/plugin/lutaml/lutaml_figure_inline_macro.rb
metanorma-plugin-lutaml-0.7.6 lib/metanorma/plugin/lutaml/lutaml_figure_inline_macro.rb
metanorma-plugin-lutaml-0.7.5 lib/metanorma/plugin/lutaml/lutaml_figure_inline_macro.rb
metanorma-plugin-lutaml-0.7.4 lib/metanorma/plugin/lutaml/lutaml_figure_inline_macro.rb
metanorma-plugin-lutaml-0.7.3 lib/metanorma/plugin/lutaml/lutaml_figure_inline_macro.rb
metanorma-plugin-lutaml-0.7.2 lib/metanorma/plugin/lutaml/lutaml_figure_inline_macro.rb
metanorma-plugin-lutaml-0.7.1 lib/metanorma/plugin/lutaml/lutaml_figure_inline_macro.rb
metanorma-plugin-lutaml-0.7.0 lib/metanorma/plugin/lutaml/lutaml_figure_inline_macro.rb
metanorma-plugin-lutaml-0.6.6 lib/metanorma/plugin/lutaml/lutaml_figure_inline_macro.rb
metanorma-plugin-lutaml-0.6.0 lib/metanorma/plugin/lutaml/lutaml_figure_inline_macro.rb
metanorma-plugin-lutaml-0.5.0 lib/metanorma/plugin/lutaml/lutaml_figure_inline_macro.rb