Class: DocTemplate::Tags::OptBreakTag

Inherits:
BaseTag
  • Object
show all
Defined in:
lib/doc_template/tags/opt_break_tag.rb

Constant Summary collapse

TAG_NAME =
'optbreak'
TEMPLATES =
{ default: 'opt_break.html.erb',
gdoc: 'gdoc/opt_break.html.erb' }.freeze

Constants inherited from BaseTag

BaseTag::SOFT_RETURN_RE, BaseTag::UNICODE_SPACES_RE

Instance Attribute Summary

Attributes inherited from BaseTag

#anchor, #content

Instance Method Summary collapse

Methods inherited from BaseTag

#before_tag, #check_tag_soft_return, #content_until_break, #content_until_materials, #ela2?, #ela6?, #gdoc?, #include_break?, #include_break_for?, #materials, parse, #parse_nested, #parse_template, #placeholder, #placeholder_id, #render, #replace_tag, #tag_data, tag_with_html_regexp, #template_name, #template_path, template_path_for

Instance Method Details

#parse(node, opts = {}) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/doc_template/tags/opt_break_tag.rb', line 10

def parse(node, opts = {})
  content = content_until_break node
  parsed_template = parse_template content, template_name(opts)
  @content = parse_nested parsed_template, opts

  replace_tag node

  # add break to agenda
  opts[:agenda].add_break
  self
end