Skip to content

Commit

Permalink
docs: avoid using dox for syntax highlighting so we have consistent h…
Browse files Browse the repository at this point in the history
…ighlighting

Re: #11579
  • Loading branch information
vkarpov15 committed Apr 3, 2022
1 parent a9f5e92 commit 0194f3b
Show file tree
Hide file tree
Showing 51 changed files with 489 additions and 483 deletions.
4 changes: 2 additions & 2 deletions docs/change-streams.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ await Person.create({ name: 'Axl Rose' });

The above script will print output that looks like:

```
```no-highlight
{
_id: {
_data: '8262408DAC000000012B022C0100296E5A10042890851837DB4792BE6B235E8B85489F46645F6964006462408DAC6F5C42FF5EE087A20004'
Expand All @@ -41,7 +41,7 @@ The above script will print output that looks like:
Note that you **must** be connected to a MongoDB replica set or sharded cluster to use change streams.
If you try to call `watch()` when connected to a standalone MongoDB server, you'll get the below error.

```
```no-highlight
MongoServerError: The $changeStream stage is only supported on replica sets
```

Expand Down
2 changes: 1 addition & 1 deletion docs/connections.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ The underlying MongoDB driver uses a process known as [server selection](https:/
If the MongoDB driver can't find a server to send an operation to after `serverSelectionTimeoutMS`,
you'll get the below error:

```
```no-timeout
MongoTimeoutError: Server selection timed out after 30000 ms
```

Expand Down
2 changes: 1 addition & 1 deletion docs/models.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ async function run() {

The output from the above [async function](http://thecodebarbarian.com/80-20-guide-to-async-await-in-node.js.html) will look like what you see below.

```
```no-highlight
2018-05-11T15:05:35.467Z 'Inserting doc'
2018-05-11T15:05:35.487Z 'Inserted doc'
2018-05-11T15:05:35.491Z { _id: { _data: ... },
Expand Down
9 changes: 6 additions & 3 deletions docs/source/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const out = module.exports.docs;

const combinedFiles = [];
for (const file of files) {
const comments = dox.parseComments(fs.readFileSync(`./${file}`, 'utf8'));
const comments = dox.parseComments(fs.readFileSync(`./${file}`, 'utf8'), { raw: true });
comments.file = file;
combinedFiles.push(comments);
}
Expand Down Expand Up @@ -121,7 +121,7 @@ function parse() {
ctx.string = `${data.name}.${ctx.name}()`;
break;
case 'return':
tag.description = tag.description ?
tag.return = tag.description ?
md.parse(tag.description).replace(/^<p>/, '').replace(/<\/p>$/, '') :
'';
ctx.return = tag;
Expand Down Expand Up @@ -177,7 +177,10 @@ function parse() {
ctx.description = prop.description.full.
replace(/<br \/>/ig, ' ').
replace(/&gt;/ig, '>');
ctx.description = highlight(ctx.description);
if (ctx.description.includes('function capitalize')) {
console.log('\n\n-------\n\n', ctx);
}
ctx.description = md.parse(ctx.description);

data.props.push(ctx);
}
Expand Down
2 changes: 1 addition & 1 deletion docs/timestamps.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ await User.findOneAndUpdate({}, { name: 'test' });

You'll see the below output from Mongoose debug mode:

```
```no-highlight
Mongoose: users.findOneAndUpdate({}, { '$setOnInsert': { createdAt: new Date("Sun, 27 Feb 2022 00:26:27 GMT") }, '$set': { updatedAt: new Date("Sun, 27 Feb 2022 00:26:27 GMT"), name: 'test' }}, {...})
```

Expand Down
6 changes: 3 additions & 3 deletions docs/tutorials/ssl.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ the `ssl` option defaults to `true` for connection strings that start with `mong
If you try to connect to a MongoDB cluster that requires SSL without enabling the `ssl` option, `mongoose.connect()`
will error out with the below error:

```javascript
```no-highlight
MongooseServerSelectionError: connection <monitor> to 127.0.0.1:27017 closed
at NativeConnection.Connection.openUri (/node_modules/mongoose/lib/connection.js:800:32)
...
Expand All @@ -40,7 +40,7 @@ SSL correctly, but there's some issue with the SSL certificate.

For example, a common issue is the below error message:

```
```no-highlight
MongooseServerSelectionError: unable to verify the first certificate
```

Expand All @@ -62,7 +62,7 @@ await mongoose.connect('mongodb://localhost:27017/test', {

Another common issue is the below error message:

```
```no-highlight
MongooseServerSelectionError: Hostname/IP does not match certificate's altnames: Host: hostname1. is not cert's CN: hostname2
```

Expand Down

0 comments on commit 0194f3b

Please sign in to comment.