X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=_plugins%2Fmanual.rb;h=2a5d905b9ef590f41e33ac1f515cd1e78e53e773;hb=72b45cdd036b0cc51a55c414298315ebc105abed;hp=4b43cc63a7639f1e47320b6ab6526fb62df3051f;hpb=8dda4023a5e675351ea43924f8e477af05eadccc;p=ardour-manual-diverged diff --git a/_plugins/manual.rb b/_plugins/manual.rb index 4b43cc6..2a5d905 100644 --- a/_plugins/manual.rb +++ b/_plugins/manual.rb @@ -22,7 +22,7 @@ module Manual def self.traverse(path, directory_sort = false, paths = [], key_paths = [], &block) - entries = Dir.glob(File.join(path,'*')) + entries = Dir.glob(File.join(path,'*')).sort entries.sort_by! { |e| File.directory?(e) ? 1 : 0 } if directory_sort @@ -131,7 +131,13 @@ module Manual "
  • #{child[:title]}
  • " end.uniq - "" + "
    +

    This chapter covers the following topics:

    + +
    + " end end end @@ -177,14 +183,14 @@ module Manual current_a = current.split('/').reject(&:empty?) tree = Manual.traverse_data(@@data_tree) do |entry| - + url = entry[:url] url_a = url.split('/').reject(&:empty?) depth = url_a.length is_current, position, level = *process_hierarchy(current_a, url_a) - + # this massively speeds up build time by not including the whole menu tree for each page next if depth > 1 && current_a[0] != url_a[0] @@ -201,7 +207,7 @@ module Manual erb = ::ERB.new <<-HTML
    - <%= entry[:menu_title] %> + <%= entry[:menu_title] %>
    <% if entry[:children].any? %> @@ -221,7 +227,7 @@ module Manual erb = ::ERB.new <<-HTML
    - <%= entry[:menu_title] %> + <%= entry[:menu_title] %>
    @@ -230,9 +236,20 @@ module Manual erb.result(binding) end end + + end - "
    #{tree.join}
    " + "
    #{tree.join}
    + " end