Sha256: df7ece22e25070a222d2f0f905f65bc0a6b9aa5d3b49d08ced5fc956d305ea6e

Contents?: true

Size: 1.73 KB

Versions: 40

Compression:

Stored size: 1.73 KB

Contents

# require "sdoc"
require "rdoc/task"
require_relative "../lib/net/imap"
require 'rdoc/rdoc' unless defined?(RDoc::Markup::ToHtml)

module RDoc::Generator
  module NetIMAP

    module RemoveRedundantParens
      def param_seq
        super.sub(/^\(\)\s*/, "")
      end
    end

    # See https://github.com/ruby/rdoc/pull/936
    module FixSectionComments
      def markup(text)
        @store ||= @parent&.store
        super
      end
      def description; markup comment end
      def comment;     super || @comments&.first end
      def parse(_comment_location = nil) super() end
    end

    # render "[label] data" lists as tables.  adapted from "hanna-nouveau" gem.
    module LabelListTable
      def list_item_start(list_item, list_type)
        case list_type
        when :NOTE
          %(<tr><td class='label'>#{Array(list_item.label).map{|label| to_html(label)}.join("<br />")}</td><td>)
        else
          super
        end
      end

      def list_end_for(list_type)
        case list_type
        when :NOTE then
          "</td></tr>"
        else
          super
        end
      end
    end

  end
end

class RDoc::AnyMethod
  prepend RDoc::Generator::NetIMAP::RemoveRedundantParens
end

class RDoc::Context::Section
  prepend RDoc::Generator::NetIMAP::FixSectionComments
end

class RDoc::Markup::ToHtml
  LIST_TYPE_TO_HTML[:NOTE] = ['<table class="rdoc-list note-list"><tbody>', '</tbody></table>']
  prepend RDoc::Generator::NetIMAP::LabelListTable
end

RDoc::Task.new do |doc|
  doc.main       = "README.md"
  doc.title      = "net-imap #{Net::IMAP::VERSION}"
  doc.rdoc_dir   = "doc"
  doc.rdoc_files = FileList.new %w[lib/**/*.rb *.rdoc *.md]
  doc.options << "--template-stylesheets" << "docs/styles.css"
  # doc.generator  = "hanna"
end

Version data entries

40 entries across 39 versions & 6 rubygems

Version Path
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.1.0/gems/net-imap-0.5.1/rakelib/rdoc.rake
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.3.0/gems/net-imap-0.5.1/rakelib/rdoc.rake
net-imap-0.5.5 rakelib/rdoc.rake
minato_ruby_api_client-0.2.2 vendor/bundle/ruby/3.2.0/gems/net-imap-0.4.14/rakelib/rdoc.rake
net-imap-0.5.4 rakelib/rdoc.rake
net-imap-0.5.3 rakelib/rdoc.rake
net-imap-0.5.2 rakelib/rdoc.rake
net-imap-0.4.18 rakelib/rdoc.rake
net-imap-0.5.1 rakelib/rdoc.rake
net-imap-0.5.0 rakelib/rdoc.rake
net-imap-0.4.17 rakelib/rdoc.rake
net-imap-0.4.16 rakelib/rdoc.rake
net-imap-0.4.15 rakelib/rdoc.rake
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/net-imap-0.4.14/rakelib/rdoc.rake
net-imap-0.4.14 rakelib/rdoc.rake
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/net-imap-0.4.11/rakelib/rdoc.rake
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/net-imap-0.4.11/rakelib/rdoc.rake
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/net-imap-0.4.11/rakelib/rdoc.rake
net-imap-0.4.13 rakelib/rdoc.rake
tinymce-rails-7.1.2 vendor/bundle/ruby/3.3.0/gems/net-imap-0.4.12/rakelib/rdoc.rake