123456789_123456789_123456789_123456789_123456789_

Class: YARD::CLI::MarkupTypes

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Command
Instance Chain:
self, Command
Inherits: YARD::CLI::Command
Defined in: lib/yard/cli/markup_types.rb

Overview

Lists all markup types

Since:

  • 0.8.6

Class Method Summary

Command - Inherited

.run

Helper method to run the utility on an instance.

Instance Method Summary

Command - Inherited

Instance Method Details

#description

Since:

  • 0.8.6

[ GitHub ]

  
# File 'lib/yard/cli/markup_types.rb', line 7

def description; 'Lists all available markup types and libraries' end

#run(*args) ⇒ void

This method returns an undefined value.

Runs the commandline utility, parsing arguments and displaying a list of markup types

Parameters:

Since:

  • 0.8.6

[ GitHub ]

  
# File 'lib/yard/cli/markup_types.rb', line 14

def run(*args) # rubocop:disable Lint/UnusedMethodArgument
  log.puts "Available markup types for `doc' command:"
  log.puts
  types = Templates::Helpers::MarkupHelper::MARKUP_PROVIDERS
  exts = Templates::Helpers::MarkupHelper::MARKUP_EXTENSIONS
  types.sort_by {|name, _| name.to_s }.each do |name, providers|
    log.puts "[#{name}]"
    libs = providers.map {|p| p[:lib] }.compact
    log.puts "  Providers: #{libs.join(" ")}" unless libs.empty?
    if exts[name]
      log.puts "  Extensions: #{exts[name].map {|e| ".#{e}" }.join(" ")}"
    end

    log.puts
  end
end