Module: Shoes::DSL::Text
- Included in:
- Shoes::DSL
- Defined in:
- shoes-core/lib/shoes/dsl/text.rb
Overview
DSL methods for displaying text in Shoes applications
Instance Method Summary collapse
-
#banner(text = '', opts = {}) ⇒ Shoes::Banner
Large banner sized text block.
-
#bg(*texts, color) ⇒ Shoes::Span
Displays text in different background color.
-
#caption(text = '', opts = {}) ⇒ Shoes::Caption
Caption sized text block.
-
#code(text = '') ⇒ Shoes::Span
Displays with in a monospaced font.
-
#del(text = '') ⇒ Shoes::Span
Displays with strikethrough.
-
#em(text = '') ⇒ Shoes::Span
Displays emphasized text.
-
#fg(*texts, color) ⇒ Shoes::Span
Displays text in different foreground color.
-
#ins(text = '') ⇒ Shoes::Span
Displays underlined.
-
#inscription(text = '', opts = {}) ⇒ Shoes::Inscription
Small, inscription sized text block.
-
#link(*texts, opts, &blk) ⇒ Shoes::Span
Displays a link within a text block.
-
#para(text = '', opts = {}) ⇒ Shoes::Para
Paragraph sized text block.
-
#span(*texts, opts) ⇒ Shoes::Span
Displays a subsection of text within a larger text block.
-
#strong(text = '') ⇒ Shoes::Span
Displays bolded text.
-
#sub(text = '') ⇒ Shoes::Span
Displays as subscript.
-
#subtitle(text = '', opts = {}) ⇒ Shoes::Subtitle
Subtitle sized text block.
-
#sup(text = '') ⇒ Shoes::Span
Displays as superscript.
-
#tagline(text = '', opts = {}) ⇒ Shoes::Tagline
Tagline sized text block.
-
#title(text = '', opts = {}) ⇒ Shoes::Title
Title sized text block.
Instance Method Details
#banner(text = '', opts = {}) ⇒ Shoes::Banner
Large banner sized text block.
|
# File 'shoes-core/lib/shoes/dsl/text.rb', line 9
|
#bg(*texts, color) ⇒ Shoes::Span
Displays text in different background color. Intended to be called within another text block.
142 143 144 |
# File 'shoes-core/lib/shoes/dsl/text.rb', line 142 def bg(*texts, color) Shoes::Span.new texts, fill: pattern(color) end |
#caption(text = '', opts = {}) ⇒ Shoes::Caption
Caption sized text block.
|
# File 'shoes-core/lib/shoes/dsl/text.rb', line 33
|
#code(text = '') ⇒ Shoes::Span
Displays with in a monospaced font. Intended to be called within another text block.
|
# File 'shoes-core/lib/shoes/dsl/text.rb', line 58
|
#del(text = '') ⇒ Shoes::Span
Displays with strikethrough. Intended to be called within another text block.
|
# File 'shoes-core/lib/shoes/dsl/text.rb', line 65
|
#em(text = '') ⇒ Shoes::Span
Displays emphasized text. Intended to be called within another text block.
|
# File 'shoes-core/lib/shoes/dsl/text.rb', line 72
|
#fg(*texts, color) ⇒ Shoes::Span
Displays text in different foreground color. Intended to be called within another text block.
132 133 134 |
# File 'shoes-core/lib/shoes/dsl/text.rb', line 132 def fg(*texts, color) Shoes::Span.new texts, stroke: pattern(color) end |
#ins(text = '') ⇒ Shoes::Span
Displays underlined. Intended to be called within another text block.
|
# File 'shoes-core/lib/shoes/dsl/text.rb', line 79
|
#inscription(text = '', opts = {}) ⇒ Shoes::Inscription
Small, inscription sized text block.
50 51 52 53 54 55 56 |
# File 'shoes-core/lib/shoes/dsl/text.rb', line 50 %w[banner title subtitle tagline caption para inscription].each do |method| define_method method do |*texts| styles = pop_style(texts) klass = Shoes.const_get(method.capitalize) create klass, texts, styles end end |
#link(*texts, opts, &blk) ⇒ Shoes::Span
Displays a link within a text block. Intended to be called within another text block.
158 159 160 161 |
# File 'shoes-core/lib/shoes/dsl/text.rb', line 158 def link(*texts, &blk) opts = normalize_style_for_element(Shoes::Link, texts) Shoes::Link.new @__app__, texts, opts, blk end |
#para(text = '', opts = {}) ⇒ Shoes::Para
Paragraph sized text block.
|
# File 'shoes-core/lib/shoes/dsl/text.rb', line 39
|
#span(*texts, opts) ⇒ Shoes::Span
Displays a subsection of text within a larger text block. Intended to be called within another text block to apply styling.
174 175 176 177 |
# File 'shoes-core/lib/shoes/dsl/text.rb', line 174 def span(*texts) opts = normalize_style_for_element(Shoes::Span, texts) Shoes::Span.new texts, opts end |
#strong(text = '') ⇒ Shoes::Span
Displays bolded text. Intended to be called within another text block.
|
# File 'shoes-core/lib/shoes/dsl/text.rb', line 100
|
#sub(text = '') ⇒ Shoes::Span
Displays as subscript. Intended to be called within another text block.
|
# File 'shoes-core/lib/shoes/dsl/text.rb', line 86
|
#subtitle(text = '', opts = {}) ⇒ Shoes::Subtitle
Subtitle sized text block.
|
# File 'shoes-core/lib/shoes/dsl/text.rb', line 21
|
#sup(text = '') ⇒ Shoes::Span
Displays as superscript. Intended to be called within another text block.
|
# File 'shoes-core/lib/shoes/dsl/text.rb', line 93
|
#tagline(text = '', opts = {}) ⇒ Shoes::Tagline
Tagline sized text block.
|
# File 'shoes-core/lib/shoes/dsl/text.rb', line 27
|
#title(text = '', opts = {}) ⇒ Shoes::Title
Title sized text block.
|
# File 'shoes-core/lib/shoes/dsl/text.rb', line 15
|