markdown-ui 0.1.16 → 0.1.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -0
  3. data/Changelog +14 -0
  4. data/Gemfile +3 -0
  5. data/components/collections/markdown-ui-grid/lib/grid/column/column.rb +6 -9
  6. data/components/collections/markdown-ui-grid/lib/grid/grid.rb +6 -9
  7. data/components/collections/markdown-ui-grid/lib/grid/row/row.rb +6 -9
  8. data/components/collections/markdown-ui-grid/markdown-ui-grid.gemspec +1 -1
  9. data/components/collections/markdown-ui-menu/lib/menu/custom.rb +12 -12
  10. data/components/collections/markdown-ui-menu/lib/menu/element.rb +54 -52
  11. data/components/collections/markdown-ui-menu/lib/menu/pagination.rb +11 -10
  12. data/components/collections/markdown-ui-menu/lib/menu/pointing.rb +11 -10
  13. data/components/collections/markdown-ui-menu/lib/menu/secondary.rb +11 -10
  14. data/components/collections/markdown-ui-menu/lib/menu/standard.rb +11 -10
  15. data/components/collections/markdown-ui-menu/lib/menu/tabular.rb +11 -10
  16. data/components/collections/markdown-ui-menu/lib/menu/text.rb +11 -10
  17. data/components/collections/markdown-ui-menu/lib/menu/vertical.rb +11 -10
  18. data/components/collections/markdown-ui-message/lib/message/custom_message.rb +11 -11
  19. data/components/collections/markdown-ui-message/lib/message/list_message.rb +10 -9
  20. data/components/collections/markdown-ui-message/lib/message/message.rb +32 -29
  21. data/components/collections/markdown-ui-message/lib/message/standard_message.rb +10 -9
  22. data/components/collections/markdown-ui-message/lib/message/version.rb +1 -1
  23. data/components/collections/markdown-ui-message/markdown-ui-message.gemspec +2 -2
  24. data/components/elements/markdown-ui-button/lib/button/animated.rb +24 -22
  25. data/components/elements/markdown-ui-button/lib/button/basic.rb +14 -12
  26. data/components/elements/markdown-ui-button/lib/button/custom.rb +16 -14
  27. data/components/elements/markdown-ui-button/lib/button/element.rb +55 -53
  28. data/components/elements/markdown-ui-button/lib/button/focusable.rb +14 -12
  29. data/components/elements/markdown-ui-button/lib/button/group/buttons/custom.rb +14 -12
  30. data/components/elements/markdown-ui-button/lib/button/group/buttons/element.rb +22 -20
  31. data/components/elements/markdown-ui-button/lib/button/group/buttons/icon.rb +14 -12
  32. data/components/elements/markdown-ui-button/lib/button/group/buttons/standard.rb +14 -12
  33. data/components/elements/markdown-ui-button/lib/button/icon.rb +14 -12
  34. data/components/elements/markdown-ui-button/lib/button/labeled_icon.rb +19 -17
  35. data/components/elements/markdown-ui-button/lib/button/standard.rb +14 -12
  36. data/components/elements/markdown-ui-container/lib/container/alignment/center.rb +1 -1
  37. data/components/elements/markdown-ui-container/lib/container/alignment/left.rb +1 -1
  38. data/components/elements/markdown-ui-container/lib/container/alignment/right.rb +1 -1
  39. data/components/elements/markdown-ui-container/lib/container/custom.rb +1 -1
  40. data/components/elements/markdown-ui-container/lib/container/element.rb +5 -5
  41. data/components/elements/markdown-ui-container/lib/container/standard.rb +1 -1
  42. data/components/elements/markdown-ui-container/lib/container/text.rb +1 -1
  43. data/components/elements/markdown-ui-content/lib/content/basic_block.rb +19 -0
  44. data/components/elements/markdown-ui-content/lib/content/content_block.rb +1 -1
  45. data/components/elements/markdown-ui-content/lib/content/custom.rb +1 -1
  46. data/components/elements/markdown-ui-content/lib/content/divider_block.rb +1 -1
  47. data/components/elements/markdown-ui-content/lib/content/field_block.rb +1 -1
  48. data/components/elements/markdown-ui-content/lib/content/flag.rb +2 -2
  49. data/components/elements/markdown-ui-content/lib/content/form_block.rb +1 -1
  50. data/components/elements/markdown-ui-content/lib/content/header.rb +2 -2
  51. data/components/elements/markdown-ui-content/lib/content/header_block.rb +1 -1
  52. data/components/elements/markdown-ui-content/lib/content/icon.rb +2 -2
  53. data/components/elements/markdown-ui-content/lib/content/input_block.rb +1 -1
  54. data/components/elements/markdown-ui-content/lib/content/item.rb +4 -4
  55. data/components/elements/markdown-ui-content/lib/content/item_block.rb +1 -1
  56. data/components/elements/markdown-ui-content/lib/content/list.rb +6 -6
  57. data/components/elements/markdown-ui-content/lib/content/parser.rb +17 -17
  58. data/components/elements/markdown-ui-content/lib/content/span_block.rb +1 -1
  59. data/components/elements/markdown-ui-content/lib/content/text.rb +6 -6
  60. data/components/elements/markdown-ui-header/lib/header/header.rb +3 -3
  61. data/components/elements/markdown-ui-input/lib/input/custom.rb +4 -4
  62. data/components/elements/markdown-ui-input/lib/input/element.rb +10 -10
  63. data/components/elements/markdown-ui-label/lib/label/custom.rb +2 -2
  64. data/components/elements/markdown-ui-label/lib/label/element.rb +9 -16
  65. data/components/elements/markdown-ui-segment/lib/segment/custom_segment.rb +1 -1
  66. data/components/elements/markdown-ui-segment/lib/segment/horizontal_segment.rb +1 -1
  67. data/components/elements/markdown-ui-segment/lib/segment/padded_segment.rb +1 -1
  68. data/components/elements/markdown-ui-segment/lib/segment/piled_segment.rb +1 -1
  69. data/components/elements/markdown-ui-segment/lib/segment/segment.rb +6 -6
  70. data/components/elements/markdown-ui-segment/lib/segment/stacked_segment.rb +1 -1
  71. data/components/elements/markdown-ui-segment/lib/segment/standard_segment.rb +1 -1
  72. data/components/elements/markdown-ui-segment/lib/segment/vertical_segment.rb +1 -1
  73. data/components/shared/markdown-ui-shared/Gemfile +2 -0
  74. data/components/shared/markdown-ui-shared/lib/markdown-ui-shared.rb +3 -0
  75. data/components/shared/markdown-ui-shared/lib/shared/tag_klass.rb +77 -0
  76. data/components/shared/markdown-ui-shared/lib/shared/version.rb +5 -0
  77. data/components/shared/markdown-ui-shared/markdown-ui-shared.gemspec +37 -0
  78. data/lib/markdown-ui.rb +10 -132
  79. data/lib/markdown-ui/renderers/block_quote.rb +47 -0
  80. data/lib/markdown-ui/renderers/double_emphasis.rb +97 -0
  81. data/lib/markdown-ui/renderers/emphasis.rb +23 -0
  82. data/lib/markdown-ui/renderers/header.rb +9 -0
  83. data/lib/markdown-ui/renderers/horizontal_rule.rb +19 -0
  84. data/lib/markdown-ui/renderers/link.rb +10 -0
  85. data/lib/markdown-ui/renderers/list.rb +10 -0
  86. data/lib/markdown-ui/renderers/paragraph.rb +9 -0
  87. data/lib/markdown-ui/renderers/quote.rb +9 -0
  88. data/lib/markdown-ui/shared.rb +7 -0
  89. data/lib/markdown-ui/tag/article_tag.rb +14 -0
  90. data/lib/markdown-ui/tag/button_tag.rb +6 -19
  91. data/lib/markdown-ui/tag/custom_tag.rb +11 -10
  92. data/lib/markdown-ui/tag/focusable_button_tag.rb +6 -19
  93. data/lib/markdown-ui/tag/footer_tag.rb +14 -0
  94. data/lib/markdown-ui/tag/header_tag.rb +14 -0
  95. data/lib/markdown-ui/tag/input_tag.rb +7 -27
  96. data/lib/markdown-ui/tag/item_tag.rb +6 -14
  97. data/lib/markdown-ui/tag/label_tag.rb +6 -19
  98. data/lib/markdown-ui/tag/list_tag.rb +18 -21
  99. data/lib/markdown-ui/tag/section_tag.rb +14 -0
  100. data/lib/markdown-ui/tag/span_tag.rb +7 -7
  101. data/lib/markdown-ui/tag/standard_tag.rb +6 -19
  102. data/lib/markdown-ui/tag/tag.rb +18 -20
  103. data/lib/markdown-ui/tools/html_formatter.rb +11 -0
  104. data/lib/markdown-ui/utils/klass_util.rb +13 -3
  105. data/lib/markdown-ui/version.rb +1 -1
  106. data/website/docs/flag.html +1 -1
  107. data/website/docs/icon.html +609 -0
  108. data/website/docs/icon.md +691 -0
  109. data/website/docs/toc.html +4 -0
  110. data/website/docs/toc.md +5 -2
  111. data/website/index.html +2 -2
  112. metadata +25 -2
