markdown-ui 0.1.14 → 0.1.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/Changelog +8 -1
  3. data/Gemfile +28 -10
  4. data/TODO.md +1 -1
  5. data/components/collections/markdown-ui-grid/Gemfile +1 -1
  6. data/components/collections/markdown-ui-grid/markdown-ui-grid.gemspec +15 -15
  7. data/components/collections/markdown-ui-menu/Gemfile +1 -1
  8. data/components/collections/markdown-ui-menu/lib/menu/custom.rb +0 -1
  9. data/components/collections/markdown-ui-menu/markdown-ui-menu.gemspec +15 -15
  10. data/components/collections/markdown-ui-message/Gemfile +1 -1
  11. data/components/collections/markdown-ui-message/lib/message/custom_message.rb +0 -1
  12. data/components/collections/markdown-ui-message/markdown-ui-message.gemspec +15 -15
  13. data/components/elements/markdown-ui-button/Gemfile +1 -1
  14. data/components/elements/markdown-ui-button/lib/button/animated.rb +2 -2
  15. data/components/elements/markdown-ui-button/lib/button/custom.rb +0 -1
  16. data/components/elements/markdown-ui-button/lib/button/element.rb +19 -15
  17. data/components/elements/markdown-ui-button/lib/button/group/buttons/element.rb +1 -1
  18. data/components/elements/markdown-ui-button/markdown-ui-button.gemspec +15 -15
  19. data/components/elements/markdown-ui-container/Gemfile +1 -1
  20. data/components/elements/markdown-ui-container/lib/container/element.rb +1 -1
  21. data/components/elements/markdown-ui-container/markdown-ui-container.gemspec +15 -15
  22. data/components/elements/markdown-ui-content/Gemfile +1 -1
  23. data/components/elements/markdown-ui-content/lib/content/divider_block.rb +1 -1
  24. data/components/elements/markdown-ui-content/lib/content/field_block.rb +1 -1
  25. data/components/elements/markdown-ui-content/lib/content/form_block.rb +1 -1
  26. data/components/elements/markdown-ui-content/lib/content/header.rb +1 -1
  27. data/components/elements/markdown-ui-content/lib/content/icon.rb +2 -2
  28. data/components/elements/markdown-ui-content/lib/content/input_block.rb +1 -1
  29. data/components/elements/markdown-ui-content/lib/content/item.rb +1 -1
  30. data/components/elements/markdown-ui-content/lib/content/item_block.rb +1 -1
  31. data/components/elements/markdown-ui-content/lib/content/list.rb +1 -1
  32. data/components/elements/markdown-ui-content/lib/content/parser.rb +31 -23
  33. data/components/elements/markdown-ui-content/markdown-ui-content.gemspec +15 -15
  34. data/components/elements/markdown-ui-header/Gemfile +1 -1
  35. data/components/elements/markdown-ui-header/lib/header/header.rb +5 -5
  36. data/components/elements/markdown-ui-header/markdown-ui-header.gemspec +15 -15
  37. data/components/elements/markdown-ui-input/Gemfile +1 -1
  38. data/components/elements/markdown-ui-input/lib/input/custom.rb +0 -1
  39. data/components/elements/markdown-ui-input/markdown-ui-input.gemspec +15 -15
  40. data/components/elements/markdown-ui-label/Gemfile +1 -1
  41. data/components/elements/markdown-ui-label/lib/label/custom.rb +0 -1
  42. data/components/elements/markdown-ui-label/markdown-ui-label.gemspec +15 -15
  43. data/components/elements/markdown-ui-segment/Gemfile +1 -1
  44. data/components/elements/markdown-ui-segment/lib/segment/segment.rb +17 -13
  45. data/components/elements/markdown-ui-segment/markdown-ui-segment.gemspec +15 -15
  46. data/exe/markdown-ui +11 -11
  47. data/exe/markdown-ui-shell +31 -0
  48. data/lib/markdown-ui.rb +47 -43
  49. data/lib/markdown-ui/tag/button_tag.rb +2 -2
  50. data/lib/markdown-ui/tag/focusable_button_tag.rb +3 -3
  51. data/lib/markdown-ui/tag/input_tag.rb +3 -3
  52. data/lib/markdown-ui/tag/item_tag.rb +2 -2
  53. data/lib/markdown-ui/tag/label_tag.rb +2 -2
  54. data/lib/markdown-ui/tag/list_tag.rb +2 -2
  55. data/lib/markdown-ui/tag/span_tag.rb +1 -1
  56. data/lib/markdown-ui/tag/standard_tag.rb +2 -2
  57. data/lib/markdown-ui/utils/klass_util.rb +1 -1
  58. data/lib/markdown-ui/version.rb +1 -1
  59. data/markdown-ui.gemspec +2 -1
  60. data/website/about.html +8 -8
  61. data/website/docs/button.html +8 -8
  62. data/website/docs/container.html +26 -23
  63. data/website/docs/divider.html +8 -8
  64. data/website/docs/toc.html +8 -8
  65. data/website/index.html +42 -27
  66. data/website/index.md +38 -20
  67. metadata +19 -3
