{include:file:} not working

Seems like {include:file:somedir/somefile.rb} is not working ? (somedir being in the git repository root)

  1. You can only include "extra files" (see the documentation for this feature), namely files that are marked in your .yardopts as text documents. Rubydoc.info deletes all source files after parsing to save disk space, so while include might work locally, it won't work on the site.

    Hope that helps!

  2. After adding the Ruby files in .yardopts they show up in YARD's file list, but still are not embedded.

    I guess I have to serve the docs from GitHub somehow.
    Thanks!

  3. The feature should be working correctly on rubydoc.info. Have you tested this locally in YARD to verify that you've configured everything correctly?

  4. Yeah, it's working locally. I've now added the folder that contains the Ruby files into .yardopts. If I run yardoc locally, it complains:
      [warn]: Could not find extra file: docs/examples
    Ruby files are not listed under "Files", neither do includes work.
    What struck me as odd, however, is that now links to the image files in docs/examples work (so even though giving a warning, the line has an effect), and what's more, I can access the Ruby files (rendered as HTML) if I append examples/file.rb to the URL, so the files somehow are there, but {include:file:} refuses to include them.

  5. Do you have a code example and/or a rubydoc URL so I can get a sense of what you are seeing?

  6. http://www.rubydoc.info/github/evoasm/evoasm/master/file/docs/Visualization.md
    The images are there.
    This file contains {include:file:docs/examples/vis.rb} but it's not included.
    The file is accessible as http://www.rubydoc.info/github/evoasm/evoasm/master/file/docs/examples/vis.rb, though.

  7. I think I see the problem.

    Paths cannot be listed as directories in the extra files portion of the yard doc command, you have to use globs if you want to specify multiple files. Using docs/examples/**/* should work.

    Hope that helps!

  8. Ok, I'll try that. Thanks!

  9. Just to let you know, if I add a glob:
      * the Ruby files appear as stand-alone extra files in the file list (which I don't want)
      * {include:file:} still does not work
      * YARD tries to parse everything it finds, including binary image files

Reply to this discussion Internal reply only staff will see it

Markdown

Attaching KB article:

» »

Read more…

Attach files

Up to 10MB each.

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac