Module: NanDoc::Helpers::NanDocHelpers

Includes:
StringMethods
Defined in:
lib/nandoc/helpers.rb,
lib/nandoc/helpers/top-nav.rb,
lib/nandoc/helpers/site-map.rb,
lib/nandoc/helpers/menu-bouncy.rb

Defined Under Namespace

Modules: BlockAttrAccessor Classes: MenuBouncy, SiteMap, TopNav

Instance Method Summary collapse

Methods included from StringMethods

#basename_no_extension, #indent, #no_blank_lines, #no_leading_ws, #no_trailing_ws, oxford_comma, #quoted, #reindent, #unindent

Instance Method Details

#nandoc_menu_bouncy(binding, &block) ⇒ Object

render topnav with one level of menu dropdows with buggy animated opening and closing.

usage example:

nandoc_menu_bouncy(binding) do |it|
  it.separator = These['']
  it.tabs = 4
end


13
14
15
# File 'lib/nandoc/helpers/menu-bouncy.rb', line 13

def nandoc_menu_bouncy binding, &block
  MenuBouncy.new(binding, &block).render
end

#nandoc_sitemap(binding, name = nil, &block) ⇒ Object

See Also:

  • for example usage.


9
10
11
12
# File 'lib/nandoc/helpers/site-map.rb', line 9

def nandoc_sitemap binding, name=nil, &block
  name ||= SiteMap.next_unique_name
  SiteMap.singleton(name, binding, &block).render_parent
end

#nandoc_topnav(&block) ⇒ Object

nandoc_topnav do |sm|

sm.binding = binding
sm.item { |i| <<-H
  <span class='nanoc-sidebar-h2'>#{i.nandoc_title}</span>
H
}
sm.current_item { |i| <<-H
  <span class='nanoc-sidebar-h2'>#{i.nandoc_title}</span>
H
}
sm.separator { <<-H
  <span class='nanoc-sep'>&#10087;</span>
H
}


20
21
22
# File 'lib/nandoc/helpers/top-nav.rb', line 20

def nandoc_topnav &block
  TopNav.new(&block).render
end