-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Start web server after building the documentation #2574
Start web server after building the documentation #2574
Conversation
3bf1ade
to
30901b6
Compare
I don't really like adding it as a dependency. The command line might look like this:
I don't know if we want to try to integrate the |
Codecov Report
@@ Coverage Diff @@
## master #2574 +/- ##
=======================================
Coverage 73.20% 73.20%
=======================================
Files 446 446
Lines 63676 63678 +2
=======================================
+ Hits 46615 46618 +3
+ Misses 17061 17060 -1
|
30901b6
to
4e9c25c
Compare
Here is a version that starts
|
|
Small update on my comments above: one can in fact redirect only |
I am still in favor of doing this, but I would love some other opinions on whether we should add this. Maybe we should put |
There was a short discussion on this in the Wednesday's meeting in Kaiserslautern:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't tested this, but it looks great, thanks!
As far as I know, @aaruni96 wanted to work on an alternative solution... For the record, the following approaches have been mentioned/tried out:
(Un)fortunately, I'm on holidays the next two weeks, so if I am further involved in this it has to wait until after that. |
I apologize, I was refreshing some julia multiprocessing while thinking about this PR and forgot to update here. The solution I propose such: We can spawn a julia worker process ( This would require adding The solution should work on single core CPUs as well (the OS can schedule multiple jobs), but its something I am not fully sure about. |
@aaruni96 I think adding a dependency on the stdlib |
@aaruni96 look into an alternative implementation, but it turns out that the approach here also allows some control over the subprocess running the webserver (should we want to), which we were unaware of before. So the main reason for an alternate approach really does not hold. So I would just merge this PR -- we can still improve it later, if we want to (as with any feature). @joschmitt you marked it as draft again -- I assume because of our discussion, but I want to double check just in case you had other reasons? |
Pkg.add(\"LiveServer\"); using LiveServer; | ||
LiveServer.serve(dir = \"$build_dir\", launch_browser = $open_browser, port = $port);" | ||
live_server_process = run(`julia -e $cmd`, wait = false) | ||
atexit(_ -> kill(live_server_process)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you verify this works? Because when I just tried this by copy&pasting this code, kill
was just ignored. I suspect this was because I am using juliaup
, which actually forks julia
into a subprocess...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay... I'm very sure it worked for me at some point. I will try again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So yes, for me it works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you try again? Maybe it is fixed by 7af4c60 as @benlorenz suggested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried it now with juliaup
and it works (with 7af4c60). Without that commit it doesn't, so I assume that this is fixed.
Yes, I wanted to avoid that somebody merges this "accidentally". Let me add your suggestions and then I will mark it as ready for review. |
8651691
to
c09de4c
Compare
Co-authored-by: Benjamin Lorenz <benlorenz@users.noreply.github.com>
As discussed in Slack, the
open_browser
option ofbuild_doc
does not work (at least) on Ubuntu's sandboxed snap-firefox. I added a comment regarding this to the documentation (first commit).@benlorenz suggested to start a web server using
LiveServer.jl
in the build directory, so I also tried this.I'm not really familiar with the setup for building the documentation and eventually addedLiveServer
as a dependency at every place I could find because this seemed to be the only way to make it work. Is there a better way and do we want to have this dependency at all?As of now this will of course simply start the server, but not update anything, when the user edits the documentation (like the
LiveServer.servedocs
function claims to do).