app/helpers/lookbook/output_helper.rb in lookbook-0.9.8 vs app/helpers/lookbook/output_helper.rb in lookbook-1.0.0.beta.0
- old
+ new
@@ -2,14 +2,18 @@
module OutputHelper
def markdown(text = nil, &block)
Lookbook::Markdown.render(block ? capture(&block) : text)
end
- def highlight(source, language, opts = {})
- Lookbook::CodeFormatter.highlight(source, language, opts)
+ def highlight(source, **opts)
+ Lookbook::CodeFormatter.highlight(source, **opts)
end
- def beautify(source, language = "html")
- Lookbook::CodeFormatter.beautify(source, language)
+ def beautify(source, **opts)
+ Lookbook::CodeFormatter.beautify(source, **opts)
+ end
+
+ def pretty_json(obj)
+ JSON.pretty_generate(obj)
end
end
end