{include:file:} not working
Seems like {include:file:somedir/somefile.rb} is not working ? (somedir being in the git repository root)
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
Support Staff 1 Posted by lsegal on 30 Nov, 2016 07:57 PM
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 Posted by furunkel on 01 Dec, 2016 06:43 AM
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!
Support Staff 3 Posted by lsegal on 01 Dec, 2016 07:47 AM
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 Posted by furunkel on 01 Dec, 2016 07:55 AM
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.
Support Staff 5 Posted by lsegal on 01 Dec, 2016 07:59 AM
Do you have a code example and/or a rubydoc URL so I can get a sense of what you are seeing?
6 Posted by furunkel on 01 Dec, 2016 08:05 AM
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.
Support Staff 7 Posted by lsegal on 01 Dec, 2016 08:15 AM
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 Posted by furunkel on 01 Dec, 2016 08:19 AM
Ok, I'll try that. Thanks!
9 Posted by furunkel on 01 Dec, 2016 11:19 AM
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