Module: Aws::Templates::Help::Rdoc::Texting
- Included in:
- Aws::Templates::Help::Rdoc, Artifact, Parametrized::Nested, Provider
- Defined in:
- lib/aws/templates/help/rdoc/texting.rb
Overview
Rdoc classes wrapper
Creates simple DSL over Rdoc native classes so text blocks can be composed in idiomatic Ruby way.
Instance Method Summary collapse
- #document(*parts) {|doc| ... } ⇒ Object
- #list(type = :BULLET, *parts) {|list| ... } ⇒ Object
- #parsed_for(str) ⇒ Object
- #sub(*parts) {|item| ... } ⇒ Object
- #text(str) ⇒ Object
Instance Method Details
#document(*parts) {|doc| ... } ⇒ Object
33 34 35 36 37 |
# File 'lib/aws/templates/help/rdoc/texting.rb', line 33 def document(*parts) doc = ::RDoc::Markup::Document.new(*parts) yield doc if block_given? doc end |
#list(type = :BULLET, *parts) {|list| ... } ⇒ Object
23 24 25 26 27 |
# File 'lib/aws/templates/help/rdoc/texting.rb', line 23 def list(type = :BULLET, *parts) list = ::RDoc::Markup::List.new(type, *parts) yield list if block_given? list end |
#parsed_for(str) ⇒ Object
29 30 31 |
# File 'lib/aws/templates/help/rdoc/texting.rb', line 29 def parsed_for(str) sub { |s| RDoc::Markup.parse(str).each { |part| s << part } } end |
#sub(*parts) {|item| ... } ⇒ Object
13 14 15 16 17 |
# File 'lib/aws/templates/help/rdoc/texting.rb', line 13 def sub(*parts) item = ::RDoc::Markup::ListItem.new(nil, *parts) yield item if block_given? item end |
#text(str) ⇒ Object
19 20 21 |
# File 'lib/aws/templates/help/rdoc/texting.rb', line 19 def text(str) ::RDoc::Markup::Paragraph.new(str) end |