@@ -1,2 +1,2 @@
1
- source "https://rubygems.org"
1
+ source 'https://rubygems.org'
2
2
  gemspec
@@ -16,4 +16,4 @@ module MarkdownUI
16
16
  end
17
17
  end
18
18
  end
19
- end
19
+ end
@@ -16,4 +16,4 @@ module MarkdownUI
16
16
  end
17
17
  end
18
18
  end
19
- end
19
+ end
@@ -16,4 +16,4 @@ module MarkdownUI
16
16
  end
17
17
  end
18
18
  end
19
- end
19
+ end
@@ -9,7 +9,7 @@ module MarkdownUI
9
9
  end
10
10
 
11
11
  def render
12
- klass = "#{@klass} header"
12
+ klass = "ui #{@klass} header"
13
13
  content = @content.strip
14
14
 
15
15
  MarkdownUI::StandardTag.new(content, klass).render
@@ -13,9 +13,9 @@ module MarkdownUI
13
13
  klass = MarkdownUI::KlassUtil.new("#{@content} #{@klass} icon").klass
14
14
 
15
15
  output = []
16
- output << "<i"
16
+ output << '<i'
17
17
  output << klass
18
- output << "></i>"
18
+ output << '></i>'
19
19
 
20
20
  output.join
21
21
  end
@@ -16,4 +16,4 @@ module MarkdownUI
16
16
  end
17
17
  end
18
18
  end
19
- end
19
+ end
@@ -10,7 +10,7 @@ module MarkdownUI
10
10
  end
11
11
 
12
12
  def render
13
- klass = "#{@klass} item"
13
+ klass = "ui #{@klass} item"
14
14
  content = @content.strip
15
15
  link = @link
16
16
 
@@ -16,4 +16,4 @@ module MarkdownUI
16
16
  end
17
17
  end
18
18
  end
19
- end
19
+ end
@@ -11,7 +11,7 @@ module MarkdownUI
11
11
  end
12
12
 
13
13
  def render
14
- klass = "#{@klass} list"
14
+ klass = "ui #{@klass} list"
15
15
  content = @content.strip
16
16
  type = @type
17
17
  data = @data
@@ -22,7 +22,11 @@ module MarkdownUI
22
22
  content = if !(@content =~ /\:/).nil?
23
23
  @content.split(':')
24
24
  else
25
- @content.split("\n")
25
+ if @content
26
+ @content.split('\n')
27
+ else
28
+ ['']
29
+ end
26
30
  end
27
31
 
28
32
  process(content)
@@ -33,29 +37,33 @@ module MarkdownUI
33
37
  content_type, actual_content = content[0], content[1]
34
38
  klass = content[2] if content.size > 2
35
39
 
