Skip to content

Commit ffc087c

Browse files
authored
Merge pull request #2133 from Temmie3754/doc-fixes
Update docs to use pygame-ce versioning
2 parents eea4e3c + 5143c01 commit ffc087c

35 files changed

+274
-260
lines changed

docs/reST/c_api/version.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Header file: src_c/include/pygame.h
1313

1414
Version information can be retrieved at compile-time using these macros.
1515

16-
.. versionadded:: 1.9.5
16+
.. versionaddedold:: 1.9.5
1717

1818
.. c:macro:: PG_MAJOR_VERSION
1919

docs/reST/conf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@
5252
release = '2.3.0.dev1'
5353

5454
# Format strings for the version directives
55-
versionadded_format = 'New in pygame %s'
56-
versionchanged_format = 'Changed in pygame %s'
57-
deprecated_format = 'Deprecated since pygame %s'
55+
versionadded_format = 'New in pygame-ce %s'
56+
versionchanged_format = 'Changed in pygame-ce %s'
57+
deprecated_format = 'Deprecated since pygame-ce %s'
5858

5959
# The language for content autogenerated by Sphinx. Refer to documentation
6060
# for a list of supported languages.

docs/reST/ext/customversion.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
UPDATE_VERIONLABEL_CLASSES = True
1111

1212

13-
labels = ("versionadded", "versionchanged", "deprecated", "versionextended")
13+
labels = ("versionadded", "versionaddedold", "versionchanged", "versionchangedold", "deprecated", "deprecatedold", "versionextended", "versionextendedold")
1414

1515

1616
def set_version_formats(app, config):
@@ -20,12 +20,26 @@ def set_version_formats(app, config):
2020

2121
def setup(app):
2222
app.add_directive("versionextended", VersionChange)
23-
versionlabels["versionextended"] = "Extended in pygame %s"
23+
app.add_directive("versionaddedold", VersionChange)
24+
app.add_directive("versionchangedold", VersionChange)
25+
app.add_directive("deprecatedold", VersionChange)
26+
app.add_directive("versionextendedold", VersionChange)
27+
28+
versionlabels["versionextended"] = "Extended in pygame-ce %s"
29+
versionlabels["versionaddedold"] = "New in pygame %s"
30+
versionlabels["versionchangedold"] = "Changed in pygame %s"
31+
versionlabels["deprecatedold"] = "Deprecated since pygame %s"
32+
versionlabels["versionextendedold"] = "Extended in pygame %s"
33+
2434

2535
if UPDATE_VERIONLABEL_CLASSES:
2636
versionlabel_classes["versionextended"] = "extended"
37+
versionlabel_classes["versionaddedold"] = "added"
38+
versionlabel_classes["versionchangedold"] = "changed"
39+
versionlabel_classes["deprecatedold"] = "deprecated"
40+
versionlabel_classes["versionextendedold"] = "extended"
2741

28-
for label in ("versionadded", "versionchanged", "deprecated", "versionextended"):
42+
for label in labels:
2943
app.add_config_value(
3044
f"{label}_format", str(versionlabels[label]), "env"
3145
)

docs/reST/ref/bufferproxy.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@
6969
The BufferProxy class supports subclassing, instance variables, and weak
7070
references.
7171

72-
.. versionadded:: 1.8.0
73-
.. versionextended:: 1.9.2
72+
.. versionaddedold:: 1.8.0
73+
.. versionextendedold:: 1.9.2
7474

7575
.. attribute:: parent
7676

docs/reST/ref/camera.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
Pygame currently supports Linux (V4L2) and Windows (MSMF) cameras natively,
1212
with wider platform support available via an integrated OpenCV backend.
1313

14-
.. versionadded:: 2.0.2 Windows native camera support
15-
.. versionadded:: 2.0.3 New OpenCV backends
14+
.. versionaddedold:: 2.0.2 Windows native camera support
15+
.. versionaddedold:: 2.0.3 New OpenCV backends
1616

1717
EXPERIMENTAL!: This API may change or disappear in later pygame releases. If
1818
you use this, your code will very likely break with the next pygame release.
@@ -43,7 +43,7 @@ The Bayer to ``RGB`` function is based on:
4343
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
4444
SUCH DAMAGE.
4545

