Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.10
23 changes: 21 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,26 @@
Python 3 fixed package of of https://github.com/shomah4a/sphinxcontrib.youtube
Based on https://github.com/edwardtheharris/sphinxcontrib.youtube, https://github.com/divi255/sphinxcontrib.youtube/,
and the original https://github.com/shomah4a/sphinxcontrib.youtube.

[![PyPI - Version](https://img.shields.io/pypi/v/enginehub.sphinx-youtube)](https://pypi.org/project/enginehub.sphinx-youtube/)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/enginehub.sphinx-youtube)

Install:

```shell
pip3 install enginehub.sphinx_youtube
pip install enginehub.sphinx_youtube
```

Usage:

First of all, add `enginehub.sphinx_youtube` to sphinx extension list in conf.py:
```python
extensions = ['enginehub.sphinx_youtube']
```
then use `youtube` directive.

You can specify video by video url or video id:
```rst
.. youtube:: https://www.youtube.com/watch?v=Ql9sn3aLLlI

.. youtube:: Ql9sn3aLLlI
```
105 changes: 0 additions & 105 deletions buildout.cfg

This file was deleted.

1 change: 0 additions & 1 deletion enginehub/__init__.py

This file was deleted.

54 changes: 0 additions & 54 deletions enginehub/sphinx_youtube/__init__.py

This file was deleted.

40 changes: 40 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[project]
name = "enginehub.sphinx_youtube"
authors = [
{ name = "shomah4a" },
]
maintainers = [
{ name = "Maddy Miller" },
{ name = "Octavia Togami" },
]
version = "0.3.0"
description = "Embed YouTube videos in Sphinx documentation."
readme = "README.md"
license = "LGPL-3.0-only"
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
"Topic :: Software Development :: Documentation",
]
requires-python = ">=3.10"
dependencies = [
"docutils>=0.22.4",
]

[project.urls]
Repository = "https://github.com/EngineHub/sphinxcontrib.youtube"

[build-system]
requires = ["uv_build>=0.10.9,<0.11.0"]
build-backend = "uv_build"

[tool.uv.build-backend]
module-name = "enginehub.sphinx_youtube"
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#-*- coding:utf-8 -*-

import setuptools
from enginehub import sphinx_youtube as pkg
from src.enginehub import sphinx_youtube as pkg

setuptools.setup(
name='enginehub.sphinx_youtube',
Expand Down
19 changes: 19 additions & 0 deletions src/enginehub/sphinx_youtube/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#-*- coding:utf-8 -*-

def skip_visit(_, _ignore2):
from docutils.nodes import SkipNode
raise SkipNode()


def setup(app):

from . import youtube

app.add_node(youtube.youtube,
html=(youtube.visit, youtube.depart),
latex=(skip_visit, None),
text=(skip_visit, None),
man=(skip_visit, None))

app.add_directive('youtube', youtube.YoutubeDirective)
return {'parallel_read_safe': True}
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
#-*- coding:utf-8 -*-

#Import urlparse in Python 2 or urllib.parse in Python 3

try:
import urlparse

except ImportError:
import urllib.parse as urlparse
import urllib.parse as urlparse

from docutils import nodes
from docutils.parsers import rst
Expand Down
23 changes: 23 additions & 0 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.