Skip to content

Commit

Permalink
DRIVERS-2789 Replace curly quotes with regular quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 committed Mar 4, 2024
1 parent 2c080e8 commit a296ba3
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 46 deletions.
6 changes: 5 additions & 1 deletion scripts/migrate_to_md.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,15 @@
if line.strip().startswith(':Minimum Server Version:'):
lines[i] = '- ' + line.strip()[1:] + ''


# Remove the "".. contents::" block - handled by GitHub UI.
if line.strip() == '.. contents::':
lines[i] = ''

# Replace curly quotes with regular quotes.
line = line.replace('”', '"')
line = line.replace('“', '"')
line = line.replace('’', "'")
line = line.replace('‘', "'")

# Run pandoc and capture output.
proc = subprocess.Popen(['pandoc', '-f', 'rst', '-t', 'gfm'], stdin=subprocess.PIPE, stdout=subprocess.PIPE)
Expand Down
6 changes: 3 additions & 3 deletions source/auth/auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ a driver performs authentication with a MongoDB server.

### META

The keywords MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY, and
OPTIONAL in this document are to be interpreted as described in [RFC 2119](https://www.ietf.org/rfc/rfc2119.txt).
The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in [RFC 2119](https://www.ietf.org/rfc/rfc2119.txt).

### References

Expand Down Expand Up @@ -855,7 +855,7 @@ The following diagram is a summary of the steps drivers MUST follow to calculate
| X-Amz-Date\* | See [Amazon Documentation](https://docs.aws.amazon.com/general/latest/gr/sigv4_elements.html) |
| X-Amz-Security-Token\* | Optional, see [Amazon Documentation](https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html?shortFooter=true) |
| X-MongoDB-Server-Nonce\* | Base64 string of server nonce |
| X-MongoDB-GS2-CB-Flag\* | ASCII lower-case character ‘n’ or ‘y’ or ‘p’ |
| X-MongoDB-GS2-CB-Flag\* | ASCII lower-case character "n" or "y" or "p" |
| X-MongoDB-Optional-Data\* | Optional data, base64 encoded representation of the optional object provided by the client |
| Body | Action=GetCallerIdentity&Version=2011-06-15 |

Expand Down
40 changes: 20 additions & 20 deletions source/bson-decimal128/decimal128.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ of precision, a max value of approximately `10^6145`, and min value of approxima
`BSON Decimal128` type (`"\x13"`).

**Clamping**:\
Clamping happens when a values exponent is too large for the destination format. This works by adding
Clamping happens when a value"s exponent is too large for the destination format. This works by adding
zeros to the coefficient to reduce the exponent to the largest usable value. An overflow occurs if the number of digits
required is more than allowed in the destination format.

Expand Down Expand Up @@ -164,40 +164,40 @@ number or a special value.
* If it describes a finite number, it includes one or more decimal digits,
with an optional decimal point. The decimal point may be embedded in the
digits, or may be prefixed or suffixed to them. The group of digits (and
optional point) thus constructed may have an optional sign (‘+’ or ‘-’)
optional point) thus constructed may have an optional sign ("+" or "-")
which must come before any digits or decimal point.
* The string thus described may optionally be followed by an ‘E’
* The string thus described may optionally be followed by an "E"
(indicating an exponential part), an optional sign, and an integer
following the sign that represents a power of ten that is to be applied.
The ‘E’ may be in uppercase or lowercase.
The "E" may be in uppercase or lowercase.
* If it describes a special value, it is one of the case-independent names
Infinity’, ‘Inf, or NaN (where the first two represent infinity and
"Infinity", "Inf", or "NaN" (where the first two represent infinity and
the second represent NaN). The name may be preceded by an optional sign,
as for finite numbers.
* No blanks or other whitespace characters are permitted in a numeric string.
Formally
sign ::= ’+’ | ’-’
digit ::= ’0’ | ’1’ | ’2’ | ’3’ | ’4’ | ’5’ | ’6’ | ’7’ |
’8’ | ’9’
indicator ::= ’e’ | ’E’
sign ::= "+" | "-"
digit ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" |
"8" | "9"
indicator ::= "e" | "E"
digits ::= digit [digit]...
decimal-part ::= digits ’.’ [digits] | [’.’] digits
decimal-part ::= digits "." [digits] | ["."] digits
exponent-part ::= indicator [sign] digits
infinity ::= Infinity | Inf
nan ::= NaN
infinity ::= "Infinity" | "Inf"
nan ::= "NaN"
numeric-value ::= decimal-part [exponent-part] | infinity
numeric-string ::= [sign] numeric-value | [sign] nan
where the characters in the strings accepted for infinity and nan may be in
where the characters in the strings accepted for "infinity" and "nan" may be in
any case. If an implementation supports the concept of diagnostic information
on NaNs, the numeric strings for NaNs MAY include one or more digits, as shown
above.[3] These digits encode the diagnostic information in an
implementation-defined manner; however, conversions to and from string for
diagnostic NaNs should be reversible if possible. If an implementation does not
support diagnostic information on NaNs, these digits should be ignored where
necessary. A plain NaN is usually the same as NaN0.
necessary. A plain "NaN" is usually the same as "NaN0".
Drivers MAY choose to support signed NaN (sNaN), along with sNaN with
Expand Down Expand Up @@ -249,9 +249,9 @@ greater than or equal to -6, the number will be converted to a character form
without using exponential notation. In this case, if the exponent is zero then
no decimal point is added. Otherwise (the exponent will be negative), a decimal
point will be inserted with the absolute value of the exponent specifying the
number of characters to the right of the decimal point. ‘0’ characters are
number of characters to the right of the decimal point. "0" characters are
added to the left of the converted coefficient as necessary. If no character
precedes the decimal point after this insertion then a conventional ‘0’
precedes the decimal point after this insertion then a conventional "0"
character is prefixed.
Expand All @@ -260,10 +260,10 @@ less than -6), the number will be converted to a character form using
exponential notation. In this case, if the converted coefficient has more than
one digit a decimal point is inserted after the first digit. An exponent in
character form is then suffixed to the converted coefficient (perhaps with
inserted decimal point); this comprises the letter ‘E’ followed immediately by
inserted decimal point); this comprises the letter "E" followed immediately by
the adjusted exponent converted to a character form. The latter is in base ten,
using the characters 0 through 9 with no leading zeros, always prefixed by a
sign character (‘-’ if the calculated exponent is negative, ‘+’ otherwise).
sign character ("-" if the calculated exponent is negative, "+" otherwise).
```

This corresponds to the following code snippet:
Expand Down Expand Up @@ -334,10 +334,10 @@ Most of the tests are converted from the
## Q&A
- Is it true Decimal128 doesnt normalize the value?
- Is it true Decimal128 doesn"t normalize the value?
- Yes. As a result of non-normalization rules of the Decimal128 data type, precision is represented exactly. For
example, 2.00 always remains stored as 200E-2 in Decimal128, and it differs from the representation of 2.0
example, "2.00" always remains stored as 200E-2 in Decimal128, and it differs from the representation of "2.0"
(20E-1). These two values compare equally, but represent different ideas.
- How does Decimal128 "2.000" look in the shell?
Expand Down
20 changes: 10 additions & 10 deletions source/change-streams/change-streams.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ as behavior during failure scenarios.

#### META

The keywords MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY, and
OPTIONAL in this document are to be interpreted as described in [RFC 2119](https://www.ietf.org/rfc/rfc2119.txt).
The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in [RFC 2119](https://www.ietf.org/rfc/rfc2119.txt).

#### Terms

Expand Down Expand Up @@ -138,18 +138,18 @@ class ChangeStreamDocument {
operationDescription: Optional<Document>

/**
* Only present for ops of type insert’, ‘update’, ‘replace, and
* delete.
* Only present for ops of type "insert", "update", "replace", and
* "delete".
*
* For unsharded collections this contains a single field, _id, with the
* value of the _id of the document updated. For sharded collections,
* this will contain all the components of the shard key in order,
* followed by the _id if the _id isnt part of the shard key.
* followed by the _id if the _id isn"t part of the shard key.
*/
documentKey: Optional<Document>;

/**
* Only present for ops of type update.
* Only present for ops of type "update".
*/
updateDescription: Optional<UpdateDescription>;

Expand Down Expand Up @@ -257,7 +257,7 @@ class UpdateDescription {

/**
* Truncations of arrays may be reported using one of the following methods:
* either via this field or via the updatedFields field. In the latter case the entire array is considered to be replaced.
* either via this field or via the "updatedFields" field. In the latter case the entire array is considered to be replaced.
*
* The structure of documents in this field is
* {
Expand Down Expand Up @@ -556,7 +556,7 @@ in the pipeline supplied to the helper), as the server will return an error.

The helper methods MUST determine a read concern for the operation in accordance with the
[Read and Write Concern specification](https://github.com/mongodb/specifications/blob/master/source/read-write-concern/read-write-concern.rst#via-code).
The initial implementation of change streams on the server requires a majority read concern or no read concern.
The initial implementation of change streams on the server requires a "majority" read concern or no read concern.
Drivers MUST document this requirement. Drivers SHALL NOT throw an exception if any other read concern is specified, but
instead should depend on the server to return an error.

Expand Down Expand Up @@ -667,8 +667,8 @@ A change stream MUST track the last resume token, per
[Updating the Cached Resume Token](#updating-the-cached-resume-token).

Drivers MUST raise an error on the first document received without a resume token (e.g. the user has removed `_id` with
a pipeline stage), and close the change stream. The error message SHOULD resemble Cannot provide resume functionality
when the resume token is missing.
a pipeline stage), and close the change stream. The error message SHOULD resemble "Cannot provide resume functionality
when the resume token is missing".

A change stream MUST attempt to resume a single time if it encounters any resumable error per
[Resumable Error](#resumable-error). A change stream MUST NOT attempt to resume on any other type of error.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ but not limited to server selection, connection checkout, and server-side execut

## META

The keywords MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY, and
OPTIONAL in this document are to be interpreted as described in [RFC 2119](https://www.ietf.org/rfc/rfc2119.txt).
The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in [RFC 2119](https://www.ietf.org/rfc/rfc2119.txt).

## Specification

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ This specification does not apply to drivers that do not support multitasking.

## META

The keywords MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY, and
OPTIONAL in this document are to be interpreted as described in [RFC 2119](https://www.ietf.org/rfc/rfc2119.txt).
The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in [RFC 2119](https://www.ietf.org/rfc/rfc2119.txt).

## Definitions

Expand Down Expand Up @@ -209,7 +209,7 @@ interface Connection {
address: string;

/**
* An integer representing the generation of the pool
* An integer representing the "generation" of the pool
* when this Connection was created.
*/
generation: number;
Expand Down Expand Up @@ -431,8 +431,8 @@ connections before observing the PoolReadyEvent event.

#### Creating a Connection (Internal Implementation)

When creating a [Connection](#connection), the initial [Connection](#connection) is in a pending state. This only
creates a virtual [Connection](#connection), and performs no I/O.
When creating a [Connection](#connection), the initial [Connection](#connection) is in a "pending" state. This only
creates a "virtual" [Connection](#connection), and performs no I/O.

```
connection = new Connection()
Expand Down Expand Up @@ -772,7 +772,7 @@ implemented, drivers SHOULD use this method as the default method of checking ou

All drivers that implement a connection pool MUST provide an API that allows users to subscribe to events emitted from
the pool. If a user subscribes to Connection Monitoring events, these events MUST be emitted when specified in
Connection Pool Behaviors. Events SHOULD be created and subscribed to in a manner idiomatic to their language and
"Connection Pool Behaviors". Events SHOULD be created and subscribed to in a manner idiomatic to their language and
driver.

#### Events
Expand Down Expand Up @@ -1004,7 +1004,7 @@ logging.

Drivers MUST support logging of connection pool information via the following types of log messages. These messages MUST
be logged at `Debug` level and use the `connection` log component. These messages MUST be emitted when specified in
Connection Pool Behaviors.
"Connection Pool Behaviors".

The log messages are intended to match the information contained in the events above. Drivers MAY implement connection
logging support via an event subscriber if it is convenient to do so.
Expand Down Expand Up @@ -1241,7 +1241,7 @@ Step-Down, which will be further addressed in our [Advanced Pooling Behaviors](#

ConnectionCreated and ConnectionReady each involve different state changes in the pool.

- ConnectionCreated adds a new pending [Connection](#connection), meaning the totalConnectionCount and
- ConnectionCreated adds a new "pending" [Connection](#connection), meaning the totalConnectionCount and
pendingConnectionCount increase by one
- ConnectionReady establishes that the [Connection](#connection) is ready for use, meaning the availableConnectionCount
increases by one
Expand Down Expand Up @@ -1352,8 +1352,8 @@ them.

### SDAM

This specification does not dictate how SDAM Monitoring connections are managed. SDAM specifies that A monitor SHOULD
NOT use the client's regular Connection pool. Some possible solutions for this include:
This specification does not dictate how SDAM Monitoring connections are managed. SDAM specifies that "A monitor SHOULD
NOT use the client's regular Connection pool". Some possible solutions for this include:

- Having each Endpoint representation in the driver create and manage a separate dedicated [Connection](#connection) for
monitoring purposes
Expand Down

0 comments on commit a296ba3

Please sign in to comment.