36
- mode = OpenStruct.new(
37
- :text? => !(content_type =~ /text/i).nil?,
38
- :icon? => !(content_type =~ /icon/i).nil?,
39
- :flag? => !(content_type =~ /flag/i).nil?,
40
- :image? => !(content_type =~ /image/i).nil?,
41
- :header? => !(content_type =~ /header/i).nil?,
42
- :list? => !(content_type =~ /list/i).nil?,
43
- :unordered? => !(content_type =~ /unordered/i).nil?,
44
- :ordered? => !(content_type =~ /ordered/i).nil?
45
- )
40
+ if actual_content
41
+ mode = OpenStruct.new(
42
+ :text? => !(content_type =~ /text/i).nil?,
43
+ :icon? => !(content_type =~ /icon/i).nil?,
44
+ :flag? => !(content_type =~ /flag/i).nil?,
45
+ :image? => !(content_type =~ /image/i).nil?,
46
+ :header? => !(content_type =~ /header/i).nil?,
47
+ :list? => !(content_type =~ /list/i).nil?,
48
+ :unordered? => !(content_type =~ /unordered/i).nil?,
49
+ :ordered? => !(content_type =~ /ordered/i).nil?
50
+ )
46
51
 
47
- if mode.text?
48
- MarkdownUI::Content::Text.new(actual_content, klass).render
49
- elsif mode.icon?
50
- MarkdownUI::Content::Icon.new(actual_content, klass).render
51
- elsif mode.header?
52
- MarkdownUI::Content::Header.new(actual_content, klass).render
53
- elsif mode.list? && mode.ordered?
54
- MarkdownUI::Content::List.new(actual_content, klass, :ordered).render
55
- elsif mode.list? && mode.unordered?
56
- MarkdownUI::Content::List.new(actual_content, klass, :unordered).render
57
- elsif mode.list?
58
- MarkdownUI::Content::List.new(actual_content, klass).render
52
+ if mode.text?
53
+ MarkdownUI::Content::Text.new(actual_content, klass).render
54
+ elsif mode.icon?
55
+ MarkdownUI::Content::Icon.new(actual_content, klass).render
56
+ elsif mode.header?
57
+ MarkdownUI::Content::Header.new(actual_content, klass).render
58
+ elsif mode.list? && mode.ordered?
59
+ MarkdownUI::Content::List.new(actual_content, klass, :ordered).render
60
+ elsif mode.list? && mode.unordered?
61
+ MarkdownUI::Content::List.new(actual_content, klass, :unordered).render
62
+ elsif mode.list?
63
+ MarkdownUI::Content::List.new(actual_content, klass).render
64
+ else
65
+ MarkdownUI::Content::Custom.new(content.join(' '), klass).render
66
+ end
59
67
  else
60
68
  MarkdownUI::Content::Custom.new(content.join(' '), klass).render
61
69
  end
@@ -4,34 +4,34 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  require 'content/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
- spec.name = "markdown-ui-content"
7
+ spec.name = 'markdown-ui-content'
8
8
  spec.version = MarkdownUI::Content::VERSION
9
- spec.authors = ["Joel Bryan Juliano"]
10
- spec.email = ["joelbryan.juliano@gmail.com"]
9
+ spec.authors = ['Joel Bryan Juliano']
10
+ spec.email = ['joelbryan.juliano@gmail.com']
11
11
 
12
12
  spec.summary = %q{Responsive User Interfaces in Markdown}
13
13
  spec.description = %q{Create responsive UI/UX for mobile and web using Markdown Syntax}
14
- spec.homepage = "https://github.com/jjuliano/markdown-ui"
15
- spec.license = "MIT"
14
+ spec.homepage = 'https://github.com/jjuliano/markdown-ui'
15
+ spec.license = 'MIT'
16
16
 
17
17
  # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
18
18
  # delete this section to allow pushing this gem to any host.
19
19
  if spec.respond_to?(:metadata)
20
- spec.metadata['allowed_push_host'] = "https://rubygems.org"
20
+ spec.metadata['allowed_push_host'] = 'https://rubygems.org'
21
21
  else
22
- raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
22
+ raise 'RubyGems 2.0 or newer is required to protect against public gem pushes.'
23
23
  end
24
24
 
25
25
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
26
- spec.bindir = "exe"
26
+ spec.bindir = 'exe'
27
27
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
- spec.require_paths = ["lib"]
28
+ spec.require_paths = ['lib']
29
29
 
30
30
  spec.add_dependency 'bundler', '~> 1.10', '~> 1.9'
