Skip to content
  1. Dec 19, 2012
  2. Dec 18, 2012
  3. Dec 17, 2012
  4. Dec 13, 2012
  5. Dec 12, 2012
    • Scott Whittaker's avatar
      Generate full paths for images in guides · 4bc20fcf
      Scott Whittaker authored
      Suppose we're using JSDuck to generate guides from the following directory
      structure:
      
      somedir/
        guides.json
        guides/
          getting_started/
            README.md
            some-image.png
          nested/
            first_guide/
              README.md
              one.png
            second_guide/
              README.md
              one.png
      
      In JSDuck's generated HTML, image tags in the Getting Started guide will point
      to the correct path relative to the page (e.g.
      'guides/guide_getting_started/some-image.png'). However, the nested guides will
      specify the wrong paths to images: JSDuck will write
      'guides/first_guide/one.png' instead of the correct
      'guides/guide_nested_first_guide/one.png'.
      
      This patch fixes the issue by generating the image's path based on the full
      name of the guide, instead of using 'File.basename' to incorrectly crop the
      path.
      4bc20fcf
Loading