@@ -1,19 +1,21 @@
1
1
  # coding: UTF-8
2
2
 
3
- module MarkdownUI::Button
4
- class Focusable
5
- def initialize(content, klass = nil, _id = nil)
6
- @klass = klass
7
- @id = _id
8
- @content = content
9
- end
3
+ module MarkdownUI
4
+ module Button
5
+ class Focusable
6
+ def initialize(content, klass = nil, _id = nil)
7
+ @klass = klass
8
+ @id = _id
9
+ @content = content
10
+ end
10
11
 
11
- def render
12
- klass = "ui #{@klass} focusable button"
13
- content = MarkdownUI::Content::Parser.new(@content).parse
14
- _id = @id
12
+ def render
13
+ klass = "ui #{@klass} focusable button"
14
+ content = MarkdownUI::Content::Parser.new(@content).parse
15
+ _id = @id
15
16
 
16
- MarkdownUI::FocusableButtonTag.new(content, klass, _id).render
17
+ MarkdownUI::FocusableButtonTag.new(content, klass, _id).render
18
+ end
17
19
  end
18
20
  end
19
21
  end
@@ -1,19 +1,21 @@
1
1
  # coding: UTF-8
2
2
 
3
- module MarkdownUI::Button
4
- module Group
5
- module Buttons
6
- class Custom
7
- def initialize(element, content)
8
- @element = element
9
- @content = content
10
- end
3
+ module MarkdownUI
4
+ module Button
5
+ module Group
6
+ module Buttons
7
+ class Custom
8
+ def initialize(element, content)
9
+ @element = element
10
+ @content = content
11
+ end
11
12
 
