-
Notifications
You must be signed in to change notification settings - Fork 30
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
Support online video services as well #12
Comments
for this very purpose there is the https://github.com/sphinx-contrib/youtube extention that works for vimeo and youtube is it fiting your objectives ? |
I suppose so, though it seems excessive to have to install a separate extension + have a different directive for each type of thing given how simple the logic is. Also confusing that it is called |
in the background, that's in fact quite different as vimeo and youtube provide specific iframes with specific parameters + that allows people to only specify the video ID (I use it a lot as everything I do is stored on youtube). |
For sure - that's my point. Users shouldn't have to care about whether it's "a youtube video or a vimeo video", they should just (IMO) have a single directive where they can post the URL of many video services, and the directive can figure out the logic for them. The directive logic is pretty simple, but anything that can reduce the number of things a user has to remember or think about is a good idea I think. |
In many cases, video content might be hosted online in a service instead of locally.
For example, many people upload videos to Google Drive or YouTube, and then want to embed their videos in documentation.
I think that it'd be in-scope for this extension to support these use-cases as well, for a limited subset of common video services. Probably somewhere around here:
video/sphinxcontrib/video.py
Line 19 in d5e64ea
Implementing the logic to support a service would be too much work. For example, you could just add an extra check for whether the argument to
.. video::
starts withhttp
, and if so, try to detect the service (e.g.,"youtube.com" self.arguments[0] or self.options.get("kind") == "youtube"
). Then you could output an HTMLraw::
block that included the proper structure for that video type.If you want to see one example of directive logic like this, see:
https://github.com/2i2c-org/sphinx-2i2c-theme/blob/update-theme/src/sphinx_2i2c_theme/video.py
The text was updated successfully, but these errors were encountered: