Sha256: fa71d02a8c038af1cc4820e129fddd0e08bc06159b8b42864b43152e12e55334
Contents?: true
Size: 553 Bytes
Versions: 15
Compression:
Stored size: 553 Bytes
Contents
prepend Actions on 'index' do @base = Utopia::Project::Base.instance if readme_path = @base.path_for('README.md') @document = Kramdown::Document.new(File.read(readme_path), syntax_highlighter: nil) start = @document.root.children.index{|node| node.children.first&.value == "Usage"} finish = start + 1 while node = @document.root.children[finish] if node.type == :header break else finish += 1 end end @document.root.children[start...finish] = [ Kramdown::Element.new(:raw, "<content:usage/>") ] end end
Version data entries
15 entries across 15 versions & 1 rubygems