Skip to content

Commit

Permalink
Merge branch 'master' into relative-width
Browse files Browse the repository at this point in the history
  • Loading branch information
12rambau authored Nov 11, 2024
2 parents a6a641f + 6fe9ebb commit fc8a2a8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ repos:
rev: "22.3.0"
hooks:
- id: black
stages: [commit]
stages: [pre-commit]

- repo: "https://github.com/pre-commit/mirrors-prettier"
rev: "v2.7.1"
hooks:
- id: prettier
stages: [commit]
stages: [pre-commit]
exclude: test_build\/.+\.html$

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.0.215"
hooks:
- id: ruff
stages: [commit]
stages: [pre-commit]

- repo: "https://github.com/commitizen-tools/commitizen"
rev: "v2.18.0"
Expand Down
4 changes: 4 additions & 0 deletions docs/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ the video directive supports all the optional attributes from the html tag as su
``:preload:``,``str``,"Specifies if and how the author thinks the video should be loaded when the page loads. Can only be values from ``['auto', 'metadata', 'none']``"
``:width:``,``int``\ [``%``\ ], Sets the width of the video player in pixels or relative to the page's width if a percentage
``:class:``,``str``, Set extra class to the video html tag
``:playsinline:``,,Specifies that the video will play in-line (instead of full-screen) on small devices.

They can be used as any directive option:

Expand All @@ -65,6 +66,7 @@ They can be used as any directive option:
.. video:: _static/video.mp4
:nocontrols:
:autoplay:
:playsinline:
:muted:
:loop:
:poster: _static/image.png
Expand All @@ -73,9 +75,11 @@ They can be used as any directive option:
.. video:: _static/video.mp4
:nocontrols:
:autoplay:
:playsinline:
:muted:
:loop:
:width: 100%
:poster: _static/image.png

And using the ``:class:`` parameter in combination with custom css, you can change the display of the html ``<video>`` tag:

Expand Down
2 changes: 2 additions & 0 deletions sphinxcontrib/video/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ class Video(SphinxDirective):
"preload": directives.unchanged,
"width": directives.unchanged,
"class": directives.unchanged,
"playsinline": directives.flag,
}

def run(self) -> List[video_node]:
Expand Down Expand Up @@ -160,6 +161,7 @@ def run(self) -> List[video_node]:
preload=preload,
width=width,
klass=self.options.get("class", ""),
playsinline="playsinline" in self.options,
)
]

Expand Down

0 comments on commit fc8a2a8

Please sign in to comment.