Sha256: 20b44ff806d9ecf2c685dee1274203fc7a0e986efc926508a514a42b457b6813
Contents?: true
Size: 516 Bytes
Versions: 4
Compression:
Stored size: 516 Bytes
Contents
# frozen_string_literal: true module Components class Markdown < Phlex::Markdown def code(&content) render CodeSpan.new, &content end def code_block(code, language:) render CodeBlock.new(code.gsub(/(?:^|\G) {4}/m, " "), syntax: language) end def h1(&content) render Title.new, &content end def h2(&content) render Heading.new, &content end def a(**attributes, &content) super(class: "font-bold text-red-600 underline underline-offset-4", **attributes, &content) end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
phlex-0.5.3 | docs/components/markdown.rb |
phlex-0.5.2 | docs/components/markdown.rb |
phlex-0.5.1 | docs/components/markdown.rb |
phlex-0.5.0 | docs/components/markdown.rb |