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.
- checksums.yaml +4 -4
- data/Changelog +8 -1
- data/Gemfile +28 -10
- data/TODO.md +1 -1
- data/components/collections/markdown-ui-grid/Gemfile +1 -1
- data/components/collections/markdown-ui-grid/markdown-ui-grid.gemspec +15 -15
- data/components/collections/markdown-ui-menu/Gemfile +1 -1
- data/components/collections/markdown-ui-menu/lib/menu/custom.rb +0 -1
- data/components/collections/markdown-ui-menu/markdown-ui-menu.gemspec +15 -15
- data/components/collections/markdown-ui-message/Gemfile +1 -1
- data/components/collections/markdown-ui-message/lib/message/custom_message.rb +0 -1
- data/components/collections/markdown-ui-message/markdown-ui-message.gemspec +15 -15
- data/components/elements/markdown-ui-button/Gemfile +1 -1
- data/components/elements/markdown-ui-button/lib/button/animated.rb +2 -2
- data/components/elements/markdown-ui-button/lib/button/custom.rb +0 -1
- data/components/elements/markdown-ui-button/lib/button/element.rb +19 -15
- data/components/elements/markdown-ui-button/lib/button/group/buttons/element.rb +1 -1
- data/components/elements/markdown-ui-button/markdown-ui-button.gemspec +15 -15
- data/components/elements/markdown-ui-container/Gemfile +1 -1
- data/components/elements/markdown-ui-container/lib/container/element.rb +1 -1
- data/components/elements/markdown-ui-container/markdown-ui-container.gemspec +15 -15
- data/components/elements/markdown-ui-content/Gemfile +1 -1
- data/components/elements/markdown-ui-content/lib/content/divider_block.rb +1 -1
- data/components/elements/markdown-ui-content/lib/content/field_block.rb +1 -1
- data/components/elements/markdown-ui-content/lib/content/form_block.rb +1 -1
- data/components/elements/markdown-ui-content/lib/content/header.rb +1 -1
- data/components/elements/markdown-ui-content/lib/content/icon.rb +2 -2
- data/components/elements/markdown-ui-content/lib/content/input_block.rb +1 -1
- data/components/elements/markdown-ui-content/lib/content/item.rb +1 -1
- data/components/elements/markdown-ui-content/lib/content/item_block.rb +1 -1
- data/components/elements/markdown-ui-content/lib/content/list.rb +1 -1
- data/components/elements/markdown-ui-content/lib/content/parser.rb +31 -23
- data/components/elements/markdown-ui-content/markdown-ui-content.gemspec +15 -15
- data/components/elements/markdown-ui-header/Gemfile +1 -1
- data/components/elements/markdown-ui-header/lib/header/header.rb +5 -5
- data/components/elements/markdown-ui-header/markdown-ui-header.gemspec +15 -15
- data/components/elements/markdown-ui-input/Gemfile +1 -1
- data/components/elements/markdown-ui-input/lib/input/custom.rb +0 -1
- data/components/elements/markdown-ui-input/markdown-ui-input.gemspec +15 -15
- data/components/elements/markdown-ui-label/Gemfile +1 -1
- data/components/elements/markdown-ui-label/lib/label/custom.rb +0 -1
- data/components/elements/markdown-ui-label/markdown-ui-label.gemspec +15 -15
- data/components/elements/markdown-ui-segment/Gemfile +1 -1
- data/components/elements/markdown-ui-segment/lib/segment/segment.rb +17 -13
- data/components/elements/markdown-ui-segment/markdown-ui-segment.gemspec +15 -15
- data/exe/markdown-ui +11 -11
- data/exe/markdown-ui-shell +31 -0
- data/lib/markdown-ui.rb +47 -43
- data/lib/markdown-ui/tag/button_tag.rb +2 -2
- data/lib/markdown-ui/tag/focusable_button_tag.rb +3 -3
- data/lib/markdown-ui/tag/input_tag.rb +3 -3
- data/lib/markdown-ui/tag/item_tag.rb +2 -2
- data/lib/markdown-ui/tag/label_tag.rb +2 -2
- data/lib/markdown-ui/tag/list_tag.rb +2 -2
- data/lib/markdown-ui/tag/span_tag.rb +1 -1
- data/lib/markdown-ui/tag/standard_tag.rb +2 -2
- data/lib/markdown-ui/utils/klass_util.rb +1 -1
- data/lib/markdown-ui/version.rb +1 -1
- data/markdown-ui.gemspec +2 -1
- data/website/about.html +8 -8
- data/website/docs/button.html +8 -8
- data/website/docs/container.html +26 -23
- data/website/docs/divider.html +8 -8
- data/website/docs/toc.html +8 -8
- data/website/index.html +42 -27
- data/website/index.md +38 -20
- metadata +19 -3
@@ -1,2 +1,2 @@
|
|
1
|
-
source
|
1
|
+
source 'https://rubygems.org'
|
2
2
|
gemspec
|
@@ -22,7 +22,11 @@ module MarkdownUI
|
|
22
22
|
content = if !(@content =~ /\:/).nil?
|
23
23
|
@content.split(':')
|
24
24
|
else
|
25
|
-
@content
|
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
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
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
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
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 =
|
7
|
+
spec.name = 'markdown-ui-content'
|
8
8
|
spec.version = MarkdownUI::Content::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
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 =
|
15
|
-
spec.license =
|
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'] =
|
20
|
+
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
21
21
|
else
|
22
|
-
raise
|
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 =
|
26
|
+
spec.bindir = 'exe'
|
27
27
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
28
|
-
spec.require_paths = [
|
28
|
+
spec.require_paths = ['lib']
|
29
29
|
|
30
30
|
spec.add_dependency 'bundler', '~> 1.10', '~> 1.9'
|
31
|
-
spec.add_dependency
|
32
|
-
spec.add_dependency
|
33
|
-
spec.add_development_dependency
|
34
|
-
spec.add_development_dependency
|
35
|
-
spec.add_development_dependency
|
36
|
-
spec.add_development_dependency
|
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
|
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=\
|
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 <<
|
23
|
+
output << '<div'
|
24
24
|
output << _id
|
25
|
-
output << klass +
|
25
|
+
output << klass + '>'
|
26
26
|
output << "#{text}"
|
27
|
-
output <<
|
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 =
|
7
|
+
spec.name = 'markdown-ui-header'
|
8
8
|
spec.version = MarkdownUI::HeaderElement::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
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 =
|
15
|
-
spec.license =
|
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'] =
|
20
|
+
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
21
21
|
else
|
22
|
-
raise
|
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 =
|
26
|
+
spec.bindir = 'exe'
|
27
27
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
28
|
-
spec.require_paths = [
|
28
|
+
spec.require_paths = ['lib']
|
29
29
|
|
30
30
|
spec.add_dependency 'bundler', '~> 1.10', '~> 1.9'
|
31
|
-
spec.add_dependency
|
32
|
-
spec.add_dependency
|
33
|
-
spec.add_development_dependency
|
34
|
-
spec.add_development_dependency
|
35
|
-
spec.add_development_dependency
|
36
|
-
spec.add_development_dependency
|
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
|
1
|
+
source 'https://rubygems.org'
|
2
2
|
gemspec
|
@@ -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 =
|
7
|
+
spec.name = 'markdown-ui-input'
|
8
8
|
spec.version = MarkdownUI::Input::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
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 =
|
15
|
-
spec.license =
|
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'] =
|
20
|
+
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
21
21
|
else
|
22
|
-
raise
|
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 =
|
26
|
+
spec.bindir = 'exe'
|
27
27
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
28
|
-
spec.require_paths = [
|
28
|
+
spec.require_paths = ['lib']
|
29
29
|
|
30
30
|
spec.add_dependency 'bundler', '~> 1.10', '~> 1.9'
|
31
|
-
spec.add_dependency
|
32
|
-
spec.add_dependency
|
33
|
-
spec.add_development_dependency
|
34
|
-
spec.add_development_dependency
|
35
|
-
spec.add_development_dependency
|
36
|
-
spec.add_development_dependency
|
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
|
1
|
+
source 'https://rubygems.org'
|
2
2
|
gemspec
|
@@ -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 =
|
7
|
+
spec.name = 'markdown-ui-label'
|
8
8
|
spec.version = MarkdownUI::Label::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
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 =
|
15
|
-
spec.license =
|
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'] =
|
20
|
+
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
21
21
|
else
|
22
|
-
raise
|
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 =
|
26
|
+
spec.bindir = 'exe'
|
27
27
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
28
|
-
spec.require_paths = [
|
28
|
+
spec.require_paths = ['lib']
|
29
29
|
|
30
30
|
spec.add_dependency 'bundler', '~> 1.10', '~> 1.9'
|
31
|
-
spec.add_dependency
|
32
|
-
spec.add_dependency
|
33
|
-
spec.add_development_dependency
|
34
|
-
spec.add_development_dependency
|
35
|
-
spec.add_development_dependency
|
36
|
-
spec.add_development_dependency
|
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
|
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 @
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
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,
|
33
|
+
MarkdownUI::CustomSegment.new(@element, '').render
|
30
34
|
end
|
31
35
|
end
|
32
36
|
|