Class: Vivlio::Starter::CLI::TocCommands::Heading
- Inherits:
-
Struct
- Object
- Struct
- Vivlio::Starter::CLI::TocCommands::Heading
- Defined in:
- lib/vivlio/starter/cli/toc.rb
Instance Attribute Summary collapse
-
#css_class ⇒ Object
Returns the value of attribute css_class.
-
#href ⇒ Object
Returns the value of attribute href.
-
#level ⇒ Object
Returns the value of attribute level.
-
#text ⇒ Object
Returns the value of attribute text.
Instance Method Summary collapse
-
#list_markup ⇒ Object
見出し情報から TOC 用の <li> 文字列を生成する <a> タグを使用してクリックで該当ページへジャンプ可能にする.
Instance Attribute Details
#css_class ⇒ Object
Returns the value of attribute css_class
316 317 318 |
# File 'lib/vivlio/starter/cli/toc.rb', line 316 def css_class @css_class end |
#href ⇒ Object
Returns the value of attribute href
316 317 318 |
# File 'lib/vivlio/starter/cli/toc.rb', line 316 def href @href end |
#level ⇒ Object
Returns the value of attribute level
316 317 318 |
# File 'lib/vivlio/starter/cli/toc.rb', line 316 def level @level end |
#text ⇒ Object
Returns the value of attribute text
316 317 318 |
# File 'lib/vivlio/starter/cli/toc.rb', line 316 def text @text end |
Instance Method Details
#list_markup ⇒ Object
見出し情報から TOC 用の <li> 文字列を生成する<a> タグを使用してクリックで該当ページへジャンプ可能にする
319 320 321 322 323 324 325 |
# File 'lib/vivlio/starter/cli/toc.rb', line 319 def list_markup if href && !href.empty? %(<li class="#{css_class}"><a href="#{href}" class="toc-title"><span class="toc-label">#{text}</span></a>) else %(<li class="#{css_class}"><span class="toc-title"><span class="toc-label">#{text}</span></span>) end end |