46-
New in pygame 1.9.0.
46+
.. versionaddedold:: 1.9.0
4747

4848
.. function:: init
4949

@@ -57,7 +57,7 @@ New in pygame 1.9.0.
5757
want into this function. More about backends in
5858
:func:`get_backends()`.
5959

60-
.. versionchanged:: 2.0.3 Option to explicitly select backend
60+
.. versionchangedold:: 2.0.3 Option to explicitly select backend
6161

6262
.. ## pygame.camera.init ##
6363
@@ -94,7 +94,7 @@ New in pygame 1.9.0.
9494
system, these backend ports will pass through a "camera index number"
9595
through if you use that as the ``device`` parameter.
9696

97-
.. versionadded:: 2.0.3
97+
.. versionaddedold:: 2.0.3
9898

9999
.. ## pygame.camera.get_backends ##
100100

docs/reST/ref/color.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,12 @@
9292
:returns: a newly created :class:`Color` object
9393
:rtype: Color
9494

95-
.. versionchanged:: 2.0.0
95+
.. versionchangedold:: 2.0.0
9696
Support for tuples, lists, and :class:`Color` objects when creating
9797
:class:`Color` objects.
98-
.. versionchanged:: 1.9.2 Color objects export the C level array interface.
99-
.. versionchanged:: 1.9.0 Color objects support 4-element tuples of integers.
100-
.. versionchanged:: 1.8.1 New implementation of the class.
98+
.. versionchangedold:: 1.9.2 Color objects export the C level array interface.
99+
.. versionchangedold:: 1.9.0 Color objects support 4-element tuples of integers.
100+
.. versionchangedold:: 1.8.1 New implementation of the class.
101101

102102
.. attribute:: r
103103

@@ -229,7 +229,7 @@
229229
get the length of a Color do ``len(acolor)``.
230230

231231
.. deprecated:: 2.1.3
232-
.. versionadded:: 1.9.0
232+
.. versionaddedold:: 1.9.0
233233

234234
.. ## Color.set_length ##
235235
@@ -256,7 +256,7 @@
256256
It must be a value between 0 and 1 where 0 means self and 1 means
257257
other will be returned.
258258

259-
.. versionadded:: 2.0.1
259+
.. versionaddedold:: 2.0.1
260260

261261
.. ## Color.lerp ##
262262
@@ -273,7 +273,7 @@
273273
flag for :meth:`pygame.Surface.blit()`, which assumes that all surfaces using
274274
it are using pre-multiplied alpha colors.
275275

276-
.. versionadded:: 2.0.0
276+
.. versionaddedold:: 2.0.0
277277

278278
.. ## Color.premul_alpha ##
279279
@@ -287,7 +287,7 @@
287287
Sets the elements of the color. See parameters for :meth:`pygame.Color` for the
288288
parameters of this function. If the alpha value was not set it will not change.
289289

290-
.. versionadded:: 2.0.1
290+
.. versionaddedold:: 2.0.1
291291

292292
.. ## Color.update ##
293293
.. ## pygame.Color ##

docs/reST/ref/cursors.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ The following strings can be converted into cursor bitmaps with
240240

241241
.. ## pygame.cursors.Cursor.data ##
242242
243-
.. versionadded:: 2.0.1
243+
.. versionaddedold:: 2.0.1
244244

245245
.. ## pygame.cursors.Cursor ##
246246

docs/reST/ref/display.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ required).
201201
window_surface = pygame.display.set_mode((1920, 1080), flags)
202202
vsync_success=False
203203

204-
.. versionadded:: 2.0.0 ``vsync`` parameter
204+
.. versionaddedold:: 2.0.0 ``vsync`` parameter
205205

206206
.. versionchanged:: 2.2.0 passing ``vsync`` can raise an exception
207207

@@ -224,7 +224,7 @@ required).
224224
environment variable.
225225

226226

227-
.. versionchanged:: 1.9.5 ``display`` argument added
227+
.. versionchangedold:: 1.9.5 ``display`` argument added
228228

