lsegal / yard

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

Cannot scroll output with `--one-file` #1428

Open jacob-carlborg opened 2 years ago

jacob-carlborg commented 2 years ago

When generating the documentation using the --one-file flag and opening the result in the browser, it's not possible to scroll the website.

Steps to reproduce

  1. Run the following commands:
    
    cat << EOF >> foo.rb
    # Foobar
    # * asd
    class Foo
    end
    EOF

cat << EOF >> README.md

Foobar

Installation

Add this line to your application's Gemfile:

gem 'foobar'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install foobar

Usage

TODO: Write usage instructions here

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and the created tag, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/foobar. EOF

yard doc --one-file --no-save -o . foo.rb



The readme is to get enough output to need to scroll.

2. Open the generated `index.html` in the browser

## Actual Output

I expect to be able to scroll the website to see all output. But it's not possible. As you can see on the screen recording below, when I zoom out, additional content is present. The same issue happens with both Safari and Chrome. This issue does not occur when the `--one-file` flag is not used.

https://user-images.githubusercontent.com/306980/150672328-44b1a5e1-946f-4a33-af43-e79c206b11d4.mov

## Expected Output

I expect to be able to scroll the website.

## Environment details:

- OS: macOS 12.0.1
- Ruby version (`ruby -v`): ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-darwin20]
- YARD version (`yard -v`): yard 0.9.27

[contrib]: https://github.com/lsegal/yard/blob/main/CONTRIBUTING.md