diff --git a/bibtexparser/middlewares/month.py b/bibtexparser/middlewares/month.py index 0dbd6210..31c9ec20 100644 --- a/bibtexparser/middlewares/month.py +++ b/bibtexparser/middlewares/month.py @@ -12,7 +12,7 @@ class _MonthInterpolator(BlockMiddleware, abc.ABC): """Abstract class to handle month-conversions.""" # docstr-coverage: inherited - def __init__(self, allow_inplace_modification: bool): + def __init__(self, allow_inplace_modification: bool = True): super().__init__( allow_inplace_modification=allow_inplace_modification, allow_parallel_execution=True, diff --git a/docs/source/customize.rst b/docs/source/customize.rst index 3ff81cee..ca193f19 100644 --- a/docs/source/customize.rst +++ b/docs/source/customize.rst @@ -16,7 +16,7 @@ The core functionality of bibtexparser is deliberately kept simple: * Upon writing, the splitting is reversed and the blocks are joined together again, with few formatting options. Advanced transformations of blocks, such as sorting, encoding, cross-referencing, etc. are not part of the core functionality, -but can be optionally added to the parse stack by using the corresponging middleware layers: +but can be optionally added to the parse stack by using the corresponding middleware layers: Middleware layers helper classes providing the functionality take a library object and return a new, transformed version of said library. Middleware Layers @@ -28,9 +28,9 @@ Middleware Layers # We want to add three new middleware layers to our parse stack: layers = [ - m.MonthIntMiddleware(True), # Months should be represented as int (0-12) - m.SeparateCoAuthors(True), # Co-authors should be separated as list of strings - m.SplitNameParts(True) # Individual Names should be split into first, von, last, jr parts + m.MonthIntMiddleware(), # Months should be represented as int (0-12) + m.SeparateCoAuthors(), # Co-authors should be separated as list of strings + m.SplitNameParts() # Individual Names should be split into first, von, last, jr parts ] library = bibtexparser.parse_file('bibtex.bib', append_middleware=layers) @@ -147,4 +147,4 @@ Specifically, a user may pass a :class:`bibtexparser.BibtexFormatter` object to bib_str = bibtexparser.write_string(library, bibtex_format=bibtex_format) A few more options are provided and we refer to the docstrings of :class:`bibtexparser.BibtexFormat` for details. -Note: Sorting of blocks and fields is done with the corresponding middleware, as described above. \ No newline at end of file +Note: Sorting of blocks and fields is done with the corresponding middleware, as described above. diff --git a/examples/middelware.ipynb b/examples/middelware.ipynb index 750e3268..a466c54b 100644 --- a/examples/middelware.ipynb +++ b/examples/middelware.ipynb @@ -101,9 +101,9 @@ "\n", "# We want to add three new middleware layers to our parse stack:\n", "layers = [\n", - " m.MonthIntMiddleware(True), # Months should be represented as int (0-12)\n", - " m.SeparateCoAuthors(True), # Co-authors should be separated\n", - " m.SplitNameParts(True) # Names should be split into first, von, last, jr parts\n", + " m.MonthIntMiddleware(), # Months should be represented as int (0-12)\n", + " m.SeparateCoAuthors(), # Co-authors should be separated\n", + " m.SplitNameParts() # Names should be split into first, von, last, jr parts\n", "]\n", "library_append_pstack = bibtexparser.parse_file('bibtex.bib', append_middleware=layers)\n", "\n",