lib/rdoc/generator/markdown.rb in rdoc-markdown-0.2 vs lib/rdoc/generator/markdown.rb in rdoc-markdown-0.2.1

- old
+ new

@@ -30,11 +30,11 @@ attr_reader :base_dir ## # Classes and modules to be used by this generator, not necessarily - # displayed. See also #modsort + # displayed. attr_reader :classes ## # Directory where generated class HTML files live relative to the output @@ -61,16 +61,14 @@ ## # Generates markdown files and search index file def generate + debug("Setting things up #{@output_dir}") + setup - debug("Create directory #{@output_dir}") - - output_dir.mkpath - debug("Generate documentation in #{@output_dir}") emit_classfiles debug("Generate index db file: #{output_dir}/index.db") @@ -122,27 +120,27 @@ next if method.visibility.to_s.eql?("private") result << { name: "#{klass.full_name}.#{method.name}", type: "Method", - path: "#{turn_to_path(klass.full_name)}#meth-#{ActiveSupport::Inflector.parameterize method.name}" + path: "#{turn_to_path(klass.full_name)}##{method.aref}" } end klass.constants.sort_by { |x| x.name }.each do |const| result << { name: "#{klass.full_name}.#{const.name}", type: "Constant", - path: "#{turn_to_path(klass.full_name)}#const-#{ActiveSupport::Inflector.parameterize const.name}" + path: "#{turn_to_path(klass.full_name)}##{ActiveSupport::Inflector.parameterize const.name}" } end klass.attributes.sort_by { |x| x.name }.each do |attr| result << { name: "#{klass.full_name}.#{attr.name}", type: "Attribute", - path: "#{turn_to_path(klass.full_name)}#attr-#{ActiveSupport::Inflector.parameterize attr.name}" + path: "#{turn_to_path(klass.full_name)}##{attr.aref}" } end end result.each do |rec| @@ -213,14 +211,14 @@ def setup return if instance_variable_defined?(:@output_dir) @output_dir = Pathname.new(@options.op_dir).expand_path(@base_dir) + @output_dir.mkpath return unless @store @classes = @store.all_classes_and_modules.sort - @modsort = get_sorted_module_list @classes end ## # Return a list of the documented modules sorted by salience first, then # by name.