Skip to content

New website style + docs sorting modifications #2924

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

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ Steps:
- If you are using the legacy `python setup.py docs` (which is now deprecated):
- (Run `python -m pip install -U pip setuptools` first if `ModuleNotFoundError: No module named setuptools` occurs)

You may want to test the new website style, you just have to edit
``docs/reST/conf.py`` and change the value of ``html_theme`` to ``sphinx_book_theme``.
(Make sure before to install the theme with ``python -m pip install sphinx_book_theme``)
Comment on lines +17 to +19
Copy link
Member

Choose a reason for hiding this comment

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

Isn't this PR supposed to implement the new style? I'm confused by what's intended here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hello, thank you for the review !

After a big talk on discord, a lot mentionned the idea of making a progressive transition between the old style and the new style. So right now the ideal would be to keep it experimental, and then we make a new PR that will make it default or no.


This will create a new folder under the `docs` folder.
In `docs/generated`, you will find a local copy of the pygame documentation.

Expand Down
1 change: 1 addition & 0 deletions docs/reST/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
# The theme to use for HTML and HTML Help pages. Major themes that come with
# Sphinx are currently 'default' and 'sphinxdoc'.
html_theme = 'classic'
# html_theme = 'sphinx_book_theme'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand Down
7 changes: 2 additions & 5 deletions docs/reST/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@ Pygame-ce Front Page
:glob:
:hidden:

ref/*
tutorials/en/*
tutorials/en/**/*
tutorials/ko/**/*
tutorials/es/*
modules
tutorials
c_api
filepaths
logos
Expand Down
98 changes: 98 additions & 0 deletions docs/reST/modules.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
Pygame modules
==============

*************************************************
List of pygame modules
*************************************************

.. toctree::
:maxdepth: 2
:glob:
:hidden:

ref/pygame.rst
ref/*

:doc:`ref/bufferproxy`
An array protocol view of surface pixels

:doc:`ref/color`
Color representation.

:doc:`ref/cursors`
Loading and compiling cursor images.

:doc:`ref/display`
Configure the display surface.

:doc:`ref/draw`
Drawing simple shapes like lines and ellipses to surfaces.

:doc:`ref/event`
Manage the incoming events from various input devices and the windowing platform.

:doc:`ref/examples`
Various programs demonstrating the use of individual pygame modules.

:doc:`ref/font`
Loading and rendering TrueType fonts.

:doc:`ref/freetype`
Enhanced pygame module for loading and rendering font faces.

:doc:`ref/gfxdraw`
Anti-aliasing draw functions.

:doc:`ref/image`
Loading, saving, and transferring of surfaces.

:doc:`ref/joystick`
Manage the joystick devices.

:doc:`ref/key`
Manage the keyboard device.

:doc:`ref/locals`
Pygame constants.

:doc:`ref/mixer`
Load and play sounds

:doc:`ref/mouse`
Manage the mouse device and display.

:doc:`ref/music`
Play streaming music tracks.

:doc:`ref/pygame`
Top level functions to manage pygame.

:doc:`ref/pixelarray`
Manipulate image pixel data.

:doc:`ref/rect`
Flexible container for a rectangle.

:doc:`ref/scrap`
Native clipboard access.

:doc:`ref/sndarray`
Manipulate sound sample data.

:doc:`ref/sprite`
Higher level objects to represent game images.
Copy link
Contributor

Choose a reason for hiding this comment

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

Game images? Why not game objects


:doc:`ref/surface`
Objects for images and the screen.

:doc:`ref/surfarray`
Manipulate image pixel data.

:doc:`ref/tests`
Test pygame.

:doc:`ref/time`
Manage timing and framerate.

:doc:`ref/transform`
Resize and move images.
11 changes: 9 additions & 2 deletions docs/reST/ref/color.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
:mod:`pygame.Color`
===================

.. toctree::
:maxdepth: 2
:glob:
:hidden:

extra_infos/color_list.rst
Copy link
Member

Choose a reason for hiding this comment

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

extra_infos doesn't sound right to me, maybe it should just be extra_info?


.. currentmodule:: pygame

.. class:: Color
Expand Down Expand Up @@ -53,7 +60,7 @@
It can be passed as a ``color_value`` argument to :class:`Color`
(useful with sets).

See :doc:`color_list` for samples of the available named colors.
See :doc:`extra_infos/color_list` for samples of the available named colors.

:param int r: red value in the range of 0 to 255 inclusive
:param int g: green value in the range of 0 to 255 inclusive
Expand All @@ -67,7 +74,7 @@
| - **Color object:** clones the given :class:`Color` object
| - **Color name: str:** name of the color to use, e.g. ``'red'``
(all the supported name strings can be found in the
:doc:`color_list`, with sample swatches)
:doc:`extra_infos/color_list`, with sample swatches)
| - **HTML color format str:** ``'#rrggbbaa'`` or ``'#rrggbb'``,
where rr, gg, bb, and aa are 2-digit hex numbers in the range
of 0 to 0xFF inclusive, the aa (alpha) value defaults to 0xFF
Expand Down
20 changes: 10 additions & 10 deletions docs/reST/ref/draw.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ object around the draw calls (see :func:`pygame.Surface.lock` and
:param Surface surface: surface to draw on
:param color: color to draw with, the alpha value is optional if using a
tuple ``(RGB[A])``
:type color: Color or string (for :doc:`color_list`) or int or tuple(int, int, int, [int])
:type color: Color or string (for :doc:`extra_infos/color_list`) or int or tuple(int, int, int, [int])
:param Rect rect: rectangle to draw, position and dimensions
:param int width: (optional) used for line thickness or to indicate that
the rectangle is to be filled (not to be confused with the width value
Expand Down Expand Up @@ -110,7 +110,7 @@ object around the draw calls (see :func:`pygame.Surface.lock` and
:param Surface surface: surface to draw on
:param color: color to draw with, the alpha value is optional if using a
tuple ``(RGB[A])``
:type color: Color or string (for :doc:`color_list`) or int or tuple(int, int, int, [int])
:type color: Color or string (for :doc:`extra_infos/color_list`) or int or tuple(int, int, int, [int])
:param points: a sequence of 3 or more (x, y) coordinates that make up the
vertices of the polygon, each *coordinate* in the sequence must be a
tuple/list/:class:`pygame.math.Vector2` of 2 ints/floats,
Expand Down Expand Up @@ -158,7 +158,7 @@ object around the draw calls (see :func:`pygame.Surface.lock` and
:param Surface surface: surface to draw on
:param color: color to draw with, the alpha value is optional if using a
tuple ``(RGB[A])``
:type color: Color or string (for :doc:`color_list`) or int or tuple(int, int, int, [int])
:type color: Color or string (for :doc:`extra_infos/color_list`) or int or tuple(int, int, int, [int])
:param center: center point of the circle as a sequence of 2 ints/floats,
e.g. ``(x, y)``
:type center: tuple(int or float, int or float) or
Expand Down Expand Up @@ -219,7 +219,7 @@ object around the draw calls (see :func:`pygame.Surface.lock` and
:param Surface surface: surface to draw on
:param color: color to draw with, the alpha value is optional if using a
tuple ``(RGB[A])``
:type color: Color or string (for :doc:`color_list`) or int or tuple(int, int, int, [int])
:type color: Color or string (for :doc:`extra_infos/color_list`) or int or tuple(int, int, int, [int])
:param center: center point of the circle as a sequence of 2 ints/floats,
e.g. ``(x, y)``
:type center: tuple(int or float, int or float) or
Expand Down Expand Up @@ -273,7 +273,7 @@ object around the draw calls (see :func:`pygame.Surface.lock` and
:param Surface surface: surface to draw on
:param color: color to draw with, the alpha value is optional if using a
tuple ``(RGB[A])``
:type color: Color or string (for :doc:`color_list`) or int or tuple(int, int, int, [int])
:type color: Color or string (for :doc:`extra_infos/color_list`) or int or tuple(int, int, int, [int])
:param Rect rect: rectangle to indicate the position and dimensions of the
ellipse, the ellipse will be centered inside the rectangle and bounded
by it
Expand Down Expand Up @@ -314,7 +314,7 @@ object around the draw calls (see :func:`pygame.Surface.lock` and
:param Surface surface: surface to draw on
:param color: color to draw with, the alpha value is optional if using a
tuple ``(RGB[A])``
:type color: Color or string (for :doc:`color_list`) or int or tuple(int, int, int, [int])
:type color: Color or string (for :doc:`extra_infos/color_list`) or int or tuple(int, int, int, [int])
:param Rect rect: rectangle to indicate the position and dimensions of the
ellipse which the arc will be based on, the ellipse will be centered
inside the rectangle
Expand Down Expand Up @@ -364,7 +364,7 @@ object around the draw calls (see :func:`pygame.Surface.lock` and
:param Surface surface: surface to draw on
:param color: color to draw with, the alpha value is optional if using a
tuple ``(RGB[A])``
:type color: Color or string (for :doc:`color_list`) or int or tuple(int, int, int, [int])
:type color: Color or string (for :doc:`extra_infos/color_list`) or int or tuple(int, int, int, [int])
:param start_pos: start position of the line, (x, y)
:type start_pos: tuple(int or float, int or float) or
list(int or float, int or float) or Vector2(int or float, int or float)
Expand Down Expand Up @@ -416,7 +416,7 @@ object around the draw calls (see :func:`pygame.Surface.lock` and
:param Surface surface: surface to draw on
:param color: color to draw with, the alpha value is optional if using a
tuple ``(RGB[A])``
:type color: Color or string (for :doc:`color_list`) or int or tuple(int, int, int, [int])
:type color: Color or string (for :doc:`extra_infos/color_list`) or int or tuple(int, int, int, [int])
:param bool closed: if ``True`` an additional line segment is drawn between
the first and last points in the ``points`` sequence
:param points: a sequence of 2 or more (x, y) coordinates, where each
Expand Down Expand Up @@ -536,7 +536,7 @@ object around the draw calls (see :func:`pygame.Surface.lock` and
:param Surface surface: surface to draw on
:param color: color to draw with, the alpha value is optional if using a
tuple ``(RGB[A])``
:type color: Color or string (for :doc:`color_list`) or int or tuple(int, int, int, [int])
:type color: Color or string (for :doc:`extra_infos/color_list`) or int or tuple(int, int, int, [int])
:param start_pos: start position of the line, (x, y)
:type start_pos: tuple(int or float, int or float) or
list(int or float, int or float) or Vector2(int or float, int or float)
Expand Down Expand Up @@ -569,7 +569,7 @@ object around the draw calls (see :func:`pygame.Surface.lock` and
:param Surface surface: surface to draw on
:param color: color to draw with, the alpha value is optional if using a
tuple ``(RGB[A])``
:type color: Color or string (for :doc:`color_list`) or int or tuple(int, int, int, [int])
:type color: Color or string (for :doc:`extra_infos/color_list`) or int or tuple(int, int, int, [int])
:param bool closed: if ``True`` an additional line segment is drawn between
the first and last points in the ``points`` sequence
:param points: a sequence of 2 or more (x, y) coordinates, where each
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. include:: common.txt
.. include:: ../../common.txt
Copy link
Member

Choose a reason for hiding this comment

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

I don't know that I like the relative pathing here. Is there no way around it?


Named Colors
============
Expand Down Expand Up @@ -673,7 +673,7 @@ Named Colors
.yellowgreen {background-color: #9acd32; color: #9acd32;}
</style>

:doc:`color` lets you specify any of these named colors when creating a new
:doc:`../color` lets you specify any of these named colors when creating a new
``pygame.Color`` (taken from the
`colordict module <https://github.com/pygame-community/pygame-ce/blob/main/src_py/colordict.py>`_).

Expand Down
Loading