Skip to content

Commit ff2bb6c

Browse files
authored
Fix typos in documentation and source code (#503)
1 parent 1c3e9e4 commit ff2bb6c

File tree

12 files changed

+20
-19
lines changed

12 files changed

+20
-19
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ We are always looking for people to improve the library. Contributions include,
1010

1111
### Some guidelines
1212

13-
1. Be nice! Were all doing this in our free time; no one is obligated to do anything.
13+
1. Be nice! We're all doing this in our free time; no one is obligated to do anything.
1414
2. Add sufficient tests to your PRs.
1515
3. Document your code.
1616
4. Don't hesitate to ask questions.

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# python-bibtexparser v2
22

3-
Welcome to python-bibtexparser, a parser for `.bib` files with a long history and wide adaption.
3+
Welcome to python-bibtexparser, a parser for `.bib` files with a long history and wide adoption.
44

55
Bibtexparser is available in two versions: V1 and V2. For new projects, we recommend using v2 which, in the long run, will provide an overall more robust and faster experience. **For now, however, note that v2 is an early beta, and does not contain all features of v1**. Install v2 using pip:
66

@@ -61,7 +61,7 @@ bib_database = bibtexparser.parse_string(bibtex_string,
6161

6262
# Let's transform it back to a bibtex_string.
6363
new_bibtex_string = bibtexparser.write_string(bib_database,
64-
# Revert aboves transfomration
64+
# Revert above transformation
6565
prepend_middleware=[MergeNameParts(), MergeCoAuthors()]
6666
)
6767
```
@@ -76,14 +76,14 @@ Consult the documentation for a list of available middleware, parsing options an
7676
The architecture consists of the following components:
7777

7878
#### Library
79-
Reflects the contents of a parsed bibtex files, including all comments, entries, strings, preamples and their metadata (e.g. order).
79+
Reflects the contents of a parsed bibtex files, including all comments, entries, strings, preambles and their metadata (e.g. order).
8080

8181
#### A Splitter
8282
Splits a bibtex string into basic blocks (Entry, String, Preamble, ...), with correspondingly split content (e.g. fields on Entry, key-value on String, ...).
8383
The splitter aims to be forgiving when facing invalid bibtex: A line starting with a block definition (``@....``) ends the previous block, even if not yet every bracket is closed, failing the parsing of the previous block. Correspondingly, one block type is "ParsingFailedBlock".
8484

8585
#### Middleware
86-
Middleware layers transform a library and its blocks, for example by decoding latex special characters, interpolating string references, resoling crossreferences or re-ordering blocks. Thus, the choice of middleware allows to customize parsing and writing to ones specific usecase. Note: Middlewares, by default, no not mutate their input, but return a modified copy.
86+
Middleware layers transform a library and its blocks, for example by decoding latex special characters, interpolating string references, resolving crossreferences or re-ordering blocks. Thus, the choice of middleware allows to customize parsing and writing to ones specific usecase. Note: Middlewares, by default, do not mutate their input, but return a modified copy.
8787

8888
#### Writer
8989
Writes the content of a bibtex library to a ``.bib`` file. Optional formatting parameters can be passed using a corresponding dedicated data structure.

bibtexparser/entrypoint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def write_string(
174174
:param unparse_stack: List of middleware to apply to the database before writing.
175175
If None, a default stack will be used.
176176
:param prepend_middleware: List of middleware to prepend to the default stack.
177-
Only applicable if `parse_stack` is None.
177+
Only applicable if `unparse_stack` is None.
178178
:param bibtex_format: Customized BibTeX format to use (optional).
179179
"""
180180
middleware: Middleware

bibtexparser/middlewares/latex_encoding.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,9 @@ def __init__(
166166

167167
if decoder is not None and (keep_braced_groups is not None or keep_math_mode is not None):
168168
raise ValueError(
169-
"Cannot specify both encoder and one of "
170-
"`keep_braced_groups` or `keep_braced_groups`."
171-
"If you want to use a custom encoder, "
169+
"Cannot specify both decoder and one of "
170+
"`keep_braced_groups` or `keep_math_mode`."
171+
"If you want to use a custom decoder, "
172172
"you have to specify it completely."
173173
)
174174

bibtexparser/middlewares/names.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ def metadata_key(cls) -> str:
196196
return "merge_name_parts"
197197

198198
def _transform_field_value(self, name) -> List[str]:
199-
if not isinstance(name, list) and all(isinstance(n, NameParts) for n in name):
199+
if not (isinstance(name, list) and all(isinstance(n, NameParts) for n in name)):
200200
raise ValueError(f"Expected a list of NameParts, got {name}. ")
201201

202202
if self.style == "last":

bibtexparser/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88

99
class Block(abc.ABC):
10-
"""A abstract superclass of all top-level building blocks of a bibtex file.
10+
"""An abstract superclass of all top-level building blocks of a bibtex file.
1111
1212
E.g. a ``@string`` block, a ``@preamble`` block, an ``@entry`` block, a comment, etc.
1313
"""

bibtexparser/splitter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ def split(self, library: Optional[Library] = None) -> Library:
310310
logger.error(e.message)
311311
raise e
312312
except Exception as e:
313-
# For unknown exeptions, we want to fail hard and get the info in our issue tracker.
313+
# For unknown exceptions, we want to fail hard and get the info in our issue tracker.
314314
logger.error(
315315
f"Unexpected exception while parsing `{m_val}` block (line {start_line})"
316316
"Please report this bug."

docs/source/biber.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ Biber & Biblatex
33
================
44

55

6-
Due to its simpel and high-level nature, this library should not only support BibTeX, but also be able to part biblatex and biber files
6+
Due to its simple and high-level nature, this library should not only support BibTeX, but also be able to parse biblatex and biber files
77
with ease, as they all share the same general syntax.
88

9-
That said, we did not explicitely check against all of biber and biblatex features. Should you detect anything which is not supported,
9+
That said, we did not explicitly check against all of biber and biblatex features. Should you detect anything which is not supported,
1010
please open an issue or send a pull request.

docs/source/customize.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ Names
9898

9999
* :mod:`bibtexparser.middlewares.SeparateCoAuthors`
100100
* :mod:`bibtexparser.middlewares.MergeCoAuthors`
101-
* :mod:`bibtexparser.middlewares.SplitNameParts` (requires SeperateCoAuthors to be applied first)
101+
* :mod:`bibtexparser.middlewares.SplitNameParts` (requires SeparateCoAuthors to be applied first)
102102
* :mod:`bibtexparser.middlewares.MergeNameParts`
103103

104104
.. _middleware_sorting:

docs/source/install.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Installation
55
Requirements
66
------------
77

8+
89
Bibtexparser's only requirement is a python interpreter which is not yet EOL (currently >= 3.9).
910

1011
As of version 2.0.0, bibtexparser is a pure-python project (no direct bindings to C libraries).

0 commit comments

Comments
 (0)