diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 0ff5596..8b4a0c5 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -15,8 +15,12 @@ build: sphinx: configuration: docs/source/conf.py -# We recommend specifying your dependencies to enable reproducible builds: -# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html -# python: -# install: -# - requirements: docs/requirements.txt +# Install the package itself (and its runtime dependencies) so that autodoc can +# import it; without this, every autodoc directive outside bibtexparser.model +# fails on the missing pylatexenc import and the API page comes out near-empty. +python: + install: + - method: pip + path: . + extra_requirements: + - docs diff --git a/bibtexparser/entrypoint.py b/bibtexparser/entrypoint.py index c997946..8a093f7 100644 --- a/bibtexparser/entrypoint.py +++ b/bibtexparser/entrypoint.py @@ -330,6 +330,7 @@ def write_file( Only applicable if `unparse_stack` is None. :param bibtex_format: Customized BibTeX format to use (optional). :param encoding: Encoding of the .bib file. Default encoding is ``"UTF-8"``. + Writing a library with at least ``LARGE_LIBRARY_WARNING_THRESHOLD`` blocks logs a warning if the unparse stack deep-copies blocks (middlewares with ``allow_inplace_modification=False``), as that is slow; pass an all-in-place stack to avoid it. @@ -374,6 +375,7 @@ def write_string( :param prepend_middleware: List of middleware to prepend to the default stack. Only applicable if `unparse_stack` is None. :param bibtex_format: Customized BibTeX format to use (optional). + Writing a library with at least ``LARGE_LIBRARY_WARNING_THRESHOLD`` blocks logs a warning if the unparse stack deep-copies blocks (middlewares with ``allow_inplace_modification=False``), as that is slow; pass an all-in-place stack to avoid it. diff --git a/bibtexparser/middlewares/__init__.py b/bibtexparser/middlewares/__init__.py index 7202200..4f5cee2 100644 --- a/bibtexparser/middlewares/__init__.py +++ b/bibtexparser/middlewares/__init__.py @@ -21,3 +21,31 @@ from .parsestack import default_parse_stack from .parsestack import default_unparse_stack + +# Declared explicitly so that sphinx autodoc documents these re-exports; +# without __all__, `automodule:: bibtexparser.middlewares` skips them all +# as imported members. +__all__ = [ + "AddEnclosingMiddleware", + "BlockMiddleware", + "LatexDecodingMiddleware", + "LatexEncodingMiddleware", + "LibraryMiddleware", + "MergeCoAuthors", + "MergeNameParts", + "MonthAbbreviationMiddleware", + "MonthIntMiddleware", + "MonthLongStringMiddleware", + "NameParts", + "NormalizeFieldKeys", + "RemoveEnclosingMiddleware", + "ResolveStringReferencesMiddleware", + "SeparateCoAuthors", + "SortBlocksByTypeAndKeyMiddleware", + "SortBlocksMiddleware", + "SortFieldsAlphabeticallyMiddleware", + "SortFieldsCustomMiddleware", + "SplitNameParts", + "default_parse_stack", + "default_unparse_stack", +]