Class: Jekyll::Heroicons
- Inherits:
-
Liquid::Tag
- Object
- Liquid::Tag
- Jekyll::Heroicons
- Includes:
- LiquidExtensions
- Defined in:
- lib/jekyll-heroicons.rb,
lib/jekyll-heroicons/icon.rb,
lib/jekyll-heroicons/version.rb
Defined Under Namespace
Classes: Icon
Constant Summary collapse
- DEFAULT_VARIANT =
In case no variant is specified, use solid as default
"solid"- SYNTAX =
Syntax for the heroicon symbol
/\A(#{Liquid::VariableSignature}+)/- VARIABLE =
For interpolation, look for liquid variables
/\{\{\s*(\w+\.?\w*)\s*\}\}/i- TAG_ATTRIBUTES =
Copied from Liquid::TagAttributes to allow dashes in tag names:
{% heroicon alert area-label:"Hello World!" %} /([\w-]+)\s*:\s*(#{Liquid::QuotedFragment})/o- VERSION =
"0.4.2"
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(tag_name, markup, options) ⇒ Heroicons
constructor
A new instance of Heroicons.
- #render(context) ⇒ Object
Constructor Details
#initialize(tag_name, markup, options) ⇒ Heroicons
Returns a new instance of Heroicons.
31 32 33 34 35 36 37 |
# File 'lib/jekyll-heroicons.rb', line 31 def initialize(tag_name, markup, ) super @markup = markup # If there's interpolation going on, we need to do this in render prepare(markup) unless markup.match(VARIABLE) end |
Class Method Details
.root ⇒ Object
12 13 14 |
# File 'lib/jekyll-heroicons.rb', line 12 def self.root File.dirname(__dir__) end |