31
- spec.add_dependency "redcarpet", "~> 3.2"
32
- spec.add_dependency "nokogiri", "~> 1.6"
33
- spec.add_development_dependency "rake", "~> 10.0"
34
- spec.add_development_dependency "test-unit", "~> 3.0"
35
- spec.add_development_dependency "simplecov", "~> 0.10"
36
- spec.add_development_dependency "codeclimate-test-reporter", "~> 0.4"
31
+ spec.add_dependency 'redcarpet', '~> 3.2'
32
+ spec.add_dependency 'nokogiri', '~> 1.6'
33
+ spec.add_development_dependency 'rake', '~> 10.0'
34
+ spec.add_development_dependency 'test-unit', '~> 3.0'
35
+ spec.add_development_dependency 'simplecov', '~> 0.10'
36
+ spec.add_development_dependency 'codeclimate-test-reporter', '~> 0.4'
37
37
  end
@@ -1,2 +1,2 @@
1
- source "https://rubygems.org"
1
+ source 'https://rubygems.org'
2
2
  gemspec
@@ -8,7 +8,7 @@ module MarkdownUI
8
8
  def render
9
9
  text = @text.strip
10
10
  klass = MarkdownUI::KlassUtil.new("ui #{@klass} header").klass
11
- _id = " id=\"#{@_id}\"" if @_id
11
+ _id = " id=\'#{@_id}\'" if @_id
12
12
  level = @level
13
13
 
14
14
  output = []
@@ -16,15 +16,15 @@ module MarkdownUI
16
16
  if @level > 0
17
17
  output << "<h#{level}"
18
18
  output << _id
19
- output << klass + ">"
19
+ output << klass + '>'
20
20
  output << "#{text}"
21
21
  output << "</h#{level}>"
22
22
  else
23
- output << "<div"
23
+ output << '<div'
24
24
  output << _id
25
- output << klass + ">"
25
+ output << klass + '>'
26
26
  output << "#{text}"
27
- output << "</div>"
27
+ output << '</div>'
28
28
  end
29
29
 
30
30
  output.join
@@ -4,34 +4,34 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  require 'header/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
- spec.name = "markdown-ui-header"
7
+ spec.name = 'markdown-ui-header'
8
8
  spec.version = MarkdownUI::HeaderElement::VERSION
9
- spec.authors = ["Joel Bryan Juliano"]
10
- spec.email = ["joelbryan.juliano@gmail.com"]
9
+ spec.authors = ['Joel Bryan Juliano']
10
+ spec.email = ['joelbryan.juliano@gmail.com']
11
11
 
12
12
  spec.summary = %q{Responsive User Interfaces in Markdown}
13
13
  spec.description = %q{Create responsive UI/UX for mobile and web using Markdown Syntax}
14
- spec.homepage = "https://github.com/jjuliano/markdown-ui"
15
- spec.license = "MIT"
14
+ spec.homepage = 'https://github.com/jjuliano/markdown-ui'
15
+ spec.license = 'MIT'
16
16
 
17
17
  # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
18
18
  # delete this section to allow pushing this gem to any host.
19
19
  if spec.respond_to?(:metadata)
20
- spec.metadata['allowed_push_host'] = "https://rubygems.org"
20
+ spec.metadata['allowed_push_host'] = 'https://rubygems.org'
21
21
  else
22
- raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
22
+ raise 'RubyGems 2.0 or newer is required to protect against public gem pushes.'
23
23
  end
24
24
 
25
25
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
26
- spec.bindir = "exe"
26
+ spec.bindir = 'exe'
27
27
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
- spec.require_paths = ["lib"]
28
+ spec.require_paths = ['lib']
29
29
 
30
30
  spec.add_dependency 'bundler', '~> 1.10', '~> 1.9'
