Commit 0145bcc3 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Give access to Assets to all meta-tags.

With this ready, our @aside tag can start accessing guides, videos
and examples.
parent 51103712
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -46,6 +46,9 @@ module JsDuck
      # Initialize guides, videos, examples, ...
      @assets = Assets.new(@relations, @opts)

      # Give access to assets from all meta-tags
      MetaTagRegistry.instance.assets = @assets

      if @opts.export
        format_classes
        FileUtils.rm_rf(@opts.output_dir) unless @opts.output_dir == :stdout
+4 −0
Original line number Diff line number Diff line
@@ -32,6 +32,10 @@ module JsDuck
    # method, event, etc.
    attr_accessor :context

    # Here the Assets object will be injected, so the Tag implementation
    # can access guides, videos, etc when he needs to.
    attr_accessor :assets

    # It gets passed an array of contents gathered from all meta-tags
    # of given type. It should return the value to be stored for this
    # meta-tag at :key. The returned value is also passed to #to_html
+5 −0
Original line number Diff line number Diff line
@@ -52,6 +52,11 @@ module JsDuck
      @tags.each {|tag| tag.formatter = doc_formatter }
    end

    # Gives access to assets for all tags
    def assets=(assets)
      @tags.each {|tag| tag.assets = assets }
    end

    # Returns array of attributes to be shown in member signatures
    # (and in order they should be shown in).
    def signatures