From 2e5396cbc8ba420537ae8c7855eb970d9c2bc4e1 Mon Sep 17 00:00:00 2001 From: saipubw Date: Fri, 24 May 2024 12:13:38 +0800 Subject: [PATCH] [no ci] fix doc (#684) --- .gitignore | 3 +++ website/.vitepress/config/en_data.ts | 4 +++- website/.vitepress/config/zh_data.ts | 2 ++ website/README.md | 2 +- website/docs/en/coro_rpc/coro_rpc_server.md | 6 +++--- 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index c205ec47..05c4269e 100644 --- a/.gitignore +++ b/.gitignore @@ -54,3 +54,6 @@ node_modules bazel-* !BUILD.bazel cdb.json + +# website +website/docs/zh/*/images/ diff --git a/website/.vitepress/config/en_data.ts b/website/.vitepress/config/en_data.ts index 5c8b04fa..76b640ec 100644 --- a/website/.vitepress/config/en_data.ts +++ b/website/.vitepress/config/en_data.ts @@ -23,7 +23,9 @@ export const struct_pack_Links = [ ]; export const coro_rpc_Links = [ - {text: 'What is coro_rpc?', link: '/en/coro_rpc/coro_rpc_introduction'}, + {text: 'coro_rpc introduction', link: '/en/coro_rpc/coro_rpc_introduction'}, + {text: 'coro_rpc client', link: '/en/coro_rpc/coro_rpc_client'}, + {text: 'coro_rpc server', link: '/en/coro_rpc/coro_rpc_server'}, ]; export const aboutLinks = [ diff --git a/website/.vitepress/config/zh_data.ts b/website/.vitepress/config/zh_data.ts index 08b8ae81..5ef2088f 100644 --- a/website/.vitepress/config/zh_data.ts +++ b/website/.vitepress/config/zh_data.ts @@ -24,6 +24,8 @@ export const struct_pack_Links = [ export const coro_rpc_Links = [ { text: 'coro_rpc简介', link: '/zh/coro_rpc/coro_rpc_introduction' }, + { text: 'coro_rpc客户端介绍', link: '/zh/coro_rpc/coro_rpc_client' }, + { text: 'coro_rpc服务端介绍', link: '/zh/coro_rpc/coro_rpc_server' }, ]; export const easylog_Links = [ diff --git a/website/README.md b/website/README.md index cc631083..50f08ed4 100644 --- a/website/README.md +++ b/website/README.md @@ -36,7 +36,7 @@ yarn install - generate website ``` -bash gen_doc.sh +bash generate.sh ``` the script will copy all markdown files and images to website folder diff --git a/website/docs/en/coro_rpc/coro_rpc_server.md b/website/docs/en/coro_rpc/coro_rpc_server.md index f18f646f..9df46991 100644 --- a/website/docs/en/coro_rpc/coro_rpc_server.md +++ b/website/docs/en/coro_rpc/coro_rpc_server.md @@ -126,7 +126,7 @@ Lazy calculate(int value) { } ``` -Users can also use async_simple::Promise to submit tasks to a custom thread pool: +Users can also use `async_simple::Promise` to submit tasks to a custom thread pool: ```cpp using namespace async_simple::coro; @@ -230,7 +230,7 @@ void echo(coro_rpc::context ctx, std::string_view param) { } ``` -It should be noted that view types in the RPC function parameters, such as std::string_view and std::span, will have their underlying data become invalid after all copies of the coro_rpc::context object for this RPC call are destructed. +It should be noted that view types in the RPC function parameters, such as std::string_view and std::span, will have their underlying data become invalid after all copies of the `coro_rpc::context` object for this RPC call are destructed. ### Calling Model @@ -252,7 +252,7 @@ void echo(coro_rpc::context ctx) { ### Error Handling -In callback functions, one should not and cannot return RPC errors by throwing exceptions, because the error might not occur within the call stack of the RPC function. Instead, we can use the coro_rpc::context::response_error() function to return RPC errors. +In callback functions, one should not and cannot return RPC errors by throwing exceptions, because the error might not occur within the call stack of the RPC function. Instead, we can use the `coro_rpc::context::response_error()` function to return RPC errors. ```cpp void echo(coro_rpc::context ctx) {