Skip to content

Commit 21b533d

Browse files
Merge pull request #228 from stiwwelll/develop
Add ruby, rt and rp tags
2 parents a476da4 + 74c0242 commit 21b533d

File tree

13 files changed

+274
-1
lines changed

13 files changed

+274
-1
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
%rp{@tag_attributes}
2+
- if options[:text].nil? && block_given?
3+
= yield
4+
- else
5+
= options[:text]
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module Matestack::Ui::Core::Rp
2+
class Rp < Matestack::Ui::Core::Component::Static
3+
4+
end
5+
end
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
%rt{@tag_attributes}
2+
- if options[:text].nil? && block_given?
3+
= yield
4+
- else
5+
= options[:text]
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module Matestack::Ui::Core::Rt
2+
class Rt < Matestack::Ui::Core::Component::Static
3+
4+
end
5+
end
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
%ruby{@tag_attributes}
2+
- if options[:text].nil? && block_given?
3+
= yield
4+
- else
5+
= options[:text]
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module Matestack::Ui::Core::Ruby
2+
class Ruby < Matestack::Ui::Core::Component::Static
3+
4+
end
5+
end

docs/components/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ You can build your [own components](/docs/extend/custom_components.md) as well,
99
- [header](/docs/components/header.md)
1010
- [footer](/docs/components/footer.md)
1111
- [main](/docs/components/main.md)
12-
- [nav](/docs/components/nav,md)
12+
- [nav](/docs/components/nav.md)
1313
- [section](/docs/components/section.md)
1414
- [br](/docs/components/br.md)
1515
- [hr](/docs/components/hr.md)
@@ -33,6 +33,9 @@ You can build your [own components](/docs/extend/custom_components.md) as well,
3333
- [link](/docs/components/link.md)
3434
- [label](/docs/components/label.md)
3535
- [progress](/docs/components/progress.md)
36+
- [ruby](/docs/components/ruby.md)
37+
- [rt](/docs/components/rb.md)
38+
- [rp](/docs/components/rt.md)
3639
- [legend](/docs/components/legend.md)
3740
- [noscript](/docs/components/noscript.md)
3841

docs/components/rp.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# matestack core component: Rp
2+
3+
Show [specs](/spec/usage/components/rp_spec.rb)
4+
5+
The HTML rp tag implemented in ruby.
6+
7+
## Parameters
8+
9+
This component can take 2 optional configuration params and optional content.
10+
11+
#### # id (optional)
12+
Expects a string with all ids the rp should have.
13+
14+
#### # class (optional)
15+
Expects a string with all classes the rp should have.
16+
17+
## Example 1: Yield a given block
18+
19+
```ruby
20+
rp id: "foo", class: "bar" do
21+
plain 'Hello World' # optional content
22+
end
23+
```
24+
25+
returns
26+
27+
```html
28+
<rp id="foo" class="bar">
29+
Hello World
30+
</rp>
31+
```
32+
33+
## Example 2: Render options[:text] param
34+
35+
```ruby
36+
rp id: "foo", class: "bar", text: 'Hello World'
37+
```
38+
39+
returns
40+
41+
```html
42+
<rp id="foo" class="bar">
43+
Hello World
44+
</rp>

docs/components/rt.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# matestack core component: Rt
2+
3+
Show [specs](/spec/usage/components/rt_spec.rb)
4+
5+
The HTML rt tag implemented in ruby.
6+
7+
## Parameters
8+
9+
This component can take 2 optional configuration params and optional content.
10+
11+
#### # id (optional)
12+
Expects a string with all ids the rt should have.
13+
14+
#### # class (optional)
15+
Expects a string with all classes the rt should have.
16+
17+
## Example 1: Yield a given block
18+
19+
```ruby
20+
rt id: "foo", class: "bar" do
21+
plain 'Hello World' # optional content
22+
end
23+
```
24+
25+
returns
26+
27+
```html
28+
<rt id="foo" class="bar">
29+
Hello World
30+
</rt>
31+
```
32+
33+
## Example 2: Render options[:text] param
34+
35+
```ruby
36+
rt id: "foo", class: "bar", text: 'Hello World'
37+
```
38+
39+
returns
40+
41+
```html
42+
<rt id="foo" class="bar">
43+
Hello World
44+
</rt>

docs/components/ruby.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# matestack core component: Ruby
2+
3+
Show [specs](/spec/usage/components/ruby_spec.rb)
4+
5+
The HTML ruby tag implemented in ruby.
6+
7+
## Parameters
8+
9+
This component can take 2 optional configuration params and optional content.
10+
11+
#### # id (optional)
12+
Expects a string with all ids the ruby should have.
13+
14+
#### # class (optional)
15+
Expects a string with all classes the ruby should have.
16+
17+
## Example 1: : Yield a given block
18+
19+
```ruby
20+
ruby id: "foo", class: "bar" do
21+
plain 'Hello World' # optional content
22+
end
23+
```
24+
25+
returns
26+
27+
```html
28+
<ruby id="foo" class="bar">
29+
Hello World
30+
</ruby>
31+
```
32+
33+
## Example 2: Render options[:text] param
34+
35+
```ruby
36+
ruby id: "foo", class: "bar", text: 'Hello World'
37+
```
38+
39+
returns
40+
41+
```html
42+
<ruby id="foo" class="bar">
43+
Hello World
44+
</ruby>

0 commit comments

Comments
 (0)