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
3 changes: 0 additions & 3 deletions demo/doc-requirements.txt

This file was deleted.

20 changes: 0 additions & 20 deletions docs/Makefile

This file was deleted.

4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
extensions = [
'sphinx_simplepdf',
'sphinxcontrib.plantuml',
'sphinxcontrib.needs',
'sphinx_needs',
'sphinx_copybutton',
]

version = "1.6.0"

templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'if_pdf_include.rst']

plantuml_output_format = "svg_img"
local_plantuml_path = os.path.join(os.path.dirname(__file__), "utils", "plantuml.jar")
Expand Down
12 changes: 6 additions & 6 deletions docs/directives.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ if-include
include nested in a if-builder statement. You can list multiple files and use different builders.

.. code-block:: rst

.. if-builder:: simplepdf

.. include:: ./path/to/my/file.xy
Expand All @@ -79,9 +79,9 @@ include nested in a if-builder statement. You can list multiple files and use di
is the same as

.. code-block:: rst
.. if-include:: simplepdf

.. if-include:: simplepdf

./path/to/my/file.xy
./path/to/my/other/file.xy

Expand All @@ -94,9 +94,9 @@ is the same as

The following chapter should only be visible in the PDF version of this documentation

.. if-include:: simplepdf
.. if-include:: simplepdf

./if_pdf_include.rst
.. include:: if_pdf_include.rst

.. _pdf-include:

Expand Down
4 changes: 0 additions & 4 deletions docs/doc-requirements.txt

This file was deleted.

4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,6 @@ Showcase
directives
css
tech_details
examples/index
examples/sphinx_needs
changelog
license
license
35 changes: 0 additions & 35 deletions docs/make.bat

This file was deleted.

195 changes: 195 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
[build-system]
requires = ["flit_core >=3.4,<4"]
build-backend = "flit_core.buildapi"

[project]
name = "sphinx-simplepdf"
version = "1.6.0"
description = "An easy to use PDF Builder for Sphinx with a modern PDF-Theme."
readme = "README.rst"
license = { text = "MIT" }
requires-python = ">=3.10"
authors = [{ name = "team useblocks", email = "[email protected]" }]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Documentation",
"Topic :: Utilities",
"Framework :: Sphinx :: Extension",
]
dependencies = [
"sphinx>=7.0",
"weasyprint>=66.0",
"libsass",
"beautifulsoup4",
"packaging>=20.0", # Modern replacement for pkg_resources.parse_version
"fonttools>=4.0.0",
"pillow>=9.1.0",
"pydyf>=0.10.0",
"cffi>=0.6",
]

[project.entry-points."sphinx.html_themes"]
simplepdf_theme = "sphinx_simplepdf.themes.simplepdf_theme"

[project.entry-points."sphinx.builders"]
simplepdf = "sphinx_simplepdf.builders.simplepdf"


[project.optional-dependencies]
dev = [
"pre-commit>=3.5",
"pytest>=7.0",
"pytest-xdist>=3.0",
"tox>=4.0",
"tox-uv>=1.0",
"ruff>=0.4.0",
"pdfminer.six>=20220319"
]
docs = [
"sphinx>=7.0",
"sphinxcontrib-plantuml",
"sphinx-needs",
"sphinx-copybutton",
]

demo = [
"sphinx>=7.0",
"sphinxcontrib-plantuml",
"sphinx-needs",
"sphinx-copybutton",
]


[project.urls]
Homepage = "https://github.com/useblocks/sphinx-simplepdf"
Documentation = "https://sphinx-simplepdf.readthedocs.io/en/latest/"
Repository = "https://github.com/useblocks/sphinx-simplepdf"
"Bug Tracker" = "https://github.com/useblocks/sphinx-simplepdf/issues"

[tool.ruff]
line-length = 120
target-version = "py310"

[tool.ruff.lint]
extend-select = [
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"F", # pyflakes (includes unused imports)
"I", # isort
"ICN", # flake8-import-conventions
"ISC", # flake8-implicit-str-concat
"N", # pep8-naming
"RUF", # Ruff-specific rules
"SIM", # flake8-simplify
"UP", # pyupgrade
]
extend-ignore = ["B904", "ISC001", "ICN001", "N818", "RUF012"]

[tool.ruff.lint.isort]
known-first-party = ["sphinx_simplepdf"]
force-sort-within-sections = true

[tool.tox]
# To use tox, see https://tox.readthedocs.io
# $ pipx install tox
# it is suggested to use with https://github.com/tox-dev/tox-uv or https://github.com/tox-dev/tox-conda
# $ pipx inject tox tox-uv

legacy_tox_ini = """
[tox]
env_list =
py{311,312,313}-sphinx{74,81,82}
docs
lint
requires =
tox>=4
tox-uv>=1.0

[testenv]
deps =
sphinx>=7.0
pytest
pdfminer.six>=20220319
sphinx-simplepdf @ .
commands =
pytest {posargs:tests/}

[testenv:py{310,311,312,313}-sphinx74]
deps =
sphinx>=7.4,<7.5
pytest
pdfminer.six>=20220319
sphinx-simplepdf @ .
commands =
pytest {posargs:tests/}

[testenv:py{311,312,313}-sphinx81]
deps =
sphinx>=8.1,<8.2
pytest
pdfminer.six>=20220319
sphinx-simplepdf @ .
commands =
pytest {posargs:tests/}

[testenv:py{311,312,313}-sphinx82]
deps =
sphinx>=8.2,<8.3
pytest
pdfminer.six>=20220319
sphinx-simplepdf @ .
commands =
pytest {posargs:tests/}

[testenv:lint]
description = Run code quality checks
allowlist_externals =
ruff
deps =
ruff>=0.4.0
commands =
ruff check sphinx_simplepdf/
ruff format --check sphinx_simplepdf/

[testenv:docs]
description = Build documentation with Sphinx
basepython = python3.12
deps =
sphinx>=7.0
extras = docs
commands =
sphinx-build -a -E -j auto -b html docs/ docs/_build

[testenv:demo]
description = Build demo with Sphinx
basepython = python3.12
deps =
sphinx>=7.0,<8.0
extras = demo
commands =
sphinx-build -a -E -j auto -b simplepdf demo/ demo/_build

"""



# [tool.setuptools.packages.find]
# where = ["sphinx_simplepdf/themes/simplepdf_theme"]

# [tool.setuptools.package-data]
# sphinx_simplepdf=[
# 'theme.conf',
# '*.html',
# 'static/styles/*.css',
# 'static/js/*.js',
# 'static/fonts/*.*'
# ]
10 changes: 7 additions & 3 deletions sphinx_simplepdf/builders/debug.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import sys
import pkgutil
import pkg_resources
import platform
try:
from importlib.metadata import version
except ImportError:
from importlib_metadata import version


class DebugPython:

Expand All @@ -17,11 +21,11 @@ def get_packages(self):
final = {}
for name in names:
try:
version = pkg_resources.get_distribution(name).version
__version__ = version(name)
except (Exception):
final[name] = 'unknown'
else:
final[name] = version
final[name] = __version__

return final

Expand Down
Loading