Skip to content

Commit b2e6b07

Browse files
authored
Beautify code snippets. (#100)
Signed-off-by: bitliu <[email protected]>
1 parent 258b4c6 commit b2e6b07

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ A Dockerfile for the C++ SDK is provided in Dockerfile-sdk.
1111

1212
It can built in this directory by:
1313

14-
```
14+
```bash
1515
docker build -t wasmsdk:v2 -f Dockerfile-sdk .
1616
```
1717

@@ -21,7 +21,7 @@ The docker image can be used for compiling wasm files.
2121

2222
Create a directory with your source files and a Makefile:
2323

24-
```
24+
```makefile
2525
PROXY_WASM_CPP_SDK=/sdk
2626

2727
all: myproject.wasm
@@ -31,7 +31,7 @@ include ${PROXY_WASM_CPP_SDK}/Makefile.base_lite
3131

3232
Source file (myproject.cc):
3333

34-
```
34+
```c++
3535
#include <string>
3636
#include <unordered_map>
3737

@@ -81,7 +81,7 @@ To use a newer/specific version of the SDK (e.g. from the version of Enovy you a
8181

8282
Here is an example Makefile referencing the SDK at ../envoy/api/wasm/cpp and mounted as 'sdk' in the /work directory:
8383

84-
```
84+
```makefile
8585
PROXY_WASM_CPP_SDK=/work/sdk
8686

8787
all: myproject.wasm
@@ -99,7 +99,7 @@ docker run -v $PWD:/work -v $PWD/../envoy/api/wasm/cpp:/work/sdk -w /work wasms
9999

100100
Abseil (optionally) is built in /root/abseil and can be used. Note that the abseil containers (e.g. absl::flat\_hash\_set) exercise many syscalls which are not supported. Consequantally individual files should be pulled in which are relatively self contained (e.g. strings). Example customized Makefile:
101101

102-
```
102+
```makefile
103103
PROXY_WASM_CPP_SDK=/sdk
104104
CPP_API:=${PROXY_WASM_CPP_SDK}
105105
CPP_CONTEXT_LIB = ${CPP_API}/proxy_wasm_intrinsics.cc
@@ -115,7 +115,7 @@ all: plugin.wasm
115115

116116
Precompiled abseil libraries are also available, so the above can also be done as:
117117

118-
```
118+
```makefile
119119
PROXY_WASM_CPP_SDK=/sdk
120120
CPP_API:=${PROXY_WASM_CPP_SDK}
121121
CPP_CONTEXT_LIB = ${CPP_API}/proxy_wasm_intrinsics.cc
@@ -133,7 +133,7 @@ all: plugin.wasm
133133

134134
The compiled files may be owned by root. To chown them add the follow lines to the Makefile and docker invocation:
135135

136-
```
136+
```makefile
137137
PROXY_WASM_CPP_SDK=/sdk
138138

139139
all: myproject.wasm

0 commit comments

Comments
 (0)