{include:file:} not working

's Avatar


30 Nov, 2016 07:26 PM

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

  1. Support Staff 1 Posted by lsegal on 30 Nov, 2016 07:57 PM

    lsegal's Avatar

    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. 2 Posted by furunkel on 01 Dec, 2016 06:43 AM

    furunkel's Avatar

    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.

  3. Support Staff 3 Posted by lsegal on 01 Dec, 2016 07:47 AM

    lsegal's Avatar

    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. 4 Posted by furunkel on 01 Dec, 2016 07:55 AM

    furunkel's Avatar

    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. Support Staff 5 Posted by lsegal on 01 Dec, 2016 07:59 AM

    lsegal's Avatar

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

  6. 6 Posted by furunkel on 01 Dec, 2016 08:05 AM

    furunkel's Avatar

    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. Support Staff 7 Posted by lsegal on 01 Dec, 2016 08:15 AM

    lsegal's Avatar

    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. 8 Posted by furunkel on 01 Dec, 2016 08:19 AM

    furunkel's Avatar

    Ok, I'll try that. Thanks!

  9. 9 Posted by furunkel on 01 Dec, 2016 11:19 AM

    furunkel's Avatar

    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

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

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


? 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