Sha256: 09c23bd8f7c29bce4f78eae43bfac3316737536798b2d0e6201c6ad5efc8b5d2
Contents?: true
Size: 975 Bytes
Versions: 20
Compression:
Stored size: 975 Bytes
Contents
# frozen_string_literal: true require "reverse_adoc/converters/figure" module Stepmod module Utils module Converters class Figure < ReverseAdoc::Converters::Figure def self.pattern(state, id) if state[:schema_and_entity].nil? raise StandardError.new("[figure]: no state given, #{id}") end schema = state[:schema_and_entity].split(".").first "figure-#{schema}-#{id}" end def convert(node, state = {}) # If we want to skip this node return "" if state[:no_notes_examples] # Set ID to "figure-id" in case of conflicts node['id'] = if node['id'] self.class.pattern(state, node['id']) else self.class.pattern(state, node['number']) end super(node, state) end end # This replaces the converter ReverseAdoc::Converters.register :figure, Figure.new end end end
Version data entries
20 entries across 20 versions & 1 rubygems