Basic server mode support
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 --serverorrdoc -s- It's marked as experimental for now as it's very slow (see below)
- The port defaults to
4000but 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
rdocorrake rdocrepeatedly- We can add smarter reparsing/regenerating support, but it will first take some refactoring as the current design doesn't account for those
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 👍🏾