rails / sdoc

Standalone sdoc generator
http://api.rubyonrails.org/
Other
820 stars 132 forks source link

Error while evaluating sdoc/index.rhtml: undefined method `include?' for nil:NilClass #145

Closed mckeed closed 1 week ago

mckeed commented 3 years ago

I'm getting an error when I try to use sdoc 2.0.2 on the rspec-core gem that I don't get with sdoc 1.1.0.

I've reproduced with ruby 2.6.6 and 2.7.0

I get the following when running just $ sdoc in the gem directory for rspec-core 3.6.0

Generating SDoc format into ~/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rspec-mocks-3.6.0/doc...
uh-oh! RDoc had a problem:
Error while evaluating ~/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/sdoc-2.0.2/lib/rdoc/generator/template/sdoc/index.rhtml: undefined method `include?' for nil:NilClass (at "l\" title=\"Search\" name=\"panel\" />\n    <frame src=\"")
p8 commented 3 years ago

The sdoc template needs to be updated to use the new frameless turbolinks version. I started working on this but haven't finished it yet.

manuelmeurer commented 3 years ago

I'm getting the same error with sdoc 2.0.3. Anything I can do to help fix this, @p8?

manuelmeurer commented 3 years ago

@zzak Do you know what the status is with this issue? Currently sdoc seems to be unusable. I'd love to help out to get this resolved if someone could point me in the right direction!

The docs on https://api.rubyonrails.org/ seem to use Turbolinks, are they generated with sdoc v2?

p8 commented 3 years ago

@manuelmeurer The Rails API docs use the v2 version. You should be able to run the v1 version which doesn't use Turbolinks. I started working on fixing the sdoc template, but haven't found time to finish it: https://github.com/p8/sdoc/tree/update-sdoc-template

manuelmeurer commented 3 years ago

I get the same undefined method 'include?' for nil:NilClass error when trying to generate the docs for Rails, so I'm wondering how the Rails API docs have been generated?

Please let me know if I can help with updating the sdoc template!

zacheryph commented 2 years ago

The simple solution to this problem is adding -m README.md (or some other main file) to the arguments when calling sdoc.

p8 commented 2 years ago

I've just merged: https://github.com/zzak/sdoc/pull/189 Which should probably fix this issue.

zzak commented 1 week ago

I believe this was fixed by #189, please re-open if that is not the case. :bow: