-
Notifications
You must be signed in to change notification settings - Fork 884
Add open browser options to docfx-serve command #8934
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
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #8934 +/- ##
==========================================
- Coverage 77.05% 76.90% -0.15%
==========================================
Files 605 605
Lines 25042 25091 +49
==========================================
+ Hits 19295 19297 +2
- Misses 5747 5794 +47
☔ View full report in Codecov by Sentry. |
|
Is it simpler to have an Opens the launch URL: |
In latest commit. And I founds a bug that using |
yufeih
left a comment
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.
Looks great now! Thank you @filzrev !
This PR implement feature described #8927.
What's is added to docfx CLI command
Following options are added for
docfx buildanddocfx servecommands.Usage
To launch browser. pass
--open-browserswitch option to command.It launch browser with root site URL (e.g. http:localhost:8080).
When
--open-browser-relative-pathoptional parameter is passed.It try to resolve output HTML file by using
manifest.jsonfile content.If failed to resolve HTML path. then error log is recorded. and fallback to site root URL.
docfx build --serveLaunch with specific page.
Unit Tests
This PR don't contains unit tests.
Because it's difficult to write unit tests that relating OS commands and launch browser.
Tests are executed manually that cover all execution paths.
Excepting
macOSenvironment browser launch test.This PR use same OS command(
open) that is used bydotnet-serveto open browser.I thought, there is no problems on
macOSenvironment.Documentation
This PR don't contains documentation updates.
Currently there are few references about
docfx serveanddocfx build --servecommand in the documentation.It might be better to update following related docs later.
Additional Design Notes
Composing Commands
This PR add options as simple options.
Spectre.Console.Clisupports Composing Commands.It might be better to change
--serverelated options asComposing Commands.Redundant argument names
--open-browser-relative-pathis a bit redundant option name.--open-browser:[url]style option is preferred that is implemented by thedotnet servecommand.But It seems
Spectre.Console.Clican't handle this option styles.