diff --git a/lib/inky.rb b/lib/inky.rb index 4528251..8c936f1 100644 --- a/lib/inky.rb +++ b/lib/inky.rb @@ -20,7 +20,8 @@ def initialize(options = {}) callout: 'callout', spacer: 'spacer', wrapper: 'wrapper', - menu_item: 'item' + menu_item: 'item', + h_line: 'h-line', }.merge(::Inky.configuration.components).merge(options[:components] || {}) self.component_lookup = components.invert diff --git a/lib/inky/component_factory.rb b/lib/inky/component_factory.rb index 644f150..0f9b0e7 100644 --- a/lib/inky/component_factory.rb +++ b/lib/inky/component_factory.rb @@ -141,6 +141,12 @@ def _transform_spacer(component, _inner) end end + def _transform_h_line(component, _inner) + classes = _combine_classes(component, 'h-line') + attributes = _pass_through_attributes(component) + %{
 
} + end + def _transform_wrapper(component, inner) attributes = _combine_attributes(component, 'wrapper') %{
#{inner}
} diff --git a/spec/cases/h_line/basic.inky b/spec/cases/h_line/basic.inky new file mode 100644 index 0000000..abb7f75 --- /dev/null +++ b/spec/cases/h_line/basic.inky @@ -0,0 +1 @@ + diff --git a/spec/cases/h_line/multiple.inky b/spec/cases/h_line/multiple.inky new file mode 100644 index 0000000..79f4593 --- /dev/null +++ b/spec/cases/h_line/multiple.inky @@ -0,0 +1,8 @@ + +Hello + +World + +Bye + +Zzz diff --git a/spec/cases/h_line/with_attr.inky b/spec/cases/h_line/with_attr.inky new file mode 100644 index 0000000..03ec99a --- /dev/null +++ b/spec/cases/h_line/with_attr.inky @@ -0,0 +1,2 @@ + +