31
- spec.add_dependency "redcarpet", "~> 3.2"
32
- spec.add_dependency "nokogiri", "~> 1.6"
33
- spec.add_development_dependency "rake", "~> 10.0"
34
- spec.add_development_dependency "test-unit", "~> 3.0"
35
- spec.add_development_dependency "simplecov", "~> 0.10"
36
- spec.add_development_dependency "codeclimate-test-reporter", "~> 0.4"
31
+ spec.add_dependency 'redcarpet', '~> 3.2'
32
+ spec.add_dependency 'nokogiri', '~> 1.6'
33
+ spec.add_development_dependency 'rake', '~> 10.0'
34
+ spec.add_development_dependency 'test-unit', '~> 3.0'
35
+ spec.add_development_dependency 'simplecov', '~> 0.10'
36
+ spec.add_development_dependency 'codeclimate-test-reporter', '~> 0.4'
37
37
  end
@@ -1,2 +1,2 @@
1
- source "https://rubygems.org"
1
+ source 'https://rubygems.org'
2
2
  gemspec
@@ -19,4 +19,3 @@ module MarkdownUI::Input
19
19
  end
20
20
  end
21
21
  end
22
-
@@ -4,34 +4,34 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  require 'input/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
- spec.name = "markdown-ui-input"
7
+ spec.name = 'markdown-ui-input'
8
8
  spec.version = MarkdownUI::Input::VERSION
9
- spec.authors = ["Joel Bryan Juliano"]
10
- spec.email = ["joelbryan.juliano@gmail.com"]
9
+ spec.authors = ['Joel Bryan Juliano']
10
+ spec.email = ['joelbryan.juliano@gmail.com']
11
11
 
12
12
  spec.summary = %q{Responsive User Interfaces in Markdown}
13
13
  spec.description = %q{Create responsive UI/UX for mobile and web using Markdown Syntax}
14
- spec.homepage = "https://github.com/jjuliano/markdown-ui"
15
- spec.license = "MIT"
14
+ spec.homepage = 'https://github.com/jjuliano/markdown-ui'
15
+ spec.license = 'MIT'
16
16
 
17
17
  # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
18
18
  # delete this section to allow pushing this gem to any host.
19
19
  if spec.respond_to?(:metadata)
20
- spec.metadata['allowed_push_host'] = "https://rubygems.org"
20
+ spec.metadata['allowed_push_host'] = 'https://rubygems.org'
21
21
  else
22
- raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
22
+ raise 'RubyGems 2.0 or newer is required to protect against public gem pushes.'
23
23
  end
24
24
 
25
25
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
26
- spec.bindir = "exe"
26
+ spec.bindir = 'exe'
27
27
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
- spec.require_paths = ["lib"]
28
+ spec.require_paths = ['lib']
29
29
 
30
30
  spec.add_dependency 'bundler', '~> 1.10', '~> 1.9'
31
- spec.add_dependency "redcarpet", "~> 3.2"
32
- spec.add_dependency "nokogiri", "~> 1.6"
33
- spec.add_development_dependency "rake", "~> 10.0"
34
- spec.add_development_dependency "test-unit", "~> 3.0"
35
- spec.add_development_dependency "simplecov", "~> 0.10"
36
- spec.add_development_dependency "codeclimate-test-reporter", "~> 0.4"
31
+ spec.add_dependency 'redcarpet', '~> 3.2'
32
+ spec.add_dependency 'nokogiri', '~> 1.6'
33
+ spec.add_development_dependency 'rake', '~> 10.0'
34
+ spec.add_development_dependency 'test-unit', '~> 3.0'
35
+ spec.add_development_dependency 'simplecov', '~> 0.10'
36
+ spec.add_development_dependency 'codeclimate-test-reporter', '~> 0.4'
37
37
  end
@@ -1,2 +1,2 @@
1
- source "https://rubygems.org"
1
+ source 'https://rubygems.org'
2
2
  gemspec
@@ -17,4 +17,3 @@ module MarkdownUI::Label
17
17
  end
18
18
  end
19
19
  end
20
-
@@ -4,34 +4,34 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  require 'label/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
- spec.name = "markdown-ui-label"
7
+ spec.name = 'markdown-ui-label'
8
8
  spec.version = MarkdownUI::Label::VERSION
9
- spec.authors = ["Joel Bryan Juliano"]
10
- spec.email = ["joelbryan.juliano@gmail.com"]
9
+ spec.authors = ['Joel Bryan Juliano']
10
+ spec.email = ['joelbryan.juliano@gmail.com']
11
11
 
