Class: MarkdownRecord::Rendering::Nodes::HtmlFile
- Defined in:
- lib/markdown_record/rendering/nodes/html_file.rb
Constant Summary
Constants inherited from HtmlBase
MarkdownRecord::Rendering::Nodes::HtmlBase::HTML_MACROS, MarkdownRecord::Rendering::Nodes::HtmlBase::HTML_SUBSTITUTIONS
Constants included from ContentDsl
ContentDsl::HTML_COMMENT_REGEX
Constants included from ContentDsl::Enable
ContentDsl::Enable::ENCODED_REGEX, ContentDsl::Enable::REGEX
Constants included from ContentDsl::Disable
ContentDsl::Disable::ENCODED_REGEX, ContentDsl::Disable::REGEX
Constants included from ContentDsl::UseLayout
ContentDsl::UseLayout::ENCODED_REGEX, ContentDsl::UseLayout::REGEX
Constants included from ContentDsl::Fragment
ContentDsl::Fragment::ENCODED_REGEX, ContentDsl::Fragment::REGEX
Constants included from ContentDsl::DirectoryFragment
ContentDsl::DirectoryFragment::ENCODED_REGEX, ContentDsl::DirectoryFragment::REGEX
Constants included from ContentDsl::EndModel
ContentDsl::EndModel::ENCODED_REGEX, ContentDsl::EndModel::REGEX
Constants included from ContentDsl::EndAttribute
ContentDsl::EndAttribute::ENCODED_REGEX, ContentDsl::EndAttribute::REGEX
Constants included from ContentDsl::Attribute
ContentDsl::Attribute::ENCODED_REGEX, ContentDsl::Attribute::REGEX
Constants included from ContentDsl::Model
ContentDsl::Model::ENCODED_REGEX, ContentDsl::Model::REGEX
Constants included from ContentDsl::Scope
ContentDsl::Scope::ENCODED_REGEX, ContentDsl::Scope::REGEX
Instance Attribute Summary
Attributes inherited from HtmlBase
#name, #processed_html, #rendered_html
Instance Method Summary collapse
- #concatenated_html ⇒ Object
- #custom_layout(html) ⇒ Object
- #file_layout ⇒ Object
- #layout ⇒ Object
- #raw_content ⇒ Object
- #render(file_saver) ⇒ Object
- #render_html ⇒ Object
Methods inherited from HtmlBase
#finalize_html, #global_layout, #initialize, #load_layout, #process_html, #render_erb, #render_erbs, #save, #sort_value
Methods included from ContentDsl
#remove_html_dsl_command, #remove_json_dsl_commands
Methods included from ContentDsl::Enable
Methods included from ContentDsl::Disable
Methods included from ContentDsl::UseLayout
Methods included from ContentDsl::Fragment
Methods included from ContentDsl::DirectoryFragment
#directory_fragment_dsl, remove_dsl
Methods included from ContentDsl::EndModel
Methods included from ContentDsl::EndAttribute
#end_attribute_dsl, remove_dsl
Methods included from ContentDsl::Attribute
Methods included from ContentDsl::Model
Methods included from ContentDsl::Scope
Methods included from PathUtilities
#base_content_root_name, #base_rendered_path, #base_rendered_root, #clean_path, #erb_locals_from_path, #fragment_attributes_from_path, #full_path_to_parts, #path_to_fragment_id, #remove_prefix, #rendered_path, #scoped_id_to_parts, #to_scoped_id
Constructor Details
This class inherits a constructor from MarkdownRecord::Rendering::Nodes::HtmlBase
Instance Method Details
#concatenated_html ⇒ Object
26 27 28 |
# File 'lib/markdown_record/rendering/nodes/html_file.rb', line 26 def concatenated_html @processed_html end |
#custom_layout(html) ⇒ Object
34 35 36 37 38 39 |
# File 'lib/markdown_record/rendering/nodes/html_file.rb', line 34 def custom_layout(html) cust_layout = use_layout_dsl(html) return nil unless cust_layout load_layout(cust_layout) end |
#file_layout ⇒ Object
41 42 43 44 |
# File 'lib/markdown_record/rendering/nodes/html_file.rb', line 41 def file_layout file_layout_path = ::MarkdownRecord.config.file_layout_path @file_layout ||= file_layout_path ? load_layout(file_layout_path) : nil end |
#layout ⇒ Object
30 31 32 |
# File 'lib/markdown_record/rendering/nodes/html_file.rb', line 30 def layout @layout ||= custom_layout(@rendered_html) || file_layout end |
#raw_content ⇒ Object
22 23 24 |
# File 'lib/markdown_record/rendering/nodes/html_file.rb', line 22 def raw_content @raw_content ||= File.read(@pathname) end |
#render(file_saver) ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'lib/markdown_record/rendering/nodes/html_file.rb', line 6 def render(file_saver) render_html process_html finalize_html if [:deep] save(file_saver) end end |
#render_html ⇒ Object
16 17 18 19 20 |
# File 'lib/markdown_record/rendering/nodes/html_file.rb', line 16 def render_html html = @markdown.render(raw_content) html = remove_json_dsl_commands(html) @rendered_html = html end |