Sha256: c68020953064066b087437d3a7848c22946894b6aeaa74230dc03026af19025d
Contents?: true
Size: 1.2 KB
Versions: 16
Compression:
Stored size: 1.2 KB
Contents
module Liquid class Quote < DmCore::LiquidBlock #------------------------------------------------------------------------------ def render(context) @attributes.reverse_merge! 'class' => '', 'id' => '', 'style' => '', 'author' => '' output = super style = "style='#{@attributes["style"]}'" unless @attributes['style'].blank? dclass = "class='#{@attributes["class"]}'" unless @attributes['class'].blank? id = "id='#{@attributes["id"]}'" unless @attributes['id'].blank? out = "<blockquote #{[id, dclass, style].join(' ')}>" out += output out += "\r\n<footer markdown='0'><cite>#{@attributes['author']}</cite></footer>" unless @attributes['author'].blank? out += "</blockquote>" end def self.details { name: self.tag_name, summary: 'HTML blockquote', category: 'structure', description: <<-END_OF_DESCRIPTION Outpus an HTML 'blockquote' with optional author. You can specify id, class, and style. ~~~ {% quote author: 'Favorite Person', id: some_id, class: some_class, style: some_style %} ...content {% endquote %} ~~~ END_OF_DESCRIPTION } end end Template.register_tag('quote', Quote) end
Version data entries
16 entries across 16 versions & 1 rubygems