12
- def render
13
- klass = "ui #{@element} buttons"
14
- content = @content.strip
13
+ def render
14
+ klass = "ui #{@element} buttons"
15
+ content = @content.strip
15
16
 
16
- MarkdownUI::StandardTag.new(content, klass).render
17
+ MarkdownUI::StandardTag.new(content, klass).render
18
+ end
17
19
  end
18
20
  end
19
21
  end
@@ -1,25 +1,27 @@
1
- module MarkdownUI::Button
2
- module Group
3
- module Buttons
4
- class Element
5
- def initialize(element, content)
6
- @element = element
7
- @content = content
8
- end
1
+ module MarkdownUI
2
+ module Button
3
+ module Group
4
+ module Buttons
5
+ class Element
6
+ def initialize(element, content)
7
+ @element = element
8
+ @content = content
9
+ end
9
10
 
10
- def render
11
- element = @element.strip
12
- content = @content.strip
13
- mode = OpenStruct.new(
14
- :icon? => !(element =~ /icon/i).nil?
15
- )
11
+ def render
12
+ element = @element.strip
13
+ content = @content.strip
14
+ mode = OpenStruct.new(
15
+ :icon? => !(element =~ /icon/i).nil?
16
+ )
16
17
 
17
- if element.length == 'buttons'.length
18
- MarkdownUI::Button::Group::Buttons::Standard.new(element, content).render
19
- elsif mode.icon?
20
- MarkdownUI::Button::Group::Buttons::Icon.new(element, content).render
21
- else
22
- MarkdownUI::Button::Group::Buttons::Custom.new(element, content).render
18
+ if element.length == 'buttons'.length
19
+ MarkdownUI::Button::Group::Buttons::Standard.new(element, content).render
20
+ elsif mode.icon?
21
+ MarkdownUI::Button::Group::Buttons::Icon.new(element, content).render
22
+ else
23
+ MarkdownUI::Button::Group::Buttons::Custom.new(element, content).render
24
+ end
23
25
  end
24
26
  end
25
27
  end
@@ -1,17 +1,19 @@
1
- module MarkdownUI::Button
2
- module Group
3
- module Buttons
4
- class Icon
5
- def initialize(element, content)
6
- @element = element
7
- @content = content
8
- end
1
+ module MarkdownUI
2
+ module Button
3
+ module Group
4
+ module Buttons
5
+ class Icon
6
+ def initialize(element, content)
7
+ @element = element
8
+ @content = content
9
+ end
9
10
 
10
- def render
11
- klass = "ui #{@element} icon buttons"
12
- content = @content.strip
11
+ def render
12
+ klass = "ui #{@element} icon buttons"
13
+ content = @content.strip
13
14
 
14
- MarkdownUI::StandardTag.new(content, klass).render
15
+ MarkdownUI::StandardTag.new(content, klass).render
16
+ end
15
17
  end
16
18
  end
17
19
  end
@@ -1,17 +1,19 @@
1
- module MarkdownUI::Button
2
- module Group
3
- module Buttons
4
- class Standard
5
- def initialize(element, content)
6
- @element = element
7
- @content = content
8
- end
1
+ module MarkdownUI
2
+ module Button
3
+ module Group
4
+ module Buttons
5
+ class Standard
6
+ def initialize(element, content)
7
+ @element = element
8
+ @content = content
9
+ end
9
10
 
10
- def render
11
- klass = "ui #{@element} buttons"
12
- content = @content.strip
11
+ def render
12
+ klass = "ui #{@element} buttons"
13
+ content = @content.strip
13
14
 
14
- MarkdownUI::StandardTag.new(content, klass).render
15
+ MarkdownUI::StandardTag.new(content, klass).render
16
+ end
15
17
  end
16
18
  end
17
19
  end
@@ -1,19 +1,21 @@
1
1
  # coding: UTF-8
2
2
 
3
- module MarkdownUI::Button
4
- class Icon
5
- def initialize(content, klass = nil, _id = nil)
6
- @klass = klass
7
- @id = _id
8
- @content = content
9
- end
3
+ module MarkdownUI
4
+ module Button
5
+ class Icon
6
+ def initialize(content, klass = nil, _id = nil)
7
+ @klass = klass
8
+ @id = _id
9
+ @content = content
10
+ end
10
11
 
11
- def render
12
- content = MarkdownUI::Content::Parser.new(@content).parse
13
- klass = "ui #{@klass} icon button"
14
- _id = @id
12
+ def render
13
+ content = MarkdownUI::Content::Parser.new(@content).parse
14
+ klass = "ui #{@klass} icon button"
15
+ _id = @id
15
16
 
16
- MarkdownUI::ButtonTag.new(content, klass, _id).render
17
+ MarkdownUI::ButtonTag.new(content, klass, _id).render
18
+ end
17
19
  end
