Skip to content
Permalink
Browse files

doc: use code markup/markdown in headers

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 Trott committed Jan 1, 2020
1 parent 84b15eb commit f64842adebe5cc89039488d2e54a6dfc89cd56d3
Showing with 142 additions and 99 deletions.
  1. +8 −7 CPP_STYLE_GUIDE.md
  2. +4 −4 benchmark/README.md
  3. +1 −1 doc/api/fs.md
  4. +1 −1 doc/api/http2.md
  5. +128 −86 test/common/README.md
@@ -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)
@@ -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 {
@@ -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 {
@@ -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
@@ -5093,7 +5093,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
-->
@@ -3233,7 +3233,7 @@ const server = http2.createServer((req, res) => {
});
```

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

0 comments on commit f64842a

Please sign in to comment.
You can’t perform that action at this time.