229229
.. versionchanged:: 2.1.3
230230
pygame now ensures that subsequent calls to this function clears the
@@ -342,7 +342,7 @@ required).
342342
an empty dictionary will be returned. Most platforms will return a "window"
343343
key with the value set to the system id for the current display.
344344

345-
.. versionadded:: 1.7.1
345+
.. versionaddedold:: 1.7.1
346346

347347
.. ## pygame.display.get_wm_info ##
348348
@@ -364,7 +364,7 @@ required).
364364
mode, this function *should* be used to replace many use cases of
365365
``pygame.display.list_modes()`` whenever applicable.
366366

367-
.. versionadded:: 2.0.0
367+
.. versionaddedold:: 2.0.0
368368

369369
.. function:: list_modes
370370

@@ -398,7 +398,7 @@ required).
398398
physical monitor resolution unless the user explicitly requests a different
399399
one (e.g. in an options menu or configuration file).
400400

401-
.. versionchanged:: 1.9.5 ``display`` argument added
401+
.. versionchangedold:: 1.9.5 ``display`` argument added
402402

403403
.. ## pygame.display.list_modes ##
404404
@@ -420,7 +420,7 @@ required).
420420

421421
The display index ``0`` means the default display is used.
422422

423-
.. versionchanged:: 1.9.5 ``display`` argument added
423+
.. versionchangedold:: 1.9.5 ``display`` argument added
424424

425425
.. ## pygame.display.mode_ok ##
426426
@@ -484,7 +484,7 @@ required).
484484

485485
Minimum bit size of the frame buffer. Defaults to 0.
486486

487-
.. versionadded:: 2.0.0 Additional attributes:
487+
.. versionaddedold:: 2.0.0 Additional attributes:
488488

489489
::
490490

@@ -683,7 +683,7 @@ required).
683683
Returns the number of available displays. This is always 1 if
684684
:func:`pygame.get_sdl_version()` returns a major version number below 2.
685685

686-
.. versionadded:: 1.9.5
686+
.. versionaddedold:: 1.9.5
687687

688688
.. ## pygame.display.get_num_displays ##
689689
@@ -695,7 +695,7 @@ required).
695695
Returns the size of the window initialized with :func:`pygame.display.set_mode()`.
696696
This may differ from the size of the display surface if ``SCALED`` is used.
697697

698-
.. versionadded:: 2.0.0
698+
.. versionaddedold:: 2.0.0
699699

700700
.. ## pygame.display.get_window_size ##
701701
@@ -713,7 +713,7 @@ required).
713713
:func:`pygame.display.set_allow_screensaver()` for
714714
caveats with screensaver support.
715715

716-
.. versionadded:: 2.0.0
716+
.. versionaddedold:: 2.0.0
717717

718718
.. ## pygame.display.get_allow_screensaver ##
719719
@@ -742,7 +742,7 @@ required).
742742
``SDL_HINT_VIDEO_ALLOW_SCREENSAVER`` is available in SDL 2.0.2 or later.
743743
SDL1.2 does not implement this.
744744

745-
.. versionadded:: 2.0.0
745+
.. versionaddedold:: 2.0.0
746746

747747
.. function:: is_vsync
748748

