Skip to content

Commit 734e3f2

Browse files
tniessenlegendecas
andauthored
doc: fix rendering of code blocks in list (#1401)
Co-authored-by: Chengzhong Wu <[email protected]>
1 parent d605d62 commit 734e3f2

File tree

1 file changed

+44
-44
lines changed

1 file changed

+44
-44
lines changed

doc/setup.md

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ To use **Node-API** in a native module:
1717

1818
1. Add a dependency on this package to `package.json`:
1919

20-
```json
21-
"dependencies": {
22-
"node-addon-api": "*",
23-
}
24-
```
20+
```json
21+
"dependencies": {
22+
"node-addon-api": "*",
23+
}
24+
```
2525

2626
2. Decide whether the package will enable C++ exceptions in the Node-API
2727
wrapper, and reference this package as a dependency in `binding.gyp`.
@@ -32,51 +32,51 @@ To use **Node-API** in a native module:
3232

3333
To use without C++ exceptions, add the following to `binding.gyp`:
3434

35-
```gyp
36-
'dependencies': [
37-
"<!(node -p \"require('node-addon-api').targets\"):node_addon_api",
38-
],
39-
```
35+
```gyp
36+
'dependencies': [
37+
"<!(node -p \"require('node-addon-api').targets\"):node_addon_api",
38+
],
39+
```
4040

4141
To enable that capability, add an alternative dependency in `binding.gyp`:
4242

43-
```gyp
44-
'dependencies': [
45-
"<!(node -p \"require('node-addon-api').targets\"):node_addon_api_except",
46-
],
47-
```
48-
49-
If you decide to use node-addon-api without C++ exceptions enabled, please
50-
consider enabling node-addon-api safe API type guards to ensure the proper
51-
exception handling pattern:
52-
53-
```gyp
54-
'dependencies': [
55-
"<!(node -p \"require('node-addon-api').targets\"):node_addon_api_maybe",
56-
],
57-
```
58-
59-
4. If you would like your native addon to support OSX, please also add the
60-
following settings in the `binding.gyp` file:
61-
62-
```gyp
63-
'conditions': [
64-
['OS=="mac"', {
65-
'cflags+': ['-fvisibility=hidden'],
66-
'xcode_settings': {
67-
'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
68-
}
69-
}]
70-
]
71-
```
72-
73-
5. Include `napi.h` in the native module code.
43+
```gyp
44+
'dependencies': [
45+
"<!(node -p \"require('node-addon-api').targets\"):node_addon_api_except",
46+
],
47+
```
48+
49+
If you decide to use node-addon-api without C++ exceptions enabled, please
50+
consider enabling node-addon-api safe API type guards to ensure the proper
51+
exception handling pattern:
52+
53+
```gyp
54+
'dependencies': [
55+
"<!(node -p \"require('node-addon-api').targets\"):node_addon_api_maybe",
56+
],
57+
```
58+
59+
3. If you would like your native addon to support OSX, please also add the
60+
following settings in the `binding.gyp` file:
61+
62+
```gyp
63+
'conditions': [
64+
['OS=="mac"', {
65+
'cflags+': ['-fvisibility=hidden'],
66+
'xcode_settings': {
67+
'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
68+
}
69+
}]
70+
]
71+
```
72+
73+
4. Include `napi.h` in the native module code.
7474
To ensure only ABI-stable APIs are used, DO NOT include
7575
`node.h`, `nan.h`, or `v8.h`.
7676

77-
```C++
78-
#include "napi.h"
79-
```
77+
```C++
78+
#include "napi.h"
79+
```
8080

8181
At build time, the Node-API back-compat library code will be used only when the
8282
targeted node version *does not* have Node-API built-in.

0 commit comments

Comments
 (0)