Class: Markly::Merge::SmartMerger
- Inherits:
-
Markdown::Merge::SmartMerger
- Object
- Markdown::Merge::SmartMerger
- Markly::Merge::SmartMerger
- Defined in:
- lib/markly/merge/smart_merger.rb
Overview
Orchestrates the smart merge process for Markdown files using Markly.
This is a thin wrapper around Markdown::Merge::SmartMerger that:
- Forces the :markly backend
- Sets markly-specific defaults (freeze token, inner_merge_code_blocks)
- Exposes markly-specific options (flags, extensions)
Instance Method Summary collapse
-
#create_file_analysis(content, **opts) ⇒ Markly::Merge::FileAnalysis
Create a FileAnalysis instance for parsing.
-
#destination_parse_error_class ⇒ Class
Returns the DestinationParseError class to use.
-
#initialize(template_content, dest_content, signature_generator: nil, preference: :destination, add_template_only_nodes: false, inner_merge_code_blocks: DEFAULT_INNER_MERGE_CODE_BLOCKS, freeze_token: DEFAULT_FREEZE_TOKEN, flags: ::Markly::DEFAULT, extensions: [:table], match_refiner: nil, node_typing: nil, **options) ⇒ SmartMerger
constructor
Creates a new SmartMerger for intelligent Markdown file merging.
-
#template_parse_error_class ⇒ Class
Returns the TemplateParseError class to use.
Constructor Details
#initialize(template_content, dest_content, signature_generator: nil, preference: :destination, add_template_only_nodes: false, inner_merge_code_blocks: DEFAULT_INNER_MERGE_CODE_BLOCKS, freeze_token: DEFAULT_FREEZE_TOKEN, flags: ::Markly::DEFAULT, extensions: [:table], match_refiner: nil, node_typing: nil, **options) ⇒ SmartMerger
Creates a new SmartMerger for intelligent Markdown file merging.
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/markly/merge/smart_merger.rb', line 98 def initialize( template_content, dest_content, signature_generator: nil, preference: :destination, add_template_only_nodes: false, inner_merge_code_blocks: DEFAULT_INNER_MERGE_CODE_BLOCKS, freeze_token: DEFAULT_FREEZE_TOKEN, flags: ::Markly::DEFAULT, extensions: [:table], match_refiner: nil, node_typing: nil, ** ) super( template_content, dest_content, backend: :markly, signature_generator: signature_generator, preference: preference, add_template_only_nodes: add_template_only_nodes, inner_merge_code_blocks: inner_merge_code_blocks, freeze_token: freeze_token, match_refiner: match_refiner, node_typing: node_typing, flags: flags, extensions: extensions, ** ) end |
Instance Method Details
#create_file_analysis(content, **opts) ⇒ Markly::Merge::FileAnalysis
Create a FileAnalysis instance for parsing.
148 149 150 151 152 153 154 155 156 |
# File 'lib/markly/merge/smart_merger.rb', line 148 def create_file_analysis(content, **opts) FileAnalysis.new( content, freeze_token: opts[:freeze_token], signature_generator: opts[:signature_generator], flags: opts[:flags] || ::Markly::DEFAULT, extensions: opts[:extensions] || [:table], ) end |
#destination_parse_error_class ⇒ Class
Returns the DestinationParseError class to use.
139 140 141 |
# File 'lib/markly/merge/smart_merger.rb', line 139 def destination_parse_error_class DestinationParseError end |
#template_parse_error_class ⇒ Class
Returns the TemplateParseError class to use.
132 133 134 |
# File 'lib/markly/merge/smart_merger.rb', line 132 def template_parse_error_class TemplateParseError end |