18
20
  end
19
21
  end
@@ -1,25 +1,27 @@
1
1
  # coding: UTF-8
2
2
 
3
- module MarkdownUI::Button
4
- class LabeledIcon
5
- def initialize(icon, label, klass = nil, _id = nil)
6
- @klass = klass
7
- @icon = icon
8
- @label = label
9
- @id = _id
10
- end
3
+ module MarkdownUI
4
+ module Button
5
+ class LabeledIcon
6
+ def initialize(icon, label, klass = nil, _id = nil)
7
+ @klass = klass
8
+ @icon = icon
9
+ @label = label
10
+ @id = _id
11
+ end
11
12
 
12
- def render
13
- icon = MarkdownUI::Content::Parser.new(@icon).parse
14
- label = MarkdownUI::Content::Parser.new(@label).parse
15
- klass = "ui #{@klass} labeled icon button"
16
- _id = @id
13
+ def render
14
+ icon = MarkdownUI::Content::Parser.new(@icon).parse
15
+ label = MarkdownUI::Content::Parser.new(@label).parse
16
+ klass = "ui #{@klass} labeled icon button"
17
+ _id = @id
17
18
 
18
- content = []
19
- content << icon
20
- content << label
19
+ content = []
20
+ content << icon
21
+ content << label
21
22
 
22
- MarkdownUI::ButtonTag.new(content.join, klass, _id).render
23
+ MarkdownUI::ButtonTag.new(content.join, klass, _id).render
24
+ end
23
25
  end
24
26
  end
25
27
  end
@@ -1,19 +1,21 @@
1
1
  # coding: UTF-8
2
2
 
3
- module MarkdownUI::Button
4
- class Standard
5
- def initialize(content, klass = nil, _id = nil)
6
- @klass = klass
7
- @id = _id
8
- @content = content
9
- end
3
+ module MarkdownUI
4
+ module Button
5
+ class Standard
6
+ def initialize(content, klass = nil, _id = nil)
7
+ @klass = klass
8
+ @id = _id
9
+ @content = content
10
+ end
10
11
 
11
- def render
12
- klass = "ui #{@klass} button"
13
- content = MarkdownUI::Content::Parser.new(@content).parse
14
- _id = @id
12
+ def render
13
+ klass = "ui #{@klass} button"
14
+ content = MarkdownUI::Content::Parser.new(@content).parse
15
+ _id = @id
15
16
 
16
- MarkdownUI::ButtonTag.new(content, klass, _id).render
17
+ MarkdownUI::ButtonTag.new(content, klass, _id).render
18
+ end
17
19
  end
18
20
  end
19
21
  end
@@ -9,7 +9,7 @@ module MarkdownUI::Container
9
9
  end
10
10
 
11
11
  def render
12
- klass = "ui #{@element} center aligned container"
12
+ klass = "ui #{@element} center aligned container"
13
13
  content = @content.strip
14
14
 
15
15
  MarkdownUI::StandardTag.new(content, klass).render
@@ -9,7 +9,7 @@ module MarkdownUI::Container
9
9
  end
10
10
 
11
11
  def render
12
- klass = "ui #{@element} left aligned container"
12
+ klass = "ui #{@element} left aligned container"
13
13
  content = @content.strip
14
14
 
15
15
  MarkdownUI::StandardTag.new(content, klass).render
@@ -9,7 +9,7 @@ module MarkdownUI::Container
9
9
  end
10
10
 
11
11
  def render
12
- klass = "ui #{@element} right aligned container"
12
+ klass = "ui #{@element} right aligned container"
13
13
  content = @content.strip
14
14
 
15
15
  MarkdownUI::StandardTag.new(content, klass).render
@@ -8,7 +8,7 @@ module MarkdownUI::Container
8
8
  end
9
9
 
10
10
  def render
11
- klass = "ui #{@element} container"
11
+ klass = "ui #{@element} container"
12
12
  content = @content.strip
