markdown-ui 0.1.14 → 0.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
@@ -4,34 +4,34 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
require 'segment/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
7
|
+
spec.name = 'markdown-ui-segment'
|
8
8
|
spec.version = MarkdownUI::SegmentElement::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
|
data/exe/markdown-ui
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'markdown-ui'
|
5
5
|
|
6
6
|
parser = Redcarpet::Markdown.new(MarkdownUI::Renderer, quote: true, tables: true, xhtml: true)
|
7
7
|
f = File.open(ARGV.first, 'r')
|
@@ -11,18 +11,18 @@ f.close
|
|
11
11
|
puts <<-EOS
|
12
12
|
<!doctype html>
|
13
13
|
|
14
|
-
<html lang=
|
14
|
+
<html lang='en'>
|
15
15
|
<head>
|
16
|
-
<meta charset=
|
17
|
-
<meta http-equiv=
|
18
|
-
<meta name=
|
16
|
+
<meta charset='utf-8'>
|
17
|
+
<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
|
18
|
+
<meta name='viewport' content='width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1'>
|
19
19
|
|
20
|
-
<link rel=
|
21
|
-
<script src=
|
22
|
-
<script src=
|
20
|
+
<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.5/semantic.min.css'>
|
21
|
+
<script src='https://code.jquery.com/jquery-2.1.4.min.js'></script>
|
22
|
+
<script src='https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.5/semantic.min.js'></script>
|
23
23
|
|
24
24
|
<!--[if lt IE 9]>
|
25
|
-
<script src=
|
25
|
+
<script src='http://html5shiv.googlecode.com/svn/trunk/html5.js'></script>
|
26
26
|
<![endif]-->
|
27
27
|
</head>
|
28
28
|
|
@@ -30,4 +30,4 @@ puts <<-EOS
|
|
30
30
|
#{@content}
|
31
31
|
</body>
|
32
32
|
</html>
|
33
|
-
EOS
|
33
|
+
EOS
|
@@ -0,0 +1,31 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'markdown-ui'
|
5
|
+
|
6
|
+
puts "Hit RETURN three times to parse."
|
7
|
+
|
8
|
+
def multi_gets all_text=""
|
9
|
+
while all_text << STDIN.gets
|
10
|
+
if all_text["\n\n\n"]
|
11
|
+
return all_text
|
12
|
+
elsif all_text[/^exit|^quit|^bye/]
|
13
|
+
exit 0
|
14
|
+
else
|
15
|
+
print "# "
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def prompt(*args)
|
21
|
+
print(*args)
|
22
|
+
multi_gets
|
23
|
+
end
|
24
|
+
|
25
|
+
while m = prompt("# ")
|
26
|
+
parser = Redcarpet::Markdown.new(MarkdownUI::Renderer, quote: true, tables: true, xhtml: true)
|
27
|
+
puts <<-EOF
|
28
|
+
|
29
|
+
#{parser.render(m)}
|
30
|
+
EOF
|
31
|
+
end
|
data/lib/markdown-ui.rb
CHANGED
@@ -18,7 +18,7 @@ module MarkdownUI
|
|
18
18
|
include MarkdownUI::Collection
|
19
19
|
|
20
20
|
def hrule
|
21
|
-
klass =
|
21
|
+
klass = 'ui divider'
|
22
22
|
MarkdownUI::StandardTag.new(nil, klass).render
|
23
23
|
end
|
24
24
|
|
@@ -51,19 +51,21 @@ module MarkdownUI
|
|
51
51
|
data_attributes = !args[3].nil? ? args[3].downcase : nil
|
52
52
|
|
53
53
|
html do
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
54
|
+
if content
|
55
|
+
case element.join(' ')
|
56
|
+
when /button/i
|
57
|
+
MarkdownUI::Button::Element.new(element, content, klass, _id).render
|
58
|
+
when /input/i
|
59
|
+
MarkdownUI::Input::Element.new(element, content, klass, _id).render
|
60
|
+
when /menu/i
|
61
|
+
MarkdownUI::Menu::Element.new(element, content, klass).render
|
62
|
+
when /message/i
|
63
|
+
MarkdownUI::Message.new(element, content, klass).render
|
64
|
+
when /tag/i
|
65
|
+
MarkdownUI::Tag.new(element[0].downcase, content, _id, data_attributes).render
|
66
|
+
when /header/i
|
67
|
+
MarkdownUI::Header.new(content, 0).render
|
68
|
+
end
|
67
69
|
end
|
68
70
|
end
|
69
71
|
end
|
@@ -72,35 +74,37 @@ module MarkdownUI
|
|
72
74
|
element, content = text.split(':')
|
73
75
|
|
74
76
|
html do
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
77
|
+
if content
|
78
|
+
case element
|
79
|
+
when /segment/i
|
80
|
+
MarkdownUI::Segment.new(element, content).render
|
81
|
+
when /grid/i
|
82
|
+
MarkdownUI::Grid.new(element, content).render
|
83
|
+
when /column/i
|
84
|
+
MarkdownUI::Column.new(element, content).render
|
85
|
+
when /container/i
|
86
|
+
MarkdownUI::Container::Element.new(element, content).render
|
87
|
+
when /buttons/i
|
88
|
+
MarkdownUI::Button::Group::Buttons::Element.new(element, content).render
|
89
|
+
when /button/i
|
90
|
+
MarkdownUI::Button::Element.new(element, content).render
|
91
|
+
when /menu/i
|
92
|
+
MarkdownUI::Menu::Element.new(element, content).render
|
93
|
+
when /message/i
|
94
|
+
MarkdownUI::Message.new(element, content).render
|
95
|
+
when /label/i
|
96
|
+
MarkdownUI::Label::Element.new(element, content).render
|
97
|
+
when /item/i
|
98
|
+
MarkdownUI::Content::ItemBlock.new(element, content).render
|
99
|
+
when /form/i
|
100
|
+
MarkdownUI::Content::FormBlock.new(element, content).render
|
101
|
+
when /field/i
|
102
|
+
MarkdownUI::Content::FieldBlock.new(element, content).render
|
103
|
+
when /input/i
|
104
|
+
MarkdownUI::Content::InputBlock.new(element, content).render
|
105
|
+
when /divider/i
|
106
|
+
MarkdownUI::Content::DividerBlock.new(element, content).render
|
107
|
+
end
|
104
108
|
end
|
105
109
|
end
|
106
110
|
end
|
@@ -11,12 +11,12 @@ module MarkdownUI
|
|
11
11
|
content = @content.strip unless @content.nil?
|
12
12
|
klass = MarkdownUI::KlassUtil.new(@klass).klass unless @klass.nil?
|
13
13
|
_id = if @id
|
14
|
-
" id=\
|
14
|
+
" id=\'#{@id.split.join('-')}\'"
|
15
15
|
end
|
16
16
|
|
17
17
|
data = if @data
|
18
18
|
_data, attribute, value = @data.split(':')
|
19
|
-
" data-#{attribute}=\
|
19
|
+
" data-#{attribute}=\'#{value}\'"
|
20
20
|
else
|
21
21
|
nil
|
22
22
|
end
|
@@ -11,17 +11,17 @@ module MarkdownUI
|
|
11
11
|
content = @content.strip unless @content.nil?
|
12
12
|
klass = MarkdownUI::KlassUtil.new(@klass).klass unless @klass.nil?
|
13
13
|
_id = if @id
|
14
|
-
" id=\
|
14
|
+
" id=\'#{@id.split.join('-')}\'"
|
15
15
|
end
|
16
16
|
|
17
17
|
data = if @data
|
18
18
|
_data, attribute, value = @data.split(':')
|
19
|
-
" data-#{attribute}=\
|
19
|
+
" data-#{attribute}=\'#{value}\'"
|
20
20
|
else
|
21
21
|
nil
|
22
22
|
end
|
23
23
|
|
24
|
-
"<div#{_id}#{klass}#{data} tabindex=\
|
24
|
+
"<div#{_id}#{klass}#{data} tabindex=\'0\'>#{content}</div>"
|
25
25
|
end
|
26
26
|
end
|
27
27
|
end
|
@@ -9,7 +9,7 @@ module MarkdownUI
|
|
9
9
|
|
10
10
|
def render
|
11
11
|
content = if @content
|
12
|
-
" type=\
|
12
|
+
" type=\'#{@content.strip.downcase}\'"
|
13
13
|
else
|
14
14
|
nil
|
15
15
|
end
|
@@ -17,12 +17,12 @@ module MarkdownUI
|
|
17
17
|
klass = MarkdownUI::KlassUtil.new(@klass).klass unless @klass.nil?
|
18
18
|
|
19
19
|
_id = if @id
|
20
|
-
" placeholder=\
|
20
|
+
" placeholder=\'#{@id.capitalize}\'"
|
21
21
|
end
|
22
22
|
|
23
23
|
data = if @data
|
24
24
|
_data, attribute, value = @data.split(':')
|
25
|
-
" data-#{attribute}=\
|
25
|
+
" data-#{attribute}=\'#{value}\'"
|
26
26
|
else
|
27
27
|
nil
|
28
28
|
end
|
@@ -9,11 +9,11 @@ module MarkdownUI
|
|
9
9
|
def render
|
10
10
|
content, @data = @content.split(';')
|
11
11
|
klass = MarkdownUI::KlassUtil.new(@klass).klass if @klass
|
12
|
-
link = " href=\
|
12
|
+
link = " href=\'#{@link.strip}\'" if @link
|
13
13
|
|
14
14
|
data = if @data
|
15
15
|
_data, attribute, value = @data.split(':')
|
16
|
-
" data-#{attribute}=\
|
16
|
+
" data-#{attribute}=\'#{value}\'"
|
17
17
|
else
|
18
18
|
nil
|
19
19
|
end
|
@@ -11,12 +11,12 @@ module MarkdownUI
|
|
11
11
|
content = @content.strip unless @content.nil?
|
12
12
|
klass = MarkdownUI::KlassUtil.new(@klass).klass unless @klass.nil?
|
13
13
|
_id = if @id
|
14
|
-
" id=\
|
14
|
+
" id=\'#{@id.split.join('-')}\'"
|
15
15
|
end
|
16
16
|
|
17
17
|
data = if @data
|
18
18
|
_data, attribute, value = @data.split(':')
|
19
|
-
" data-#{attribute}=\
|
19
|
+
" data-#{attribute}=\'#{value}\'"
|
20
20
|
else
|
21
21
|
nil
|
22
22
|
end
|
@@ -13,12 +13,12 @@ module MarkdownUI
|
|
13
13
|
|
14
14
|
data = if @data
|
15
15
|
_data, attribute, value = @data.split(':')
|
16
|
-
" data-#{attribute}=\
|
16
|
+
" data-#{attribute}=\'#{value}\'"
|
17
17
|
else
|
18
18
|
nil
|
19
19
|
end
|
20
20
|
|
21
|
-
list =
|
21
|
+
list = ''
|
22
22
|
if !content.grep(/^\<li\>.*/).empty?
|
23
23
|
list = content.join
|
24
24
|
else
|
@@ -11,12 +11,12 @@ module MarkdownUI
|
|
11
11
|
content = @content.strip unless @content.nil?
|
12
12
|
klass = MarkdownUI::KlassUtil.new(@klass).klass unless @klass.nil?
|
13
13
|
_id = if @id
|
14
|
-
" id=\
|
14
|
+
" id=\'#{@id.split.join('-')}\'"
|
15
15
|
end
|
16
16
|
|
17
17
|
data = if @data
|
18
18
|
_data, attribute, value = @data.split(':')
|
19
|
-
" data-#{attribute}=\
|
19
|
+
" data-#{attribute}=\'#{value}\'"
|
20
20
|
else
|
21
21
|
nil
|
22
22
|
end
|
data/lib/markdown-ui/version.rb
CHANGED
data/markdown-ui.gemspec
CHANGED
@@ -31,7 +31,8 @@ Gem::Specification.new do |spec|
|
|
31
31
|
spec.add_dependency "redcarpet", "~> 3.3"
|
32
32
|
spec.add_dependency "nokogiri", "~> 1.5", "~> 1.6"
|
33
33
|
spec.add_development_dependency "rake", "~> 10.0"
|
34
|
+
spec.add_development_dependency "byebug", "~> 6.0"
|
34
35
|
spec.add_development_dependency "test-unit", "~> 3.0"
|
35
36
|
spec.add_development_dependency "simplecov", "~> 0.10"
|
36
37
|
spec.add_development_dependency "codeclimate-test-reporter", "~> 0.4"
|
37
|
-
end
|
38
|
+
end
|
data/website/about.html
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
<!doctype html>
|
2
2
|
|
3
|
-
<html lang=
|
3
|
+
<html lang='en'>
|
4
4
|
<head>
|
5
|
-
<meta charset=
|
6
|
-
<meta http-equiv=
|
7
|
-
<meta name=
|
5
|
+
<meta charset='utf-8'>
|
6
|
+
<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
|
7
|
+
<meta name='viewport' content='width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1'>
|
8
8
|
|
9
|
-
<link rel=
|
10
|
-
<script src=
|
11
|
-
<script src=
|
9
|
+
<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.5/semantic.min.css'>
|
10
|
+
<script src='https://code.jquery.com/jquery-2.1.4.min.js'></script>
|
11
|
+
<script src='https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.5/semantic.min.js'></script>
|
12
12
|
|
13
13
|
<!--[if lt IE 9]>
|
14
|
-
<script src=
|
14
|
+
<script src='http://html5shiv.googlecode.com/svn/trunk/html5.js'></script>
|
15
15
|
<![endif]-->
|
16
16
|
</head>
|
17
17
|
|
data/website/docs/button.html
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
<!doctype html>
|
2
2
|
|
3
|
-
<html lang=
|
3
|
+
<html lang='en'>
|
4
4
|
<head>
|
5
|
-
<meta charset=
|
6
|
-
<meta http-equiv=
|
7
|
-
<meta name=
|
5
|
+
<meta charset='utf-8'>
|
6
|
+
<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
|
7
|
+
<meta name='viewport' content='width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1'>
|
8
8
|
|
9
|
-
<link rel=
|
10
|
-
<script src=
|
11
|
-
<script src=
|
9
|
+
<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.5/semantic.min.css'>
|
10
|
+
<script src='https://code.jquery.com/jquery-2.1.4.min.js'></script>
|
11
|
+
<script src='https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.5/semantic.min.js'></script>
|
12
12
|
|
13
13
|
<!--[if lt IE 9]>
|
14
|
-
<script src=
|
14
|
+
<script src='http://html5shiv.googlecode.com/svn/trunk/html5.js'></script>
|
15
15
|
<![endif]-->
|
16
16
|
</head>
|
17
17
|
|