lsegal / yard

YARD is a Ruby Documentation tool. The Y stands for "Yay!"
http://yardoc.org
MIT License
1.92k stars 396 forks source link

Overview formatting lost #300

Closed mutle closed 13 years ago

mutle commented 13 years ago

Using yard 0.6.8, it seems that some of my Classes' documentation overviews don't get parsed at all, just dumped as plain-text, like this: https://skitch.com/mutle/r54x4/class-redpress-plugin

Here is the source file I am using: https://gist.github.com/36bfe9e2236d67821e29

As far as I can tell I'm not doing anything very different from this file: https://github.com/lsegal/yard/blob/master/lib/yard/config.rb

It used to work, but somewhere along the way it stopped, I'm not sure if it was due to a yard upgrade or some change I had made.

lsegal commented 13 years ago

Are you running this in a local yard server? Also are you sure this is 0.6.8? This regression was in 0.6.7 that should have been fixed with 0.6.8, see 6f8df6c3b4a3a6ba46406287a0efc3ceaaa899f3

mutle commented 13 years ago

Hi, thanks for the quick reply :)

Yes, this is with 0.6.8 and a local yard server:

➜ rm -R  .yardoc/ && be yard server -r
[info]: No .yardoc file found in current directory, parsing source before starting server...
Files:          65
Modules:        41 (   35 undocumented)
Classes:        60 (   56 undocumented)
Constants:       3 (    3 undocumented)
Methods:       385 (  305 undocumented)
 18.40% documented
>> YARD 0.6.8 documentation server at http://0.0.0.0:8808
[2011-04-24 18:56:28] INFO  WEBrick 1.3.1
[2011-04-24 18:56:28] INFO  ruby 1.8.7 (2009-06-12) [universal-darwin10.0]
[2011-04-24 18:56:29] INFO  WEBrick::HTTPServer#start: pid=29882 port=8808

➜ bundle show yard
/Library/Ruby/Gems/1.8/gems/yard-0.6.8

My Server was still using 0.6.7, and it looks like it is fixed there now that I upgraded, but still seeing it locally with 0.6.8.

burtlo commented 13 years ago

I've got a repro with YARD 0.6.8.

Running yardoc I was able to generate output that appears to be correct intended output. However, when I run it with yard server, that is where I see that it is not correctly defaulting to rdoc format for the specific file.

I'll continue my examination.

burtlo commented 13 years ago

Found the issue.

When running yard server a library command is executed to display the file and it generates the options based on the execution of yardoc -c -n --no-stats . The -n option tells yardoc not to generate documentation, which is all well in good, except that when it starts to finish parsing the arguments that being set to false will cause it to fail fast before it is able to setup a default markup through verify_markup_options.

I'll talk with @lsegal about the best course of action. In the meantime, you can patch the method with this little workaround.

burtlo commented 13 years ago

@mutle, thanks for reporting the issue. Talking with @lsegal, I addressed the issue and added tests.