rdoc icon indicating copy to clipboard operation
rdoc copied to clipboard

Basic server mode support

Open st0012 opened this issue 1 year ago • 1 comments

Currently, rdoc doesn't support server mode, which makes both using it and developing it extremely inconvenient.

(ri --server is RI's web interface, which lets users read indexed RI documents in the browser. It does NOT run current project's RDoc documentation in server mode. To avoid confusion, I moved RDoc::Servlet to RDoc::RI::Servlet.)

So in this PR, I want to introduce a very rough server support to RDoc:

  • Can be used with rdoc --server or rdoc -s
    • It's marked as experimental for now as it's very slow (see below)
    • The port defaults to 4000 but can be assigned with --port=PORT
  • Will use a tmpdir to temporarily host the generated files so they don't override the original doc folder
  • It reparses and regenerates files on EVERY SINGLE REQUEST, which is pretty slow, but still faster than running rdoc or rake rdoc repeatedly
    • We can add smarter reparsing/regenerating support, but it will first take some refactoring as the current design doesn't account for those

st0012 avatar Aug 05 '24 22:08 st0012

Hi @st0012

Please tell me: Will your work here allow one to consult the standard library's documentation locally using rdoc?

ri's server mode seems to require the installation of webrick. Will rdoc --server have the same dependency?


edit

Never mind 😅 I saw the requirement on webrick in the Gemfile. And ri's server mode already allows consulting the Ruby docs locally 👍🏾

faustind avatar May 17 '25 07:05 faustind