Sha256: e3713fa08e9c3401468f0a456ebc3d23fa0c477f15c4af5f506a4cd2a8a6b1a6
Contents?: true
Size: 830 Bytes
Versions: 25
Compression:
Stored size: 830 Bytes
Contents
require 'middleman-core/renderers/redcarpet' module GovukTechDocs class TechDocsHTMLRenderer < Middleman::Renderers::MiddlemanRedcarpetHTML include Redcarpet::Render::SmartyPants def initialize(options = {}) @local_options = options.dup @app = @local_options[:context].app super end def paragraph(text) @app.api("<p>#{text.strip}</p>\n") end def header(text, level) anchor = UniqueIdentifierGenerator.instance.create(text, level) %(<h#{level} id="#{anchor}">#{text}</h#{level}>) end def image(link, *args) %(<a href="#{link}" target="_blank" rel="noopener noreferrer">#{super}</a>) end def table(header, body) %(<div class="table-container"> <table> #{header}#{body} </table> </div>) end end end
Version data entries
25 entries across 25 versions & 2 rubygems