Loading lib/jsduck/exporter/full.rb +2 −1 Original line number Diff line number Diff line require 'jsduck/class' require 'jsduck/member_registry' require 'ostruct' module JsDuck module Exporter # Exporter for all the class docs. class Full def initialize(relations, opts={}) def initialize(relations, opts=OpenStruct.new) # parameters are just for compatibility with other exporters end Loading lib/jsduck/format/doc.rb +3 −2 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ require 'jsduck/inline/link_renderer' require 'jsduck/inline/img' require 'jsduck/inline/video' require 'jsduck/inline/example' require 'ostruct' module JsDuck module Format Loading @@ -18,7 +19,7 @@ module JsDuck # Creates a formatter configured with options originating from # command line. For the actual effect of the options see # Inline::* classes. def initialize(relations={}, opts={}) def initialize(relations={}, opts=OpenStruct.new) @relations = relations @opts = opts @subproperties = Format::Subproperties.new(self) Loading Loading @@ -104,7 +105,7 @@ module JsDuck # Keep track of open HTML tags. We're not auto-detecting class # names when inside <a>. Also we want to close down the unclosed # tags. tags = Format::HtmlStack.new(@opts[:ignore_html] || {}, @doc_context) tags = Format::HtmlStack.new(@opts.ignore_html || {}, @doc_context) while !s.eos? do if substitute = @inline_link.replace(s) Loading lib/jsduck/inline/example.rb +3 −1 Original line number Diff line number Diff line require 'ostruct' module JsDuck module Inline Loading @@ -14,7 +16,7 @@ module JsDuck class Example # Constructor takes opts parameter for consistency with other # JsDuck::Inline::* classes. def initialize(opts={}) def initialize(opts=OpenStruct.new) @re = /<pre><code>\s*@example( +[^\n]*)?\s+/m end Loading lib/jsduck/inline/img.rb +3 −3 Original line number Diff line number Diff line require 'jsduck/util/html' require 'jsduck/logger' require 'pp' require 'ostruct' module JsDuck module Inline Loading @@ -15,8 +15,8 @@ module JsDuck # Used for error reporting. attr_accessor :doc_context def initialize(opts={}) @tpl = opts[:img] || '<img src="%u" alt="%a" width="%w" height="%h"/>' def initialize(opts=OpenStruct.new) @tpl = opts.img || '<img src="%u" alt="%a" width="%w" height="%h"/>' @re = /\{@img\s+(\S*?)(?:\s+(.+?))?\}/m end Loading lib/jsduck/inline/link_renderer.rb +3 −2 Original line number Diff line number Diff line require 'jsduck/util/html' require 'ostruct' module JsDuck module Inline Loading @@ -9,7 +10,7 @@ module JsDuck # Inline::AutoLink. attr_reader :relations def initialize(relations={}, opts={}) def initialize(relations={}, opts=OpenStruct.new) @relations = relations # Template HTML that replaces {@link Class#member anchor text}. Loading @@ -20,7 +21,7 @@ module JsDuck # %# - inserts "#" if member name present # %- - inserts "-" if member name present # %a - anchor text for link @tpl = opts[:link] || '<a href="%c%#%m">%a</a>' @tpl = opts.link || '<a href="%c%#%m">%a</a>' end # Generates HTML link to class or member applying the link Loading Loading
lib/jsduck/exporter/full.rb +2 −1 Original line number Diff line number Diff line require 'jsduck/class' require 'jsduck/member_registry' require 'ostruct' module JsDuck module Exporter # Exporter for all the class docs. class Full def initialize(relations, opts={}) def initialize(relations, opts=OpenStruct.new) # parameters are just for compatibility with other exporters end Loading
lib/jsduck/format/doc.rb +3 −2 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ require 'jsduck/inline/link_renderer' require 'jsduck/inline/img' require 'jsduck/inline/video' require 'jsduck/inline/example' require 'ostruct' module JsDuck module Format Loading @@ -18,7 +19,7 @@ module JsDuck # Creates a formatter configured with options originating from # command line. For the actual effect of the options see # Inline::* classes. def initialize(relations={}, opts={}) def initialize(relations={}, opts=OpenStruct.new) @relations = relations @opts = opts @subproperties = Format::Subproperties.new(self) Loading Loading @@ -104,7 +105,7 @@ module JsDuck # Keep track of open HTML tags. We're not auto-detecting class # names when inside <a>. Also we want to close down the unclosed # tags. tags = Format::HtmlStack.new(@opts[:ignore_html] || {}, @doc_context) tags = Format::HtmlStack.new(@opts.ignore_html || {}, @doc_context) while !s.eos? do if substitute = @inline_link.replace(s) Loading
lib/jsduck/inline/example.rb +3 −1 Original line number Diff line number Diff line require 'ostruct' module JsDuck module Inline Loading @@ -14,7 +16,7 @@ module JsDuck class Example # Constructor takes opts parameter for consistency with other # JsDuck::Inline::* classes. def initialize(opts={}) def initialize(opts=OpenStruct.new) @re = /<pre><code>\s*@example( +[^\n]*)?\s+/m end Loading
lib/jsduck/inline/img.rb +3 −3 Original line number Diff line number Diff line require 'jsduck/util/html' require 'jsduck/logger' require 'pp' require 'ostruct' module JsDuck module Inline Loading @@ -15,8 +15,8 @@ module JsDuck # Used for error reporting. attr_accessor :doc_context def initialize(opts={}) @tpl = opts[:img] || '<img src="%u" alt="%a" width="%w" height="%h"/>' def initialize(opts=OpenStruct.new) @tpl = opts.img || '<img src="%u" alt="%a" width="%w" height="%h"/>' @re = /\{@img\s+(\S*?)(?:\s+(.+?))?\}/m end Loading
lib/jsduck/inline/link_renderer.rb +3 −2 Original line number Diff line number Diff line require 'jsduck/util/html' require 'ostruct' module JsDuck module Inline Loading @@ -9,7 +10,7 @@ module JsDuck # Inline::AutoLink. attr_reader :relations def initialize(relations={}, opts={}) def initialize(relations={}, opts=OpenStruct.new) @relations = relations # Template HTML that replaces {@link Class#member anchor text}. Loading @@ -20,7 +21,7 @@ module JsDuck # %# - inserts "#" if member name present # %- - inserts "-" if member name present # %a - anchor text for link @tpl = opts[:link] || '<a href="%c%#%m">%a</a>' @tpl = opts.link || '<a href="%c%#%m">%a</a>' end # Generates HTML link to class or member applying the link Loading