13
13
 
14
14
  MarkdownUI::StandardTag.new(content, klass).render
@@ -12,11 +12,11 @@ module MarkdownUI::Container
12
12
  content = @content.strip
13
13
 
14
14
  mode = OpenStruct.new(
15
- :text? => !(element =~ /text/i).nil?,
16
- :left? => !(element =~ /left/i).nil?,
17
- :right? => !(element =~ /right/i).nil?,
18
- :center? => !(element =~ /center/i).nil?,
19
- :aligned? => !(element =~ /aligned/i).nil?
15
+ :text? => !(element =~ /text/i).nil?,
16
+ :left? => !(element =~ /left/i).nil?,
17
+ :right? => !(element =~ /right/i).nil?,
18
+ :center? => !(element =~ /center/i).nil?,
19
+ :aligned? => !(element =~ /aligned/i).nil?
20
20
  )
21
21
 
22
22
  if element.length == 'container'.length
@@ -8,7 +8,7 @@ module MarkdownUI::Container
8
8
  end
9
9
 
10
10
  def render
11
- klass = "ui #{@element} container"
11
+ klass = "ui #{@element} container"
12
12
  content = @content.strip
13
13
 
14
14
  MarkdownUI::StandardTag.new(content, klass).render
@@ -8,7 +8,7 @@ module MarkdownUI::Container
8
8
  end
9
9
 
10
10
  def render
11
- klass = "ui #{@element} text container"
11
+ klass = "ui #{@element} text container"
12
12
  content = @content.strip
13
13
 
14
14
  MarkdownUI::StandardTag.new(content, klass).render
@@ -0,0 +1,19 @@
1
+ # coding: UTF-8
2
+
3
+ module MarkdownUI
4
+ module Content
5
+ class BasicBlock
6
+ def initialize(element, content)
7
+ @element = element
8
+ @content = content
9
+ end
10
+
11
+ def render
12
+ klass = "ui #{@element}"
13
+ content = @content.strip
14
+
15
+ MarkdownUI::StandardTag.new(content, klass).render
16
+ end
17
+ end
18
+ end
19
+ end
@@ -9,7 +9,7 @@ module MarkdownUI
9
9
  end
10
10
 
11
11
  def render
12
- klass = "ui #{@element} content"
12
+ klass = "ui #{@element} content"
13
13
  content = @content.strip
14
14
 
15
15
  MarkdownUI::StandardTag.new(content, klass).render
@@ -5,7 +5,7 @@ module MarkdownUI
5
5
  class Custom
6
6
  def initialize(content, klass = nil)
7
7
  @content = content
8
- @klass = klass
8
+ @klass = klass
9
9
  end
10
10
 
11
11
  def render
@@ -9,7 +9,7 @@ module MarkdownUI
9
9
  end
10
10
 
11
11
  def render
12
- klass = "ui #{@element} divider"
12
+ klass = "ui #{@element} divider"
13
13
  content = @content.strip
14
14
 
15
15
  MarkdownUI::StandardTag.new(content, klass).render
@@ -9,7 +9,7 @@ module MarkdownUI
9
9
  end
10
10
 
11
11
  def render
12
- klass = "ui #{@element} field"
12
+ klass = "ui #{@element} field"
13
13
  content = @content.strip
14
14
 
15
15
  MarkdownUI::StandardTag.new(content, klass).render
@@ -5,12 +5,12 @@ module MarkdownUI
5
5
  class Flag
6
6
  def initialize(content, klass = nil)
7
7
  @content = content
8
- @klass = klass
8
+ @klass = klass
9
9
  end
10
10
 
11
11
  def render
12
12
  content = @content.downcase
13
- klass = MarkdownUI::KlassUtil.new("#{@content} #{@klass} flag").klass
13
+ klass = MarkdownUI::KlassUtil.new("#{@content} #{@klass} flag").klass
14
14
 
15
15
  output = []
16
16
  output << '<i'