Skip to content
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

Serving documentation with a simple server. #2676

Merged
merged 5 commits into from
Feb 4, 2024

Conversation

gresm
Copy link
Contributor

@gresm gresm commented Jan 17, 2024

As discussed in here running python -m pygame.docs in some circumstances may fail - when a default browser is a non-classic snap package and pygame-ce library is installed in a .hidden folder (dotted), as those folders snaps can't access. This pull request solves this issue by introducing another method of opening documentation - running a simple local server for this purpose (with python -m pygame.docs.serve) while not changing the original behavior.

@gresm gresm requested a review from a team as a code owner January 17, 2024 14:56
@gresm
Copy link
Contributor Author

gresm commented Jan 18, 2024

Wasn't really sure whether I should and stubs, as I was changing the part of code without it, but I guess that it isn't that bad idea.

Copy link
Member

@ankith26 ankith26 left a comment

Choose a reason for hiding this comment

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

I'm now thinking we could just make it so that py -m pygame.docs creates a local server and opens it in the browser by default. This change shouldn't be too disruptive right?

@gresm
Copy link
Contributor Author

gresm commented Jan 19, 2024

It shouldn't, but I didn't want to change the default behavior.

@ankith26
Copy link
Member

I'm fine with changing behaviour for this specific case, but let's wait for what others would say and then accordingly move this PR forward

@Starbuck5
Copy link
Member

Starbuck5 commented Jan 28, 2024

What about changing the default behavior on Linux only?

That way we can test it out as the default without risking it breaking for as many people.

@Starbuck5 Starbuck5 added the docs label Jan 28, 2024
@gresm
Copy link
Contributor Author

gresm commented Jan 29, 2024

@Starbuck5 It probably will be confusing for some people, but I can re-implement this in the way that one can use python -m pygame.docs.serve to explicitly run server, python -m pygame.docs.static to explicitly use default behavior and python -m pygame.docs to let the program decide itself.

@gresm gresm requested a review from ankith26 January 29, 2024 11:22
Copy link
Member

@ankith26 ankith26 left a comment

Choose a reason for hiding this comment

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

Left a review, but apart from that this PR LGTM.

Thanks for the PR 🥳

docs/serve.py Outdated Show resolved Hide resolved
@gresm
Copy link
Contributor Author

gresm commented Feb 3, 2024

Can someone rerun the test?

@oddbookworm
Copy link
Member

Can someone rerun the test?

Running now

Copy link
Member

@MyreMylar MyreMylar left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@MyreMylar MyreMylar merged commit c51a39f into pygame-community:main Feb 4, 2024
29 checks passed
@itzpr3d4t0r itzpr3d4t0r added this to the 2.5.0 milestone Feb 4, 2024
Starbuck5 pushed a commit that referenced this pull request Feb 18, 2024
Serving documentation with a simple server.
@Starbuck5 Starbuck5 modified the milestones: 2.5.0, 2.4.1 Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants