Sha256: 7ec969d1f6ab32c306e2f282c4c5de3eb72de47fba3ee1bf9e550c2042fb76b3
Contents?: true
Size: 709 Bytes
Versions: 2
Compression:
Stored size: 709 Bytes
Contents
require "redcarpet" require "rouge" module Lookbook module ApplicationHelper def config Lookbook::Engine.config.lookbook end def markdown(text) markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, { tables: true, fenced_code_blocks: true, disable_indented_code_blocks: true }) markdown.render(text).html_safe end def highlight(source, language) formatter = Rouge::Formatters::HTML.new(css_class: "highlight") lexer = Rouge::Lexer.find(language) formatter.format(lexer.lex(source)).html_safe end def nav_padding_style(depth) "padding-left: calc((#{depth - 1} * 12px) + 0.5rem);" end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
lookbook-0.4.6 | app/helpers/lookbook/application_helper.rb |
lookbook-0.4.5 | app/helpers/lookbook/application_helper.rb |