Work as Sphinx extension¶
You can embed HTML content from oEmbed API.
Set up¶
extensions = [
# After extensions
"oembedpy.adapters.sphinx",
]
Important
This is named oembedpy.ext.sphinx until v0.7.2.
It will keep until v1.0 for compatibility.
Usage¶
Write oembed directive into your document.
.. oembed:: CONTENT-URL
When it build, embed iframe content into your HTML.
Configuration¶
- oembed_use_workspace¶
- Type:
bool- Default:
False
Switch to toggle using simple client and workspace.
If it is set
True, extension usesWorkspaceobject as client.Note
See Workspace for more information.
- oembed_fallback_type¶
- Type:
bool- Default:
False
Change process to fallback simple-type when oEmbed provider responses invalid format.
Note
If you want to try, set this URL.
.. oembed:: https://www.reddit.com/r/Python/comments/vdopqj/sphinxrevealjs_html_presentation_builder_for/
Spec of directive¶
Example¶
Simple using¶
.. oembed:: https://www.youtube.com/watch?v=Oyh8nuaLASA
With options¶
.. oembed:: https://www.youtube.com/watch?v=Oyh8nuaLASA
:maxwidth: 640
:maxheight: 640
Gallery¶
Bluesky¶
.. oembed:: https://bsky.app/profile/attakei.dev/post/3kqigze6cks2z
Mi Smart Band 6のバンドが切れたので、いい機会だからとXiaomi Smart Band 8 Proに替えた。 今は充電しつつ、Zepp LifeからMi fitnessへデータ転送させてる。
— kAZUYA kAKEI (@attakei.dev) 2024-04-19T13:41:27.409Z