Conversation
0435544 to
27a8909
Compare
| opt.on( | ||
| "--server[=PORT]", | ||
| Integer, | ||
| "[Experimental] Run WEBrick server with generated documentation.", |
There was a problem hiding this comment.
I feel we can remove the [Experiment] flag, we're not shipping something we're not expecting will work or introduce any breaking changes.
There was a problem hiding this comment.
My interpretation of "experimental" is: the feature works but may not live up to expectation at the moment and has a slight chance to be removed if it's proven problematic.
In this case, I don't expect it to be removed later but it doesn't have the maturity to work like yard server or some static site generators' server mode.
lib/rdoc/rdoc.rb
Outdated
| end | ||
|
|
||
| # Change the output directory to tmp so it doesn't overwrite the current documentation | ||
| Dir.chdir "tmp" do |
There was a problem hiding this comment.
Discussed this in Slack. Let's look at utilizing mktmpdir instead of $CWD/test
This class is used as a server for the ri command, not as a rdoc server. So putting it under RDoc::RI will make its purpose clearer.
Co-authored-by: Colby Swandale <996377+colby-swandale@users.noreply.github.com>
| @generator.update_data_from_store | ||
|
|
||
| # Regenerate the documentation and asserts | ||
| @generator.generate(server_mode: true) |
There was a problem hiding this comment.
Through implementing this feature I learned a lot about how data are passed around, which sometimes simply duplicate in multiple classes. And I plan to do some refactor around them.
|
Hi @st0012 Please tell me: Will your work here allow one to consult the standard library's documentation locally using
edit Never mind 😅 I saw the requirement on |
| end | ||
|
|
||
| # Don't need to run stats for server mode | ||
| return if @options.server_port |
There was a problem hiding this comment.
Can we instead do this above?
if @options.server_port
start_server
return
end| trap 'INT' do server.shutdown end | ||
| trap 'TERM' do server.shutdown end |
There was a problem hiding this comment.
Nit
| trap 'INT' do server.shutdown end | |
| trap 'TERM' do server.shutdown end | |
| trap 'INT' { server.shutdown } | |
| trap 'TERM' { server.shutdown } |
| :darkfish => darkfish_dir, | ||
| :json_index => json_index_dir, |
There was a problem hiding this comment.
Nit
| :darkfish => darkfish_dir, | |
| :json_index => json_index_dir, | |
| darkfish: darkfish_dir, | |
| json_index: json_index_dir, |
|
|
||
| res.content_type = 'text/html' | ||
| res.status = 500 | ||
| res.body = <<-BODY |
There was a problem hiding this comment.
Would it be possible to move this to an ERB file?
|
Closing in favor or #1620 |
Currently,
rdocdoesn't support server mode, which makes both using it and developing it extremely inconvenient.(
ri --serveris 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 movedRDoc::ServlettoRDoc::RI::Servlet.)So in this PR, I want to introduce a very rough server support to RDoc:
rdoc --serverorrdoc -s4000but can be assigned with--port=PORTrdocorrake rdocrepeatedly