Sha256: 1aafa00a0e6dd401d360a4b3f223c3ab2277467801675400df3f5d470d7703a0

Contents?: true

Size: 1.22 KB

Versions: 7

Compression:

Stored size: 1.22 KB

Contents

require 'rdoc/generators/html_generator'

# Defines a specialized generator so it can be called for using a --fmt option.
class CDocHTMLGenerator < Generators::HTMLGenerator  # :nodoc:
end

module Generators # :nodoc:
  const_set(:RubyToken, RDoc::RubyToken)

  class HtmlClass < ContextUser # :nodoc:
    alias cdoc_original_value_hash value_hash
    
    def value_hash
      # split attributes into configurations and regular attributes
      configurations, attributes = @context.attributes.partition do |attribute|
        attribute.kind_of?(CDoc::ConfigAttr)
      end
      
      # set the context attributes to JUST the regular 
      # attributes and process as usual.
      @context.attributes.clear.concat attributes
      values = cdoc_original_value_hash
      
      # set the context attributes to the configurations
      # and echo the regular processing to produce a list
      # of configurations
      @context.attributes.clear.concat configurations
      @context.sections.each_with_index do |section, i|
        secdata = values["sections"][i]
 
        al = build_attribute_list(section)
        secdata["configurations"] = al unless al.empty?
      end 

      values
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
configurable-0.7.0 lib/cdoc/cdoc_html_generator.rb
configurable-0.6.0 lib/cdoc/cdoc_html_generator.rb
configurable-0.4.0 lib/cdoc/cdoc_html_generator.rb
configurable-0.3.0 lib/cdoc/cdoc_html_generator.rb
configurable-0.4.1 lib/cdoc/cdoc_html_generator.rb
configurable-0.4.2 lib/cdoc/cdoc_html_generator.rb
configurable-0.5.0 lib/cdoc/cdoc_html_generator.rb