Skip to content

✨ NEW: Support parallel reading and writing #16

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
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
13 changes: 12 additions & 1 deletion src/sphinx_subfigure/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,33 @@

import math
import string
from typing import TYPE_CHECKING

from docutils import nodes
from docutils.parsers.rst import directives
from sphinx.application import Sphinx
from sphinx.util.docutils import SphinxDirective

from . import __version__
from .tr_html import setup_html
from .tr_latex import setup_latex

if TYPE_CHECKING:
from typing import Any

def setup(app: Sphinx) -> None:

def setup(app: Sphinx) -> dict[str, Any]:
"""Setup the extension."""
app.add_directive("subfigure", SubfigureDirective)
setup_html(app)
setup_latex(app)

return {
"version": __version__,
"parallel_read_safe": True,
"parallel_write_safe": True,
}


class SubfigureDirective(SphinxDirective):
"""A sphinx directive to create sub-figures."""
Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ description = Build the documentation
extras = docs
setenv =
BUILDER = {env:BUILDER:html}
whitelist_externals =
allowlist_externals =
echo
rm
commands_pre = rm -rf docs/_build/{env:BUILDER}
commands = sphinx-build -nW --keep-going -b {env:BUILDER} {posargs} docs/ docs/_build/{env:BUILDER}
commands = sphinx-build -nW --keep-going -b {env:BUILDER} -j auto {posargs} docs/ docs/_build/{env:BUILDER}
commands_post = echo "open file://{toxinidir}/docs/_build/html/index.html"

[flake8]
Expand Down