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

Remove root parameter override in watch mode #925

Open tymokvo opened 6 days ago

tymokvo commented 6 days ago

Summary

Description

This adds the ability to serve the generated documentation site to browsers not running on localhost. For example, when working in a remote development environment like GitHub Codespaces or an ngrok endpoint.

nojaf commented 20 hours ago

Running src\fsdocs-tool\bin\Debug\net6.0\fsdocs.exe watch --contenturlroot http://localhost:5001 --port 6001 is not quite working for me. I think we should not allow both settings at the same time.

launching browser window to open http://localhost:6001/
[09:48:03 INF] Smooth! Suave listener started in 8.653ms with binding 127.0.0.1:6001

but leads to

image

This also makes me wonder if we should go for a breaking change and introduce a --root flag instead? This would capture both the existing port and new contenturlroot flag.

Thoughts @kMutagene @nhirschey?

tymokvo commented 9 hours ago

Yes, I noticed that those parameters could become out of sync. But isn't it possible that both --port and --contenturlroot may be desired?

E.g.

In this case, the static content should all replace root with http://dev-a.ngrok.io/ and the suave server should still bind on 6001, correct?