8000 sphinxcontrib-jquery · sphinx-contrib/jquery@38c8b44 · GitHub
[go: up one dir, main page]

Skip to content

Commit 38c8b44

Browse files
committed
sphinxcontrib-jquery
0 parents  commit 38c8b44

File tree

8 files changed

+141
-0
lines changed

8 files changed

+141
-0
lines changed

.gitignore

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
*.pyc
2+
*.egg
3+
*.so
4+
*.swp
5+
6+
.dir-locals.el
7+
.cache/
8+
.idea
9+
.mypy_cache/
10+
.pytest_cache/
11+
.ropeproject/
12+
.vscode/
13+
TAGS
14+
.tags
15+
.tox/
16+
.tx/
17+
.venv/
18+
.coverage
19+
htmlcov
20+
.DS_Store
21+
sphinx/pycode/Grammar*pickle
22+
distribute-*
23+
24+
env/
25+
build/
26+
dist/
27+
docker/
28+
Sphinx.egg-info/
29+
doc/_build/
30+
doc/locale/
31+
tests/.coverage
32+
tests/build/
33+
utils/regression_test.js
34+
35+
node_modules/

AUTHORS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Maintainers
2+
===========
3+
4+
*Listed alphabetically in forename, surname order*
5+
6+
* Adam Turner <@AA-Turner>

CHANGES.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Release 1.0.0 (in development)
2+
==============================
3+
4+
* Initial release of ``sphinxcontrib-jquery``.

LICENCE

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
BSD Zero Clause Licence
2+
3+
Copyright 2022, Adam Turner
4+
5+
Permission to use, copy, modify, and/or distribute this software for any
6+
purpose with or without fee is hereby granted.
7+
8+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14+
PERFORMANCE OF THIS SOFTWARE.

README.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
======================
2+
sphinxcontrib-jquery
3+
======================
4+
5+
.. image:: https://img.shields.io/pypi/v/sphinxcontrib-jquery.svg
6+
:target: https://pypi.org/project/sphinxcontrib-jquery/
7+
:alt: Package on PyPI
8+
9+
``sphinxcontrib-jquery`` ensures that jQuery is always installed for use in
10+
Sphinx themes or extensions.
11+
12+
To use it, add ``sphinxcontrib.jquery`` as a Sphinx extension:
13+
14+
.. code:: python
15+
16+
# conf.py
17+
18+
extensions = [
19+
"sphinxcontrib.jquery",
20+
]
21+
...

pyproject.toml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
[build-system]
2+
requires = ["setuptools>=65"]
3+
build-backend = "setuptools.build_meta"
4+
5+
# project metadata
6+
[project]
7+
name = "sphinxcontrib-jquery"
8+
version = "1.0.0"
9+
description = "Extension to include jQuery on newer Sphinx releases"
10+
readme = "README.rst"
11+
license.text = "BSD Zero Clause License"
12+
requires-python = ">=3.7"
13+
14+
# Classifiers list: https://pypi.org/classifiers/
15+
classifiers = [
16+
"Development Status :: 5 - Production/Stable",
17+
"License :: OSI Approved :: BSD License",
18+
"Operating System :: OS Independent",
19+
"Programming Language :: Python",
20+
"Programming Language :: Python :: 3",
21+
"Programming Language :: Python :: 3 :: Only",
22+
"Programming Language :: Python :: 3.7",
23+
"Programming Language :: Python :: 3.8",
24+
"Programming Language :: Python :: 3.9",
25+
"Programming Language :: Python :: 3.10",
26+
"Programming Language :: Python :: 3.11",
27+
"Programming Language :: Python :: Implementation :: CPython",
28+
"Programming Language :: Python :: Implementation :: PyPy",
29+
"Framework :: Sphinx",
30+
"Framework :: Sphinx :: Extension",
31+
"Topic :: Documentation",
32+
"Topic :: Documentation :: Sphinx",
33+
]
34+
dependencies = [
35+
"setuptools", # for pkg_resources
36+
]
37+
38+
[[project.authors]]
39+
name = "Adam Turner"

sphinxcontrib/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# -*- coding: utf-8 -*-
2+
__import__('pkg_resources').declare_namespace(__name__)

sphinxcontrib/jquery.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import sphinx
2+
3+
__version__ = "1.0.0"
4+
version_info = (1, 0, 0)
5+
6+
7+
def setup(app: "sphinx.application.Sphinx"):
8+
jquery_installed = getattr(app, "_sphinxcontrib_jquery_installed", False)
9+
if sphinx.version_info[:2] >= (6, 0) and not jquery_installed:
10+
app.add_js_file(
11+
"https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js",
12+
priority=100,
13+
)
14+
app._sphinxcontrib_jquery_installed = True
15+
16+
return {
17+
"parallel_read_safe": True,
18+
"parallel_write_safe": True,
19+
"version": "1.0.0",
20+
}

0 commit comments

Comments
 (0)
0