Skip to content

Commit

Permalink
doc: fix embed paths (#354)
Browse files Browse the repository at this point in the history
  • Loading branch information
legendecas authored Mar 5, 2024
1 parent 7f4a9ed commit f8561c0
Show file tree
Hide file tree
Showing 9 changed files with 111 additions and 111 deletions.
106 changes: 53 additions & 53 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,267 +6,267 @@ updates:
interval: daily

- package-ecosystem: npm
directory: /1_hello_world/nan
directory: /
schedule:
interval: daily

- package-ecosystem: npm
directory: /1_hello_world/napi
directory: /src/1-getting-started/1_hello_world/nan
schedule:
interval: daily

- package-ecosystem: npm
directory: /1_hello_world/node-addon-api-addon-class
directory: /src/1-getting-started/1_hello_world/napi
schedule:
interval: daily

- package-ecosystem: npm
directory: /1_hello_world/node-addon-api
directory: /src/1-getting-started/1_hello_world/node-addon-api-addon-class
schedule:
interval: daily

- package-ecosystem: npm
directory: /2_function_arguments/nan
directory: /src/1-getting-started/1_hello_world/node-addon-api
schedule:
interval: daily

- package-ecosystem: npm
directory: /2_function_arguments/napi
directory: /src/1-getting-started/2_function_arguments/nan
schedule:
interval: daily

- package-ecosystem: npm
directory: /2_function_arguments/node-addon-api
directory: /src/1-getting-started/2_function_arguments/napi
schedule:
interval: daily

- package-ecosystem: npm
directory: /3_callbacks/nan
directory: /src/1-getting-started/2_function_arguments/node-addon-api
schedule:
interval: daily

- package-ecosystem: npm
directory: /3_callbacks/napi
directory: /src/1-getting-started/3_callbacks/nan
schedule:
interval: daily

- package-ecosystem: npm
directory: /3_callbacks/node-addon-api
directory: /src/1-getting-started/3_callbacks/napi
schedule:
interval: daily

- package-ecosystem: npm
directory: /4_object_factory/nan
directory: /src/1-getting-started/3_callbacks/node-addon-api
schedule:
interval: daily

- package-ecosystem: npm
directory: /4_object_factory/napi
directory: /src/1-getting-started/4_object_factory/nan
schedule:
interval: daily

- package-ecosystem: npm
directory: /4_object_factory/node-addon-api
directory: /src/1-getting-started/4_object_factory/napi
schedule:
interval: daily

- package-ecosystem: npm
directory: /5_function_factory/nan
directory: /src/1-getting-started/4_object_factory/node-addon-api
schedule:
interval: daily

- package-ecosystem: npm
directory: /5_function_factory/napi
directory: /src/1-getting-started/5_function_factory/nan
schedule:
interval: daily

- package-ecosystem: npm
directory: /5_function_factory/node-addon-api
directory: /src/1-getting-started/5_function_factory/napi
schedule:
interval: daily

- package-ecosystem: npm
directory: /6_object_wrap/nan
directory: /src/1-getting-started/5_function_factory/node-addon-api
schedule:
interval: daily

- package-ecosystem: npm
directory: /6_object_wrap/napi
directory: /src/1-getting-started/6_object_wrap/nan
schedule:
interval: daily

- package-ecosystem: npm
directory: /6_object_wrap/node-addon-api
directory: /src/1-getting-started/6_object_wrap/napi
schedule:
interval: daily

- package-ecosystem: npm
directory: /7_factory_wrap/nan
directory: /src/1-getting-started/6_object_wrap/node-addon-api
schedule:
interval: daily

- package-ecosystem: npm
directory: /7_factory_wrap/napi
directory: /src/1-getting-started/7_factory_wrap/nan
schedule:
interval: daily

- package-ecosystem: npm
directory: /7_factory_wrap/node-addon-api
directory: /src/1-getting-started/7_factory_wrap/napi
schedule:
interval: daily

- package-ecosystem: npm
directory: /8_passing_wrapped/nan
directory: /src/1-getting-started/7_factory_wrap/node-addon-api
schedule:
interval: daily

- package-ecosystem: npm
directory: /8_passing_wrapped/napi
directory: /src/1-getting-started/a-first-project/node-addon-api
schedule:
interval: daily

- package-ecosystem: npm
directory: /8_passing_wrapped/node-addon-api
directory: /src/2-js-to-native-conversion/8_passing_wrapped/nan
schedule:
interval: daily

- package-ecosystem: npm
directory: /a-first-project/node-addon-api
directory: /src/2-js-to-native-conversion/8_passing_wrapped/napi
schedule:
interval: daily

- package-ecosystem: npm
directory: /array_buffer_to_native/node-addon-api
directory: /src/2-js-to-native-conversion/8_passing_wrapped/node-addon-api
schedule:
interval: daily

- package-ecosystem: npm
directory: /async-iterator/node-addon-api
directory: /src/2-js-to-native-conversion/array_buffer_to_native/node-addon-api
schedule:
interval: daily

- package-ecosystem: npm
directory: /async_pi_estimate/nan
directory: /src/5-async-work/async-iterator/node-addon-api
schedule:
interval: daily

- package-ecosystem: npm
directory: /async_pi_estimate/node-addon-api
directory: /src/5-async-work/async_pi_estimate/nan
schedule:
interval: daily

- package-ecosystem: npm
directory: /async_work_promise/napi
directory: /src/5-async-work/async_pi_estimate/node-addon-api
schedule:
interval: daily

- package-ecosystem: npm
directory: /async_work_promise/node-addon-api
directory: /src/5-async-work/async_work_promise/napi
schedule:
interval: daily

- package-ecosystem: npm
directory: /async_work_thread_safe_function/napi
directory: /src/5-async-work/async_work_promise/node-addon-api
schedule:
interval: daily

- package-ecosystem: npm
directory: /build_with_cmake/napi
directory: /src/5-async-work/async_work_thread_safe_function/napi
schedule:
interval: daily

- package-ecosystem: npm
directory: /build_with_cmake/node-addon-api
directory: /src/8-tooling/build_with_cmake/napi
schedule:
interval: daily

- package-ecosystem: npm
directory: /call-js-from-async-worker-execute/node-addon-api
directory: /src/8-tooling/build_with_cmake/node-addon-api
schedule:
interval: daily

- package-ecosystem: npm
directory: /emit_event_from_cpp/node-addon-api
directory: /src/5-async-work/call-js-from-async-worker-execute/node-addon-api
schedule:
interval: daily

- package-ecosystem: npm
directory: /function-reference-demo/node-addon-api
directory: /src/7-events/emit_event_from_cpp/node-addon-api
schedule:
interval: daily

- package-ecosystem: npm
directory: /inherits_from_event_emitter/node-addon-api
directory: /src/4-references-and-handle-scope/function-reference-demo/node-addon-api
schedule:
interval: daily

- package-ecosystem: npm
directory: /multiple_load/napi
directory: /src/7-events/inherits_from_event_emitter/node-addon-api
schedule:
interval: daily

- package-ecosystem: npm
directory: /multiple_load/node_10
directory: /src/3-context-awareness/napi
schedule:
interval: daily

- package-ecosystem: npm
directory: /napi-asyncworker-example/node-addon-api
directory: /src/3-context-awareness/node_10
schedule:
interval: daily

- package-ecosystem: npm
directory: /object-template-demo/nan
directory: /src/5-async-work/napi-asyncworker-example/node-addon-api
schedule:
interval: daily

- package-ecosystem: npm
directory: /object-template-demo/napi
directory: /src/2-js-to-native-conversion/object-template-demo/nan
schedule:
interval: daily

- package-ecosystem: npm
directory: /object-wrap-demo/node-addon-api
directory: /src/2-js-to-native-conversion/object-template-demo/napi
schedule:
interval: daily

- package-ecosystem: npm
directory: /
directory: /src/2-js-to-native-conversion/object-wrap-demo/node-addon-api
schedule:
interval: daily

- package-ecosystem: npm
directory: /promise-callback-demo/node-addon-api
directory: /src/6-threadsafe-function/promise-callback-demo/node-addon-api
schedule:
interval: daily

- package-ecosystem: npm
directory: /thread_safe_function_counting/node-addon-api
directory: /src/6-threadsafe-function/thread_safe_function_counting/node-addon-api
schedule:
interval: daily

- package-ecosystem: npm
directory: /thread_safe_function_round_trip/napi
directory: /src/6-threadsafe-function/thread_safe_function_round_trip/napi
schedule:
interval: daily

- package-ecosystem: npm
directory: /threadsafe-async-iterator/node-addon-api
directory: /src/6-threadsafe-function/threadsafe-async-iterator/node-addon-api
schedule:
interval: daily

- package-ecosystem: npm
directory: /typed_array_to_native/node-addon-api
directory: /src/2-js-to-native-conversion/typed_array_to_native/node-addon-api
schedule:
interval: daily

- package-ecosystem: npm
directory: /typed_threadsafe_function/node-addon-api
directory: /src/6-threadsafe-function/typed_threadsafe_function/node-addon-api
schedule:
interval: daily

- package-ecosystem: npm
directory: /typescript_with_addon/node-addon-api
directory: /src/8-tooling/typescript_with_addon/node-addon-api
schedule:
interval: daily

Expand Down
4 changes: 2 additions & 2 deletions src/8-tooling/typescript_with_addon/node-addon-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
### Build and run:

```
npm install
npm install
npm test
```

Expand All @@ -16,4 +16,4 @@ This is a C++ function.
This is a C function.
```

This is using cmake and cmake-js based on the example [build_with_cmake](../build_with_cmake)
This is using cmake and cmake-js based on the example [build_with_cmake](../../build_with_cmake)
16 changes: 8 additions & 8 deletions website/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ The website is generated by [Gatsby](https://www.gatsbyjs.org) and published to

The basic objective of this site is to publish additional useful information concerning the Node-API technology that extends beyond the basic documentation.

Ideally, pages published to this site should reference a working demo module that is also stored in this same repository. Features configured into the Gatsby project make embedding example source code fairly straightforward.
Ideally, pages published to this site should reference a working demo module that is also stored in this same repository. Features configured into the Gatsby project make embedding example source code fairly straightforward.

## Contributing

Submissions are gratefully accepted. Simply fork the [node-addon-examples](https://github.com/nodejs/node-addon-examples) repository containing this directory, make your changes, and submit a PR.
Submissions are gratefully accepted. Simply fork the [node-addon-examples](https://github.com/nodejs/node-addon-examples) repository containing this directory, make your changes, and submit a PR.

All of the site's content is located in the `docs` directory. Besides the Markdown files, there is also the `toc.json` file that needs to be updated when pages are added or removed.

Expand All @@ -29,11 +29,11 @@ Each of the Markdown files includes front matter that Gatsby uses when formattin
| `prev` | The `id` of the page to be shown as the Previous link at the bottom of the page. |
| `next` | The `id` of the page to be shown as the Next link at the bottom of the page. |

The `prev` and `next` links can be omitted for the first and last pages in the set, respectively.
The `prev` and `next` links can be omitted for the first and last pages in the set, respectively.

### Gatsby Basics

This project assumes that Gatsby is installed globally.
This project assumes that Gatsby is installed globally.

```
npm install -g gatsby-cli
Expand All @@ -56,17 +56,17 @@ These commands are useful while working on the site:

### Embedding Source Code Samples

For this project, Gatsby is configured to have the ability to copy example source code into the generated web pages. The advantage of this approach is that the web pages can be easily regenerated whenever the source code files change.
For this project, Gatsby is configured to have the ability to copy example source code into the generated web pages. The advantage of this approach is that the web pages can be easily regenerated whenever the source code files change.

Here's the pattern to follow for embedding example source code:

```
[**package.json**](https://github.com/nodejs/node-addon-examples/blob/HEAD/object-wrap-demo/node-addon-api/package.json)
[**package.json**](https://github.com/nodejs/node-addon-examples/blob/HEAD/src/2-js-to-native-conversion/object-wrap-demo/node-addon-api/package.json)
`embed:object-wrap-demo/node-addon-api/package.json`
`embed:src/2-js-to-native-conversion/object-wrap-demo/node-addon-api/package.json`
```

> This snippet is taken from `website/docs/getting-started/objectwrap.md`
The path in the `embed` tag is relative to the main `node-addon-examples` directory, not the `website` directory.
The path in the `embed` tag is relative to the main `node-addon-examples` directory, not the `website` directory.

Loading

0 comments on commit f8561c0

Please sign in to comment.