Commit 457b9841 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Inject the assets to @aside tag directly.

Don't pass them through the TagRegistry.  Either way it's a hack, but
doing it through TagRegistry is only adding an extra layer of
indirection.
parent d4b8a1ba
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -38,8 +38,8 @@ module JsDuck
      # Initialize guides, videos, examples, ...
      @assets = Assets.new(@relations, @opts)

      # Give access to assets from all tags
      TagRegistry.assets = @assets
      # HACK: Give access to assets from @aside tag
      TagRegistry.get_by_key(:aside).assets = @assets
    end

    def generate_export
+1 −0
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@ module JsDuck::Tag
      @html_position = :top
    end

    # Parses: @aside [ guide | video| example ] name
    def parse_doc(p)
      {
        :tagname => :aside,
+0 −5
Original line number Diff line number Diff line
@@ -108,11 +108,6 @@ module JsDuck
    def get_by_key(key)
      @keys[key]
    end

    # Gives access to assets from @aside tag
    def assets=(assets)
      @keys[:aside].assets = assets
    end
  end

end