Sha256: 743b058c02404171fb3f515e6005ced4d35346209cce7dec4bb75dd9b49d0d29
Contents?: true
Size: 876 Bytes
Versions: 2
Compression:
Stored size: 876 Bytes
Contents
# frozen_string_literal: true module Stepmod module Utils module Converters class ModuleRef < ReverseAsciidoctor::Converters::Base def convert(node, _state = {}) ref = node['linkend'] # #23: # In this case when we see this: # <module_ref linkend="product_as_individual:3_definition">individual products</module_ref> # We take the text value of the element and convert to this: # term:[individual products] if node['linkend'].split(':').length > 1 ref = node.text end " term:[#{normalized_ref(ref)}] " end private def normalized_ref(ref) return unless ref || ref.empty? ref.squeeze(' ').strip end end ReverseAsciidoctor::Converters.register :module_ref, ModuleRef.new end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
stepmod-utils-0.1.5 | lib/stepmod/utils/converters/module_ref.rb |
stepmod-utils-0.1.4 | lib/stepmod/utils/converters/module_ref.rb |