From 6bb3025a408bdbb1b61620ca2ed7da5bfa5b57c6 Mon Sep 17 00:00:00 2001 From: ElderJames Date: Tue, 25 Aug 2020 12:42:02 +0800 Subject: [PATCH] docs: show how to create a project with template (#533) --- README-zh_CN.md | 28 ++++++++++++++++++++++++---- README.md | 28 ++++++++++++++++++++++++---- docs/introduce.en-US.md | 29 +++++++++++++++++++++++++---- docs/introduce.zh-CN.md | 27 +++++++++++++++++++++++---- 4 files changed, 96 insertions(+), 16 deletions(-) diff --git a/README-zh_CN.md b/README-zh_CN.md index b76e2cdb..6f8bb97c 100644 --- a/README-zh_CN.md +++ b/README-zh_CN.md @@ -69,16 +69,36 @@ WebAssembly 静态托管页面示例 - 先安装 [.NET Core SDK](https://dotnet.microsoft.com/download/dotnet-core/3.1) 3.1.300 以上版本 -- 创建 Blazor WebAssembly 项目 +### 从模板创建一个新项目 + +我们提供了 `dotnet new` 模板来创建一个开箱即用的 [Ant Design Pro](https://github.com/ant-design-blazor/ant-design-pro-blazor) 新项目: + +- 安装模板 ```bash - $ dotnet new blazorwasm -o MyAntDesignApp + $ dotnet new --install AntDesign.Templates::0.1.0-* ``` +- 从模板创建 Ant Design Blazor Pro 项目 + + ```bash + $ dotnet new antdesign -o MyAntDesignApp + ``` + +模板的参数: + +| 参数 | 说明 | 类型 | 认 值 | +| ---------------- | -------------------------------------------- | ------------- | --------- | +| `-f` \| `--full` | 如果设置这个参数,会生成所有 Ant Design Pro 页面 | bool | false | +| `-ho` \| `--host` | 指定托管模型 | 'wasm' \| 'server' \| 'hosted' | 'wasm' | +| `--no-restore` | 如果设置这个参数,就不会自动恢复包引用 | bool | false | + + +### 在已有项目中引入 Ant Design Blazor + - 进入应用的项目文件夹,安装 Nuget 包引用 ```bash - $ cd MyAntDesignApp $ dotnet add package AntDesign --version ``` @@ -88,7 +108,7 @@ WebAssembly 静态托管页面示例 services.AddAntDesign(); ``` -- 在 `wwwroot/index.html`(WebAssembly) 或 `Pages/_Host.razor`(Server) 中引入静态文件: +- 在 `wwwroot/index.html`(WebAssembly) 或 `Pages/_Host.cshtml`(Server) 中引入静态文件: ```html diff --git a/README.md b/README.md index 046d7c6a..7a479523 100644 --- a/README.md +++ b/README.md @@ -69,16 +69,36 @@ Regularly synchronize with Official Ant Design specifications, you can check the - Install [.NET Core SDK](https://dotnet.microsoft.com/download/dotnet-core/3.1) 3.1.300 or later -- Create Blazor WebAssembly Project +### Create a new project from the dotnet new template + +We have provided the `dotnet new` template to create a [Boilerplate](https://github.com/ant-design-blazor/ant-design-pro-blazor) project out of the box: + +- Install the template ```bash - $ dotnet new blazorwasm -o MyAntDesignApp + $ dotnet new --install AntDesign.Templates::0.1.0-* ``` +- Create the Boilerplate project with the template + + ```bash + $ dotnet new antdesign -o MyAntDesignApp + ``` + +Options for the template: + +| Options | Description | Type | Default | +| ---------------- | -------------------------------------------- | ------ | --------- | +| `-f` \| `--full` | If specified, generates all pages of Ant Design Pro | bool | false | +| `-ho` \| `--host` | Specify the hosting model | 'wasm' \| 'server' \| 'hosted' | 'wasm' | +| `--no-restore` | If specified, skips the automatic restore of the project on create | bool | false | + + +### Import Ant Design Blazor into an existing project + - Go to the project folder of the application and install the Nuget package reference ```bash - $ cd MyAntDesignApp $ dotnet add package AntDesign ``` @@ -88,7 +108,7 @@ Regularly synchronize with Official Ant Design specifications, you can check the services.AddAntDesign(); ``` -- Link the static files in `wwwroot/index.html` (WebAssembly) or `Pages/_Host.razor` (Server) +- Link the static files in `wwwroot/index.html` (WebAssembly) or `Pages/_Host.cshtml` (Server) ```html diff --git a/docs/introduce.en-US.md b/docs/introduce.en-US.md index 927d9213..2cbef0e3 100644 --- a/docs/introduce.en-US.md +++ b/docs/introduce.en-US.md @@ -68,16 +68,37 @@ Regularly synchronize with Official Ant Design specifications, you can check the - Install [.NET Core SDK](https://dotnet.microsoft.com/download/dotnet-core/3.1) 3.1.300 or later -- Create Blazor WebAssembly Project +### Create a new project from the dotnet new template + +We have provided the `dotnet new` template to create a [Boilerplate](https://github.com/ant-design-blazor/ant-design-pro-blazor) project out of the box: + +- Install the template ```bash - $ dotnet new blazorwasm -o MyAntDesignApp + $ dotnet new --install AntDesign.Templates::0.1.0-* ``` +- Create the Boilerplate project with the template + + ```bash + $ dotnet new antdesign -o MyAntDesignApp + ``` + +Options for the template: + +| Options | Description | Type | Default | +| ---------------- | -------------------------------------------- | ------ | --------- | +| `-f` \| `--full` | If specified, generates all pages of ant design pro | bool | false | +| `-ho` \| `--host` | Specify the hosting model | 'wasm' \| 'server' \| 'hosted' |'wasm' | +| `--no-restore` | If specified, skips the automatic restore of the project on create | bool | false | + + + +### Import Ant Design Blazor into an existing project + - Go to the project folder of the application and install the Nuget package reference ```bash - $ cd MyAntDesignApp $ dotnet add package AntDesign --version 0.1.0-* ``` @@ -87,7 +108,7 @@ Regularly synchronize with Official Ant Design specifications, you can check the services.AddAntDesign(); ``` -- Link the static files in `wwwroot/index.html` (WebAssembly) or `Pages/_Host.razor` (Server) +- Link the static files in `wwwroot/index.html` (WebAssembly) or `Pages/_Host.cshtml` (Server) ```html diff --git a/docs/introduce.zh-CN.md b/docs/introduce.zh-CN.md index c1fef7d1..c8bb386f 100644 --- a/docs/introduce.zh-CN.md +++ b/docs/introduce.zh-CN.md @@ -66,16 +66,35 @@ title: Ant Design of Blazor - 先安装 [.NET Core SDK](https://dotnet.microsoft.com/download/dotnet-core/3.1) 3.1.300 以上版本 -- 创建 Blazor WebAssembly 项目 +### 从模板创建一个新项目 +我们提供了 `dotnet new` 模板来创建一个开箱即用的 [Ant Design Pro](https://github.com/ant-design-blazor/ant-design-pro-blazor) 新项目: + +- 安装模板 + + ```bash + $ dotnet new --install AntDesign.Templates::0.1.0-* ``` - $ dotnet new blazorwasm -o MyAntDesignApp + +- 从模板创建 Ant Design Blazor Pro 项目 + + ```bash + $ dotnet new antdesign -o MyAntDesignApp ``` +模板的参数: + +| 参数 | 说明 | 类型 | 认 值 | +| ---------------- | -------------------------------------------- | ------------- | --------- | +| `-f` \| `--full` | 如果设置这个参数,会生成所有 Ant Design Pro 页面 | bool | false | +| `-ho` \| `--host` | 指定托管模型 | 'wasm' \| 'server' \| 'hosted' | 'wasm' | +| `--no-restore` | 如果设置这个参数,就不会自动恢复包引用 | bool | false | + +### 在已有项目中引入 Ant Design Blazor + - 进入应用的项目文件夹,安装 Nuget 包引用 ```bash - $ cd MyAntDesignApp $ dotnet add package AntDesign --version 0.1.0-* ``` @@ -85,7 +104,7 @@ title: Ant Design of Blazor services.AddAntDesign(); ``` -- 在 `wwwroot/index.html`(WebAssembly) 或 `Pages/_Host.razor`(Server) 中引入静态文件: +- 在 `wwwroot/index.html`(WebAssembly) 或 `Pages/_Host.cshtml`(Server) 中引入静态文件: ```