module Fronde::OrgFileHtmlizer

This module holds HTML formatter methods for the {Fronde::OrgFile} class.

Private Instance Methods

author_to_html() click to toggle source

Format {Fronde::OrgFile#author} in a HTML `span` tag with a

specific class.

@return [String] the author HTML `span`

# File lib/fronde/org_file/htmlizer.rb, line 39
def author_to_html
  "<span class=\"author\">#{@author}</span>"
end
date_to_html(dateformat = :full) click to toggle source

Format {Fronde::OrgFile#date} as a HTML `time` tag.

@return [String] the HTML `time` tag

# File lib/fronde/org_file/htmlizer.rb, line 30
def date_to_html(dateformat = :full)
  return '<time></time>' if @date.nil?
  "<time datetime=\"#{@date.rfc3339}\">#{datestring(dateformat)}</time>"
end
keywords_to_html() click to toggle source

Format {Fronde::OrgFile#keywords} list in an HTML listing.

@return [String] the HTML keywords list

# File lib/fronde/org_file/htmlizer.rb, line 15
    def keywords_to_html
      domain = Fronde::Config.settings['domain']
      klist = @keywords.map do |k|
        <<~KEYWORDLINK
          <li class="keyword">
            <a href="#{domain}/tags/#{Fronde::OrgFile.slug(k)}.html">#{k}</a>
          </li>
        KEYWORDLINK
      end.join
      "<ul class=\"keywords-list\">#{klist}</ul>"
    end