Skip to content

Allow running --open with --all #660

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

Merged
merged 1 commit into from
Mar 4, 2019
Merged

Conversation

nik9000
Copy link
Member

@nik9000 nik9000 commented Mar 1, 2019

This allows you to --open the docs built with --all. This should be
useful when testing changes that effect all docs, like the redirect work
that I plan on doing soon.

There is a wrinkle though: to make serving the docs locally work we
actually built different docs. We'd switch from finding jQuery at
/static/js/jquery.min.js to getting it from
https://www.elastic.co/static/js/jquery.min.js. This worked, and it
was simple enough to do for the built in python web server that we use
when you run --open outside of docker, but we don't want to do that
when we serve all of the docs because most of the docs will have been
built with the standard template.

But now that we have docker we don't have to! In docker we're using
nginx to serve the docs and we can write a few rewrite rules to fix the
missing assets. For good measure we assets rewrite when we're running in
docker even when we're building a single doc. So now building a single
doc is just that much more real!

This allows you to `--open` the docs built with `--all`. This should be
useful when testing changes that effect all docs, like the redirect work
that I plan on doing soon.

There is a wrinkle though: to make serving the docs locally work we
actually built *different* docs. We'd switch from finding jQuery at
`/static/js/jquery.min.js` to getting it from
`https://www.elastic.co/static/js/jquery.min.js`. This worked, and it
was simple enough to do for the built in python web server that we use
when you run `--open` outside of docker, but we don't want to do that
when we serve all of the docs because most of the docs will have been
built with the standard template.

But now that we have docker we don't have to! In docker we're using
nginx to serve the docs and we can write a few rewrite rules to fix the
missing assets. For good measure we assets rewrite when we're running in
docker even when we're building a single doc. So now building a single
doc is just that much more real!
@nik9000 nik9000 requested review from a user and ddillinger March 1, 2019 23:30
@@ -733,6 +670,82 @@ sub pick_conf {
die $Opts->{conf} . " doesn't exist";
}

#===================================
sub serve_and_open_browser {
#===================================
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love you too, decomposition.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

decomposition

Much ❤️ for decomposition.

@nik9000 nik9000 merged commit 011cf93 into elastic:master Mar 4, 2019
@nik9000
Copy link
Member Author

nik9000 commented Mar 4, 2019

Thanks for reviewing @Jarpy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant