Skip to content

Commit b68d16a

Browse files
authored
Update the C API document. (#127)
1. Update to use the prettier code note block. 2. Update the latest C API document. Signed-off-by: YiYing He <[email protected]>
1 parent daeaec4 commit b68d16a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+769
-317
lines changed

docs/contribute/contribute.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,15 @@ Pull requests are always welcome, even if they only contain small fixes like typ
2020

2121
Please submit a pull request broken down into small changes bit by bit. A pull request consisting of a lot features and code changes may be hard to review. It is recommended to submit pull requests in an incremental fashion.
2222

23-
> If you split your pull request into small changes, please make sure any of the changes that goes to master will not break anything. Otherwise, it can not be merged until this feature is complete.
23+
<!-- prettier-ignore -->
24+
:::note
25+
If you split your pull request into small changes, please make sure any of the changes that goes to master will not break anything. Otherwise, it can not be merged until this feature is complete.
26+
:::
2427

2528
### Fork and Clone the Repository
2629

2730
Fork [the WasmEdge repository](https://github.com/WasmEdge/WasmEdge) and clone the code to your local workspace
2831

29-
> The WasmEdge team builds lots of extensions of Server-side WebAssembly, like [TensorFlow](https://github.com/second-state/WasmEdge-tensorflow), [Storage](https://github.com/second-state/WasmEdge-storage), [Command interface] and so on. If you want to contribute to the extensions, please check out [the details here](../develop/wasmedge/extensions/unique_extensions).
30-
3132
### Branches and Commits
3233

3334
Changes should be made on your own fork in a new branch. Pull requests should be rebased on the top of master.

docs/contribute/plugin/develop_plugin_c.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ The goal of the plug-in is to provide the host functions which can be imported w
2020

2121
Therefore, developers can implement their plug-in host functions first, as the same as the [host functions in WasmEdge C API](/embed/c/reference/latest.md#host-functions).
2222

23-
> For the more details about the [external data](/embed/c/host_function.md#host-data) and [calling frame context](/embed/c/host_function.md#calling-frame-context), please refer to the host function guide.
23+
<!-- prettier-ignore -->
24+
:::note
25+
For the more details about the [external data](/embed/c/host_function.md#host-data) and [calling frame context](/embed/c/host_function.md#calling-frame-context), please refer to the host function guide.
26+
:::
2427

2528
```c
2629
#include <wasmedge/wasmedge.h>

docs/contribute/plugin/develop_plugin_cpp.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ sidebar_position: 3
44

55
# Develop WasmEdge Plug-in in C++ API
66

7-
> We recommend developers to [develop plug-ins in WasmEdge C API](develop_plugin_c.md).
7+
<!-- prettier-ignore -->
8+
:::note
9+
We recommend developers to [develop plug-ins in WasmEdge C API](develop_plugin_c.md).
10+
:::
811

912
## Prerequisites
1013

docs/contribute/plugin/intro.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ Please [refer to the plugin example code](https://github.com/WasmEdge/WasmEdge/t
2222

2323
There are several plug-in releases with the WasmEdge official releases. Please check the following table to check the release status and how to build from source with the plug-ins.
2424

25-
> The `WasmEdge-Process` plug-in is attached in the WasmEdge release tarballs.
26-
2725
| Plug-in | Rust Crate | Released Platforms | Build Steps |
2826
| --- | --- | --- | --- |
2927
| WasmEdge-Process | [wasmedge_process_interface][] | `manylinux2014 x86_64`, `manylinux2014 aarch64`, and `ubuntu 20.04 x86_64` (since `0.10.0`) | [Build Wtih WasmEdge-Process](/contribute/source/plugin/process) |
@@ -35,7 +33,10 @@ There are several plug-in releases with the WasmEdge official releases. Please c
3533
| WasmEdge-Tensorflow | [wasmedge_tensorflow_interface][] | `manylinux2014 x86_64`, `manylinux2014 aarch64`, `ubuntu 20.04 x86_64`, `darwin x86_64`, and `darwin arm64` (since `0.13.0`) | [Build With WasmEdge-Tensorflow](/contribute/source/plugin/tensorflow) |
3634
| WasmEdge-TensorflowLite | [wasmedge_tensorflow_interface][] | `manylinux2014 x86_64`, `manylinux2014 aarch64`, `ubuntu 20.04 x86_64`, `darwin x86_64`, and `darwin arm64` (since `0.13.0`) | [Build With WasmEdge-TensorflowLite](/contribute/source/plugin/tensorflowlite) |
3735

38-
> Due to the `OpenVINO` dependency, we only release the WASI-NN plug-in for the `OpenVINO` backend on `Ubuntu 20.04 x86_64` now. We'll work with `manylinux2014` versions in the future.
36+
<!-- prettier-ignore -->
37+
:::note
38+
Due to the `OpenVINO` dependency, we only release the WASI-NN plug-in for the `OpenVINO` backend on `Ubuntu 20.04 x86_64` now. We'll work with `manylinux2014` versions in the future.
39+
:::
3940

4041
[wasmedge_process_interface]: https://crates.io/crates/wasmedge_process_interface
4142
[wasmedge_tensorflow_interface]: https://crates.io/crates/wasmedge_tensorflow_interface

docs/contribute/source/os/android/build.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ However, the WasmEdge installer does not support Android. The user must download
2121

2222
Please follow this guide to build and test WasmEdge from source code with Android NDK.
2323

24-
> In current state, we only support the runtime for the interpreter mode.
24+
<!-- prettier-ignore -->
25+
:::note
26+
In current state, we only support the runtime for the interpreter mode.
27+
:::
2528

2629
## Prepare the Environment
2730

docs/contribute/source/os/openwrt.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ sidebar_position: 5
66

77
Please follow this tutorial to build and test WasmEdge in OpenWrt(x86_64) from source code.
88

9-
> Currently, we only support the runtime for the interpreter mode.
9+
<!-- prettier-ignore -->
10+
:::note
11+
Currently, we only support the runtime for the interpreter mode.
12+
:::
1013

1114
## Prepare the Environment
1215

docs/contribute/source/os/sel4.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ $ docker run --rm -v $(pwd):/app -it wasmedge/sel4_build
3434
(docker) root#
3535
```
3636

37-
> If you do not want to build the seL4 system simulator yourself, you can download the [build artifact](https://github.com/second-state/wasmedge-seL4/actions/runs/1374510169) from our GitHub Actions, and skip directly to [Boot wasmedge-seL4](#boot-wasmedge-sel4)
37+
<!-- prettier-ignore -->
38+
:::note
39+
If you do not want to build the seL4 system simulator yourself, you can download the [build artifact](https://github.com/second-state/wasmedge-seL4/actions/runs/1374510169) from our GitHub Actions, and skip directly to [Boot wasmedge-seL4](#boot-wasmedge-sel4)
40+
:::
3841

3942
### Automatic installation: all-in-one script
4043

docs/contribute/source/plugin/wasi_logging.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ cmake -DCMAKE_BUILD_TYPE=Release -DWASMEDGE_PLUGIN_WASI_LOGGING=ON .. && make -j
2020
cmake --install .
2121
```
2222

23-
> If the built `wasmedge` CLI tool cannot find the WASI-Logging plug-in, you can set the `WASMEDGE_PLUGIN_PATH` environment variable to the plug-in installation path (`/usr/local/lib/wasmedge`, or the built plug-in path `build/plugins/wasi_logging`) to try to fix this issue. You should find `libwasmedgePluginWasiLogging.so` in your `WASMEDGE_PLUGIN_PATH`
23+
<!-- prettier-ignore -->
24+
:::note
25+
If the built `wasmedge` CLI tool cannot find the WASI-Logging plug-in, you can set the `WASMEDGE_PLUGIN_PATH` environment variable to the plug-in installation path (`/usr/local/lib/wasmedge`, or the built plug-in path `build/plugins/wasi_logging`) to try to fix this issue. You should find `libwasmedgePluginWasiLogging.so` in your `WASMEDGE_PLUGIN_PATH`
26+
:::
2427

2528
Then you will have an executable `wasmedge` runtime under `/usr/local/bin` and the WASI-Logging plug-in under `/usr/local/lib/wasmedge/libwasmedgePluginWasiLogging.so` after installation.

docs/develop/c/hello_world.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ Save it in any file and then compile it to WebAssembly with emscripten .
4444
emcc hello.c -o hello.wasm
4545
```
4646

47-
> Note: Make sure you either supply `-s STANDALONE_WASM` flag or specify output as wasm `-o your_file_name.wasm`
47+
<!-- prettier-ignore -->
48+
:::note
49+
Make sure you either supply `-s STANDALONE_WASM` flag or specify output as wasm `-o your_file_name.wasm`
50+
:::
4851

4952
Then run the wasm in wasmedge runtime
5053

docs/develop/deploy/cri-runtime/crio-crun.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ systemctl start crio
4343

4444
CRI-O uses the `runc` runtime by default and we need to configure it to use `crun` instead. That is done by adding to two configuration files.
4545

46-
> Make sure that you have [built and installed the `crun` binary with WasmEdge support](../oci-runtime/crun.md) before starting the following steps.
46+
<!-- prettier-ignore -->
47+
:::note
48+
Make sure that you have [built and installed the `crun` binary with WasmEdge support](../oci-runtime/crun.md) before starting the following steps.
49+
:::
4750

4851
First, create a `/etc/crio/crio.conf` file and add the following lines as its content. It tells CRI-O to use `crun` by default.
4952

@@ -170,7 +173,10 @@ sudo crictl pull docker.io/avengermojo/http_server:with-wasm-annotation
170173

171174
Next, we need to create two simple configuration files that specifies how CRI-O should run this WebAssembly image in a sandbox. We already have those two files [container_http_server.json](https://raw.githubusercontent.com/second-state/wasmedge-containers-examples/main/crio/http_server/container_http_server.json) and [sandbox_config.json](https://github.com/second-state/wasmedge-containers-examples/blob/main/crio/sandbox_config.json). You can just download them to your local directory as follows.
172175

173-
> The `sandbox_config.json` file is the same for the simple WASI example and the HTTP server example. The other `container_*.json` file is application specific as it contains the application's Docker Hub URL.
176+
<!-- prettier-ignore -->
177+
:::note
178+
The `sandbox_config.json` file is the same for the simple WASI example and the HTTP server example. The other `container_*.json` file is application specific as it contains the application's Docker Hub URL.
179+
:::
174180

175181
```bash
176182
wget https://raw.githubusercontent.com/second-state/wasmedge-containers-examples/main/crio/sandbox_config.json

0 commit comments

Comments
 (0)