Class: Stic::Metadata::HtmlYaml

Inherits:
Yaml show all
Defined in:
lib/stic/metadata/html_yaml.rb

Overview

The HtmlYaml front matter parses YAML meta data from an HTML comment at the beginning of a page:

“‘ <!– title: An Example –><html>… “`

“‘ <!– title: An Example –> <html>… “`

Constant Summary collapse

HTML_YAML_REGEXP =
/\A<!--\s*(?<data>.*?\n?)(-->\s*(\n|$)|^-->\s*\n?)(?<content>.*)\z/m

Constants inherited from Yaml

Yaml::DASHED_YAML_REGEXP

Instance Method Summary collapse

Methods inherited from Yaml

#match, #parse, #preprocess_content, #preprocess_data

Methods inherited from Parser

#parse

Instance Method Details

#regexpObject



21
22
23
# File 'lib/stic/metadata/html_yaml.rb', line 21

def regexp
  HTML_YAML_REGEXP
end