diff --git a/docs/_plugins/custom_filters.rb b/docs/_plugins/custom_filters.rb index 2d0ff09d68..6013d57f86 100644 --- a/docs/_plugins/custom_filters.rb +++ b/docs/_plugins/custom_filters.rb @@ -28,6 +28,24 @@ module CustomFilters any end + # sorts an array using the order defined by the given sidebar + def sort_using(xs, sidebar) + # caching is possible but doesn't improve significantly the build times + + rank_lookup = rank_lookup_from_sidebar(sidebar) + + xs.sort {|x, y| + # The default rank is very high so that pages that don't appear in the sidebar are put at the end + rx = rank_lookup[x.url] || 10000 + ry = rank_lookup[y.url] || 10000 + + rx <=> ry + } + + end + + private + def flatten_rec(seq) seq.map {|h| if (subs = h["folderitems"] || h["subfolderitems"] || h["subfolders"]) @@ -50,24 +68,6 @@ module CustomFilters end - - - # sorts an array using the order defined by the given sidebar - def sort_using(xs, sidebar) - # caching is possible but doesn't improve significantly the build times - - rank_lookup = rank_lookup_from_sidebar(sidebar) - - xs.sort {|x, y| - # The default rank is very high so that pages that don't appear in the sidebar are put at the end - rx = rank_lookup[x.url] || 10000 - ry = rank_lookup[y.url] || 10000 - - rx <=> ry - } - - end - end Liquid::Template.register_filter(CustomFilters) diff --git a/docs/pages/pmd/userdocs/cli_reference.md b/docs/pages/pmd/userdocs/cli_reference.md index 835520641a..0ea31bd17c 100644 --- a/docs/pages/pmd/userdocs/cli_reference.md +++ b/docs/pages/pmd/userdocs/cli_reference.md @@ -44,13 +44,13 @@ The tool comes with a rather extensive help text, simply running with `-help`! specified.