Sha256: 835e55cc98f33d15f73b3e2b6a042521de51a3422a63a3a16e958362c79d94db
Contents?: true
Size: 908 Bytes
Versions: 7
Compression:
Stored size: 908 Bytes
Contents
require 'rubygems' require 'rdoc/markup/to_html' module WLang class EncoderSet # Provides the rdoc encoder module RDocEncoders # Default encoders DEFAULT_ENCODERS = {"html" => :rdoc_encoding, "div" => :rdoc_encoding, "nop" => :nop_encoding} # RDoc encoding def self.rdoc_encoding(src, options); encoder = RDoc::Markup::ToHtml.new if options['_template_'] and options['_template_'].source_file encoder.instance_eval do @from_path = File.dirname(options['_template_'].source_file) end end encoder.convert(src) end # RDoc encoding, removing enclosing <tt><p>...</p></tt> def self.nop_encoding(src, options); rdoc = RDoc::Markup::ToHtml.new.convert(src) rdoc = $1 if /^\s*<p>\s*(.*?)\s+<\/p>\s*$/m =~ rdoc rdoc end end # RDoc end end
Version data entries
7 entries across 7 versions & 1 rubygems