class Jekyll::WorkflowTag

Same for the workflow tags

Public Class Methods

new(tag_name, text, tokens) click to toggle source
Calls superclass method
# File _plugins/jekyll-tool-tag.rb, line 50
def initialize(tag_name, text, tokens)
  super
  @text = text.strip
end

Public Instance Methods

render(_context) click to toggle source
# File _plugins/jekyll-tool-tag.rb, line 55
def render(_context)
  format = /\[(?<title>.*)\]\((?<url>.*)\)/
  m = @text.match(format)
  # puts "Found #{@text} => #{m[:title]}, #{m[:url]}"

  # It MUST be this format:
  # {% workflow [Main Workflow](topics/x/tutorials/y/material/workflows/main.ga) %}
  "<span class=\"workflow\" data-workflow=\"#{m[:url]}\"><strong>#{m[:title]}</strong> " \
    '<i class="fas fa-share-alt" aria-hidden="true"></i></span>'
end