From aac4b9eaf389d203582a70fe2aad3ca7c1b2c688 Mon Sep 17 00:00:00 2001 From: Elad Kaplan Date: Mon, 14 Oct 2024 14:53:49 +0300 Subject: [PATCH] docs: adding --api docs: adding --api --- docs-site/content/blog/axum-session.md | 4 ++-- docs-site/content/docs/getting-started/guide.md | 6 +++--- docs-site/content/docs/getting-started/tour/index.md | 4 ++-- docs-site/content/docs/the-app/your-project.md | 2 +- snipdoc.yml | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs-site/content/blog/axum-session.md b/docs-site/content/blog/axum-session.md index 4a1f2d337..7054dcb05 100644 --- a/docs-site/content/blog/axum-session.md +++ b/docs-site/content/blog/axum-session.md @@ -64,7 +64,7 @@ impl Hooks for App { Now, you can create your controller that uses Axum session. Use the `cargo loco generate controller` command: ```sh -❯ cargo loco generate controller mysession -k api +❯ cargo loco generate controller mysession --api Finished dev [unoptimized + debuginfo] target(s) in 0.36s Running `target/debug/axum-session-cli generate controller mysession` added: "src/controllers/mysession.rs" @@ -166,7 +166,7 @@ impl Hooks for App { Create the controller as before using `cargo loco generate controller` ```sh -❯ cargo loco generate controller mysession -k api +❯ cargo loco generate controller mysession --api Finished dev [unoptimized + debuginfo] target(s) in 0.36s Running `target/debug/axum-session-cli generate controller mysession` added: "src/controllers/mysession.rs" diff --git a/docs-site/content/docs/getting-started/guide.md b/docs-site/content/docs/getting-started/guide.md index bab682fa8..e47146f38 100644 --- a/docs-site/content/docs/getting-started/guide.md +++ b/docs-site/content/docs/getting-started/guide.md @@ -139,7 +139,7 @@ The built in _health route will tell you that you have configured y Let's add a quick _hello_ response to our service. ```sh -$ cargo loco generate controller guide -k api +$ cargo loco generate controller guide --api added: "src/controllers/guide.rs" injected: "src/controllers/mod.rs" injected: "src/app.rs" @@ -465,7 +465,7 @@ $ cargo playground We're now ready to plug this into an `articles` controller. First, generate a new controller: ```sh -$ cargo loco generate controller articles -k api +$ cargo loco generate controller articles --api added: "src/controllers/articles.rs" injected: "src/controllers/mod.rs" injected: "src/app.rs" @@ -630,7 +630,7 @@ Let's add another model, this time: `Comment`. We want to create a relation - a Instead of coding the model and controller by hand, we're going to create a **comment scaffold** which will generate a fully working CRUD API comments. We're also going to use the special `references` type: ```sh -$ cargo loco generate scaffold comment content:text article:references -k api +$ cargo loco generate scaffold comment content:text article:references --api ``` If you peek into the new migration, you'll discover a new database relation in the articles table: diff --git a/docs-site/content/docs/getting-started/tour/index.md b/docs-site/content/docs/getting-started/tour/index.md index 924580b12..32cfc2066 100644 --- a/docs-site/content/docs/getting-started/tour/index.md +++ b/docs-site/content/docs/getting-started/tour/index.md @@ -98,7 +98,7 @@ You can choose between generating an `api`, `html` or `htmx` scaffold using the ```sh -$ cargo loco generate scaffold post title:string content:text -k api +$ cargo loco generate scaffold post title:string content:text --api : : @@ -168,7 +168,7 @@ For those counting -- the commands for creating a blog backend were: 1. `cargo install loco-cli` 2. `cargo install sea-orm-cli` 3. `loco new` -4. `cargo loco generate scaffold post title:string content:text -k api` +4. `cargo loco generate scaffold post title:string content:text --api` Done! enjoy your ride with `loco` 🚂 diff --git a/docs-site/content/docs/the-app/your-project.md b/docs-site/content/docs/the-app/your-project.md index cbe31b993..22f8082cc 100644 --- a/docs-site/content/docs/the-app/your-project.md +++ b/docs-site/content/docs/the-app/your-project.md @@ -156,7 +156,7 @@ Options: You can begin by generating a scaffold for the Post resource, which will represent a single blog posting. To accomplish this, open your terminal and enter the following command: ```sh -cargo loco generate scaffold posts name:string title:string content:text +cargo loco generate scaffold posts name:string title:string content:text --api ``` diff --git a/snipdoc.yml b/snipdoc.yml index 010dc5f2d..dbe9c2ff1 100644 --- a/snipdoc.yml +++ b/snipdoc.yml @@ -94,7 +94,7 @@ snippets: path: ./snipdoc.yml scaffold-post-command: content: cargo loco generate scaffold posts - name:string title:string content:text + name:string title:string content:text --api path: ./snipdoc.yml generate-task-help-command: content: cd ./examples/demo && cargo loco generate task --help