fsprojects / FSharp.Formatting

F# tools for generating documentation (Markdown processor and F# code formatter)
https://fsprojects.github.io/FSharp.Formatting/
Other
462 stars 155 forks source link

Enable `watch` server from arbitrary host #924

Open tymokvo opened 6 days ago

tymokvo commented 6 days ago

While working on a project with a new developer in a GitHub Codespace today, I wanted to be able to serve the documentation of our feature branch. However, I ran into a limitation of the watch command where dotnet tool run fsdocs watch is incompatible with a remote host because the relative links in the generated HTML are all rooted at http://localhost:8901.

Would it be possible to configure watch to:

I think something as simple as dotnet tool run fsdocs watch --remote would be very convenient. Though, maybe there is already a way to accomplish this with a combination of existing flags?

nojaf commented 6 days ago

Ah yes, this rings a bell. Maybe adding --parameters root "" will allow for an empty root and makes things relative but I haven't tested this.

tymokvo commented 6 days ago

Hm, that's a start. But it seems that flag works for build but not for watch. All of the static files generated in tmp/watch are still using absolute URLs to localhost:8901.

tymokvo commented 6 days ago

I think I figured out a patch in #925 . But I'm a little suspicious since there was a whole branch dedicated to preventing a user override of root in watch mode.