docs/reST/ref/draw.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ object around the draw calls (see :func:`pygame.Surface.lock` and
6464
| if ``width < 0``, nothing will be drawn
6565
|
6666
67-
.. versionchanged:: 2.1.1
67+
.. versionchangedold:: 2.1.1
6868
Drawing rects with width now draws the width correctly inside the
6969
rect's area, rather than using an internal call to draw.lines(),
7070
which had half the width spill outside the rect area.
@@ -95,8 +95,8 @@ object around the draw calls (see :func:`pygame.Surface.lock` and
9595
The :func:`pygame.Surface.fill()` method works just as well for drawing
9696
filled rectangles and can be hardware accelerated on some platforms.
9797

98-
.. versionchanged:: 2.0.0 Added support for keyword arguments.
99-
.. versionchanged:: 2.0.0.dev8 Added support for border radius.
98+
.. versionchangedold:: 2.0.0 Added support for keyword arguments.
99+
.. versionchangedold:: 2.0.0.dev8 Added support for border radius.
100100

101101
.. ## pygame.draw.rect ##
102102
@@ -144,7 +144,7 @@ object around the draw calls (see :func:`pygame.Surface.lock` and
144144
.. note::
145145
For an aapolygon, use :func:`aalines()` with ``closed=True``.
146146

147-
.. versionchanged:: 2.0.0 Added support for keyword arguments.
147+
.. versionchangedold:: 2.0.0 Added support for keyword arguments.
148148

149149
.. ## pygame.draw.polygon ##
150150
@@ -198,12 +198,12 @@ object around the draw calls (see :func:`pygame.Surface.lock` and
198198
:raises TypeError: if ``center`` is not a sequence of two numbers
199199
:raises TypeError: if ``radius`` is not a number
200200

201-
.. versionchanged:: 2.0.0 Added support for keyword arguments.
201+
.. versionchangedold:: 2.0.0 Added support for keyword arguments.
202202
Nothing is drawn when the radius is 0 (a pixel at the ``center`` coordinates
203203
used to be drawn when the radius equaled 0).
204204
Floats, and Vector2 are accepted for the ``center`` param.
205205
The drawing algorithm was improved to look more like a circle.
206-
.. versionchanged:: 2.0.0.dev8 Added support for drawing circle quadrants.
206+
.. versionchangedold:: 2.0.0.dev8 Added support for drawing circle quadrants.
207207

208208
.. ## pygame.draw.circle ##
209209
@@ -240,7 +240,7 @@ object around the draw calls (see :func:`pygame.Surface.lock` and
240240
parameter and its width and height will be 0
241241
:rtype: Rect
242242

243-
.. versionchanged:: 2.0.0 Added support for keyword arguments.
243+
.. versionchangedold:: 2.0.0 Added support for keyword arguments.
244244

245245
.. ## pygame.draw.ellipse ##
246246
@@ -293,7 +293,7 @@ object around the draw calls (see :func:`pygame.Surface.lock` and
293293
parameter and its width and height will be 0
294294
:rtype: Rect
295295

296-
.. versionchanged:: 2.0.0 Added support for keyword arguments.
296+
.. versionchangedold:: 2.0.0 Added support for keyword arguments.
297297

298298
.. ## pygame.draw.arc ##
299299
@@ -344,7 +344,7 @@ object around the draw calls (see :func:`pygame.Surface.lock` and
344344
:raises TypeError: if ``start_pos`` or ``end_pos`` is not a sequence of
345345
two numbers
346346

347-
.. versionchanged:: 2.0.0 Added support for keyword arguments.
347+
.. versionchangedold:: 2.0.0 Added support for keyword arguments.
348348

349349
.. ## pygame.draw.line ##
350350
@@ -393,7 +393,7 @@ object around the draw calls (see :func:`pygame.Surface.lock` and
393393
:raises TypeError: if ``points`` is not a sequence or ``points`` does not
394394
contain number pairs
395395

396-
.. versionchanged:: 2.0.0 Added support for keyword arguments.
396+
.. versionchangedold:: 2.0.0 Added support for keyword arguments.
397397

398398
.. ## pygame.draw.lines ##
399399
@@ -500,7 +500,7 @@ object around the draw calls (see :func:`pygame.Surface.lock` and
500500
:raises TypeError: if ``start_pos`` or ``end_pos`` is not a sequence of
501501
two numbers
502502

503-
.. versionchanged:: 2.0.0 Added support for keyword arguments.
503+
.. versionchangedold:: 2.0.0 Added support for keyword arguments.
504504

505505
.. ## pygame.draw.aaline ##
506506
@@ -542,7 +542,7 @@ object around the draw calls (see :func:`pygame.Surface.lock` and
542542
:raises TypeError: if ``points`` is not a sequence or ``points`` does not
543543
contain number pairs
544544

545-
.. versionchanged:: 2.0.0 Added support for keyword arguments.
545+
.. versionchangedold:: 2.0.0 Added support for keyword arguments.
546546

547547
.. ## pygame.draw.aalines ##
548548

0 commit comments

Comments
 (0)