Skip to content

Commit

Permalink
doc: use code markup/markdown in headers
Browse files Browse the repository at this point in the history
This also allows us to remove backslash escaping for `[` and `]`
inside of header code, which makes the bare markdown more readable.

Refs: #31086

PR-URL: #31149
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
BridgeAR authored and targos committed Jan 14, 2020
1 parent 725daeb commit 4bbf584
Show file tree
Hide file tree
Showing 5 changed files with 141 additions and 99 deletions.
15 changes: 8 additions & 7 deletions CPP_STYLE_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ codebase not related to stylistic issues.
* [Align function arguments vertically](#align-function-arguments-vertically)
* [Initialization lists](#initialization-lists)
* [CamelCase for methods, functions, and classes](#camelcase-for-methods-functions-and-classes)
* [snake\_case for local variables and parameters](#snake_case-for-local-variables-and-parameters)
* [snake\_case\_ for private class fields](#snake_case_-for-private-class-fields)
* [snake\_case for C-like structs](#snake_case-for-c-like-structs)
* [`snake_case` for local variables and parameters](#snake_case-for-local-variables-and-parameters)
* [`snake_case_` for private class fields](#snake_case_-for-private-class-fields)
* [`snake_case` for C-like structs](#snake_case-for-c-like-structs)
* [Space after `template`](#space-after-template)
* [Memory Management](#memory-management)
* [Memory allocation](#memory-allocation)
Expand Down Expand Up @@ -155,15 +155,15 @@ class FooBar {
};
```

### snake\_case for local variables and parameters
### `snake_case` for local variables and parameters

```c++
int FunctionThatDoesSomething(const char* important_string) {
const char* pointer_into_string = important_string;
}
```
### snake\_case\_ for private class fields
### `snake_case_` for private class fields
```c++
class Foo {
Expand All @@ -172,8 +172,9 @@ class Foo {
};
```

### snake\_case for C-like structs
For plain C-like structs snake_case can be used.
### `snake_case` for C-like structs

For `plain C-like structs snake_case can be used.

```c++
struct foo_bar {
Expand Down
8 changes: 4 additions & 4 deletions benchmark/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,21 +74,21 @@ The common.js module is used by benchmarks for consistency across repeated
tasks. It has a number of helpful functions and properties to help with
writing benchmarks.

### createBenchmark(fn, configs\[, options\])
### `createBenchmark(fn, configs[, options])`

See [the guide on writing benchmarks](writing-and-running-benchmarks.md#basics-of-a-benchmark).

### default\_http\_benchmarker
### `default_http_benchmarker`

The default benchmarker used to run HTTP benchmarks.
See [the guide on writing HTTP benchmarks](writing-and-running-benchmarks.md#creating-an-http-benchmark).

### PORT
### `PORT`

The default port used to run HTTP benchmarks.
See [the guide on writing HTTP benchmarks](writing-and-running-benchmarks.md#creating-an-http-benchmark).

### sendResult(data)
### `sendResult(data)`

Used in special benchmarks that can't use `createBenchmark` and the object
it returns to accomplish what they need. This function reports timing
Expand Down
2 changes: 1 addition & 1 deletion doc/api/fs.md
Original file line number Diff line number Diff line change
Expand Up @@ -5073,7 +5073,7 @@ changes:

The `Promise` is resolved with the [`fs.Stats`][] object for the given `path`.

### `fsPromises.symlink(target, path\[, type\])`
### `fsPromises.symlink(target, path[, type])`
<!-- YAML
added: v10.0.0
-->
Expand Down
2 changes: 1 addition & 1 deletion doc/api/http2.md
Original file line number Diff line number Diff line change
Expand Up @@ -3249,7 +3249,7 @@ const server = http2.createServer((req, res) => {
});
```

#### `response.setTimeout(msecs\[, callback\])`
#### `response.setTimeout(msecs[, callback])`
<!-- YAML
added: v8.4.0
-->
Expand Down
Loading

0 comments on commit 4bbf584

Please sign in to comment.