diff --git a/lib/tasks/docs.thor b/lib/tasks/docs.thor index a80e19d2..ff648079 100644 --- a/lib/tasks/docs.thor +++ b/lib/tasks/docs.thor @@ -15,8 +15,14 @@ class DocsCLI < Thor option :packaged, type: :boolean def list if options[:packaged] - names = Dir[File.join(Docs.store_path, '*.tar.gz')].map { |f| File.basename(f, '.tar.gz') } - puts names + slugs = Dir[File.join(Docs.store_path, '*.tar.gz')].map { |f| File.basename(f, '.tar.gz') } + names = find_docs_by_slugs(slugs).map do |doc| + name = if doc.version? + "#{doc.superclass.to_s.demodulize.underscore}@#{doc.version}" + else + doc.to_s.demodulize.underscore + end + end else names = Docs.all.flat_map do |doc| name = doc.to_s.demodulize.underscore @@ -26,12 +32,12 @@ class DocsCLI < Thor name end end + end - output = names.join("\n") + output = names.join("\n") - require 'tty-pager' - TTY::Pager.new.page(output) - end + require 'tty-pager' + TTY::Pager.new.page(output) end desc 'page [path] [--version] [--verbose] [--debug]', 'Generate a page (no indexing)'