Skip to content

Commit 3186956

Browse files
committed
Don't let sidebar text overflow
1 parent ca7f5ea commit 3186956

File tree

4 files changed

+25
-13
lines changed

4 files changed

+25
-13
lines changed

av/stream.pyx

+6-8
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ cdef class Stream:
202202
"""
203203
The unit of time (in fractional seconds) in which timestamps are expressed.
204204
205-
:type: :class:`~fractions.Fraction` or ``None``
205+
:type: fractions.Fraction | None
206206
207207
"""
208208
return avrational_to_fraction(&self.ptr.time_base)
@@ -219,7 +219,7 @@ cdef class Stream:
219219
The presentation timestamp in :attr:`time_base` units of the first
220220
frame in this stream.
221221
222-
:type: :class:`int` or ``None``
222+
:type: int | None
223223
"""
224224
if self.ptr.start_time != lib.AV_NOPTS_VALUE:
225225
return self.ptr.start_time
@@ -229,7 +229,7 @@ cdef class Stream:
229229
"""
230230
The duration of this stream in :attr:`time_base` units.
231231
232-
:type: :class:`int` or ``None``
232+
:type: int | None
233233
234234
"""
235235
if self.ptr.duration != lib.AV_NOPTS_VALUE:
@@ -242,7 +242,7 @@ cdef class Stream:
242242
243243
Returns ``0`` if it is not known.
244244
245-
:type: :class:`int`
245+
:type: int
246246
"""
247247
return self.ptr.nb_frames
248248

@@ -251,7 +251,7 @@ cdef class Stream:
251251
"""
252252
The language of the stream.
253253
254-
:type: :class:`str` or ``None``
254+
:type: str | None
255255
"""
256256
return self.metadata.get("language")
257257

@@ -264,8 +264,6 @@ cdef class Stream:
264264
"""
265265
The type of the stream.
266266
267-
Examples: ``'audio'``, ``'video'``, ``'subtitle'``.
268-
269-
:type: str
267+
:type: Literal["audio", "video", "subtitle", "data", "attachment"]
270268
"""
271269
return lib.av_get_media_type_string(self.ptr.codecpar.codec_type)

av/video/stream.pyx

+5-5
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ cdef class VideoStream(Stream):
5757
This is calculated when the file is opened by looking at the first
5858
few frames and averaging their rate.
5959
60-
:type: :class:`~fractions.Fraction` or ``None``
60+
:type: fractions.Fraction | None
6161
"""
6262
return avrational_to_fraction(&self.ptr.avg_frame_rate)
6363

@@ -70,7 +70,7 @@ cdef class VideoStream(Stream):
7070
frames can be represented accurately. See :ffmpeg:`AVStream.r_frame_rate`
7171
for more.
7272
73-
:type: :class:`~fractions.Fraction` or ``None``
73+
:type: fractions.Fraction | None
7474
"""
7575
return avrational_to_fraction(&self.ptr.r_frame_rate)
7676

@@ -81,7 +81,7 @@ cdef class VideoStream(Stream):
8181
This is a wrapper around :ffmpeg:`av_guess_frame_rate`, and uses multiple
8282
heuristics to decide what is "the" frame rate.
8383
84-
:type: :class:`~fractions.Fraction` or ``None``
84+
:type: fractions.Fraction | None
8585
"""
8686
# The two NULL arguments aren't used in FFmpeg >= 4.0
8787
cdef lib.AVRational val = lib.av_guess_frame_rate(NULL, self.ptr, NULL)
@@ -94,7 +94,7 @@ cdef class VideoStream(Stream):
9494
This is a wrapper around :ffmpeg:`av_guess_sample_aspect_ratio`, and uses multiple
9595
heuristics to decide what is "the" sample aspect ratio.
9696
97-
:type: :class:`~fractions.Fraction` or ``None``
97+
:type: fractions.Fraction | None
9898
"""
9999
cdef lib.AVRational sar = lib.av_guess_sample_aspect_ratio(self.container.ptr, self.ptr, NULL)
100100
return avrational_to_fraction(&sar)
@@ -105,7 +105,7 @@ cdef class VideoStream(Stream):
105105
106106
This is calculated from :meth:`.VideoStream.guessed_sample_aspect_ratio`.
107107
108-
:type: :class:`~fractions.Fraction` or ``None``
108+
:type: fractions.Fraction | None
109109
"""
110110
cdef lib.AVRational dar
111111

docs/_static/custom.css

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
body {
2+
text-rendering: optimizeLegibility;
3+
}
4+
5+
.sphinxsidebarwrapper {
6+
overflow: scroll;
7+
}
18

29
.ffmpeg-quicklink {
310
float: right;

docs/conf.py

+7
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
from docutils import nodes
77
from sphinx.util.docutils import SphinxDirective
88

9+
sys.path.insert(0, os.path.abspath(".."))
10+
11+
912
# Add any Sphinx extension module names here, as strings. They can be extensions
1013
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
1114
extensions = [
@@ -58,6 +61,10 @@
5861
# so a file named "default.css" will overwrite the builtin "default.css".
5962
html_static_path = ["_static"]
6063

64+
html_theme_options = {
65+
"sidebarwidth": "250px",
66+
}
67+
6168

6269
doctest_global_setup = """
6370
import errno

0 commit comments

Comments
 (0)