12
12
  spec.summary = %q{Responsive User Interfaces in Markdown}
13
13
  spec.description = %q{Create responsive UI/UX for mobile and web using Markdown Syntax}
14
- spec.homepage = "https://github.com/jjuliano/markdown-ui"
15
- spec.license = "MIT"
14
+ spec.homepage = 'https://github.com/jjuliano/markdown-ui'
15
+ spec.license = 'MIT'
16
16
 
17
17
  # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
18
18
  # delete this section to allow pushing this gem to any host.
19
19
  if spec.respond_to?(:metadata)
20
- spec.metadata['allowed_push_host'] = "https://rubygems.org"
20
+ spec.metadata['allowed_push_host'] = 'https://rubygems.org'
21
21
  else
22
- raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
22
+ raise 'RubyGems 2.0 or newer is required to protect against public gem pushes.'
23
23
  end
24
24
 
25
25
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
26
- spec.bindir = "exe"
26
+ spec.bindir = 'exe'
27
27
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
- spec.require_paths = ["lib"]
28
+ spec.require_paths = ['lib']
29
29
 
30
30
  spec.add_dependency 'bundler', '~> 1.10', '~> 1.9'
31
- spec.add_dependency "redcarpet", "~> 3.2"
32
- spec.add_dependency "nokogiri", "~> 1.6"
33
- spec.add_development_dependency "rake", "~> 10.0"
34
- spec.add_development_dependency "test-unit", "~> 3.0"
35
- spec.add_development_dependency "simplecov", "~> 0.10"
36
- spec.add_development_dependency "codeclimate-test-reporter", "~> 0.4"
31
+ spec.add_dependency 'redcarpet', '~> 3.2'
32
+ spec.add_dependency 'nokogiri', '~> 1.6'
33
+ spec.add_development_dependency 'rake', '~> 10.0'
34
+ spec.add_development_dependency 'test-unit', '~> 3.0'
35
+ spec.add_development_dependency 'simplecov', '~> 0.10'
36
+ spec.add_development_dependency 'codeclimate-test-reporter', '~> 0.4'
37
37
  end
@@ -1,2 +1,2 @@
1
- source "https://rubygems.org"
1
+ source 'https://rubygems.org'
2
2
  gemspec
@@ -13,20 +13,24 @@ module MarkdownUI
13
13
  end
14
14
 
15
15
  def render
16
- if @element.length == "segment".length
17
- MarkdownUI::StandardSegment.new(@element, @content).render
18
- elsif @mode.horizontal?
19
- MarkdownUI::HorizontalSegment.new(@element, @content).render
20
- elsif @mode.vertical?
21
- MarkdownUI::VerticalSegment.new(@element, @content).render
22
- elsif @mode.stacked?
23
- MarkdownUI::StackedSegment.new(@element, @content).render
24
- elsif @mode.piled?
25
- MarkdownUI::PiledSegment.new(@element, @content).render
26
- elsif @mode.padded?
27
- MarkdownUI::PaddedSegment.new(@element, @content).render
16
+ if @content
17
+ if @element.length == 'segment'.length
18
+ MarkdownUI::StandardSegment.new(@element, @content).render
19
+ elsif @mode.horizontal?
20
+ MarkdownUI::HorizontalSegment.new(@element, @content).render
21
+ elsif @mode.vertical?
22
+ MarkdownUI::VerticalSegment.new(@element, @content).render
23
+ elsif @mode.stacked?
24
+ MarkdownUI::StackedSegment.new(@element, @content).render
25
+ elsif @mode.piled?
26
+ MarkdownUI::PiledSegment.new(@element, @content).render
27
+ elsif @mode.padded?
28
+ MarkdownUI::PaddedSegment.new(@element, @content).render
29
+ else
30
+ MarkdownUI::CustomSegment.new(@element, @content).render
31
+ end
28
32
  else
29
- MarkdownUI::CustomSegment.new(@element, @content).render
33
+ MarkdownUI::CustomSegment.new(@element, '').render
30
34
  end
31
35
  end
32
36