Skip to content

Commit 094fa9e

Browse files
Jerónimo AlbiAlex Johnson
andauthored
docs: change knowledge base and CLI docs to scaffold using single names (#2752)
* docs: change CLI docs to use single names * fix: guides to use single names * docs: change knowledge base docs to use single names * review: fix code blocks and change syntax tags to be consistent * feat: add support for proto buffers and go module syntax * fix: replace "proto" by the "protobuf" tag in code block Co-authored-by: Alex Johnson <alex@shmeeload.xyz>
1 parent 693bf79 commit 094fa9e

30 files changed

+162
-146
lines changed

docs/docs/07-cli.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ test, build, and launch your blockchain.
1818

1919
To get started, create a blockchain:
2020

21-
ignite scaffold chain github.com/username/mars
21+
```
22+
ignite scaffold chain mars
23+
```
2224

2325
**Options**
2426

@@ -678,14 +680,16 @@ Create a new application-specific Cosmos SDK blockchain.
678680

679681
For example, the following command will create a blockchain called "hello" in the "hello/" directory:
680682

681-
ignite scaffold chain hello
683+
```bash
684+
ignite scaffold chain hello
685+
```
682686

683687
A project name can be a simple name or a URL. The name will be used as the Go module path for the project. Examples of project names:
684688

685-
ignite scaffold chain foo
686-
ignite scaffold chain foo/bar
687-
ignite scaffold chain example.org/foo
688-
ignite scaffold chain github.com/username/foo
689+
- ignite scaffold chain foo
690+
- ignite scaffold chain foo/bar
691+
- ignite scaffold chain example.org/foo
692+
- ignite scaffold chain github.com/username/foo
689693

690694
A new directory with source code files will be created in the current directory. To use a different path use the "--path" flag.
691695

docs/docs/contributing/02-technical-setup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ The Z shell, also known as zsh, is a UNIX shell that is built on top of the macO
4949

5050
1. Edit your `~/.zshrc` file to add the plugins to load on startup:
5151

52-
```sh
52+
```
5353
plugins=(
5454
git
5555
zsh-autosuggestions

docs/docs/contributing/templates/01-concept_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ This is `inline code`. Use it for referencing package names and commands.
9494
9595
Here's a command someone types on a command line:
9696
97-
```command
97+
```bash
9898
which go
9999
```
100100

docs/docs/contributing/templates/02-tutorial-template.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,13 @@ Finally...
8282

8383
To verify the version of Ignite CLI that is installed, run the following command:
8484

85-
```sh
85+
```bash
8686
ignite --version
8787
```
8888

8989
You'll see release details like the following output:
9090

91-
```bash
91+
```
9292
Ignite version: v0.19.6
9393
Ignite CLI build date: 2021-12-18T05:56:36Z
9494
Ignite CLI source hash: -
@@ -105,8 +105,8 @@ When showing the contents of a file, try to show only the relevant parts and exp
105105

106106
Modify the title by changing the contents of the `<title>` tag:
107107

108-
```js
109-
...
108+
```protobuf
109+
// ...
110110
111111
message Post {
112112
string creator = 1;
@@ -121,7 +121,7 @@ message MsgCreatePost {
121121
string body = 3;
122122
}
123123
124-
...
124+
// ...
125125
```
126126

127127
Now transition to the next step by telling the user what's next.
@@ -160,7 +160,7 @@ This is `inline code`. Use single tick marks for filenames and commands.
160160
161161
Here's a command you can type on a command line:
162162
163-
```sh
163+
```bash
164164
which go
165165
```
166166

docs/docs/guide/01-install.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Ignite CLI is written in the Go programming language. To use Ignite CLI on a loc
3030

3131
To verify the version of Ignite CLI you have installed, run the following command:
3232

33-
```sh
33+
```bash
3434
ignite version
3535
```
3636

docs/docs/guide/02-hello.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ git commit -am "Scaffolded a hello query with Ignite CLI"
154154

155155
In the `proto/hello/query.proto` file, the `Hello` rpc has been added to the `Query` service.
156156

157-
```proto
157+
```protobuf
158158
service Query {
159159
rpc Hello(QueryHelloRequest) returns (QueryHelloResponse) {
160160
option (google.api.http).get = "/hello/hello/hello";
@@ -173,7 +173,7 @@ Here's how the `Hello` rpc for the `Query` service works:
173173

174174
Now, take a look at the following request and response types:
175175

176-
```proto
176+
```protobuf
177177
message QueryHelloRequest {
178178
}
179179
@@ -239,10 +239,12 @@ Make the required changes to the `x/hello/module.go` file.
239239

240240
```go
241241
import (
242-
"encoding/json"
243-
"fmt"
244-
//...
242+
// ...
243+
245244
"context"
245+
246+
// ...
247+
)
246248
```
247249

248250
Do not save the file yet, you need to continue with these modifications.
@@ -259,7 +261,7 @@ Make the required changes to the `x/hello/module.go` file.
259261

260262
2. After the chain has been started, visit [http://localhost:1317/hello/hello/hello](http://localhost:1317/hello/hello/hello) and see your text displayed:
261263

262-
```go
264+
```json
263265
{
264266
"text": "Hello, Ignite CLI!",
265267
}

docs/docs/guide/03-blog/00-build-blog.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ The `message` command accepts message name (`createPost`) and a list of fields (
6868

6969
The `message` command has created and modified several files:
7070

71-
```bash
71+
```
7272
modify proto/blog/tx.proto
7373
modify x/blog/client/cli/tx.go
7474
create x/blog/client/cli/tx_create_post.go
@@ -85,7 +85,7 @@ create x/blog/types/message_create_post_test.go
8585

8686
As always, start with a proto file. Inside the `proto/blog/tx.proto` file, the `MsgCreatePost` message has been created. Edit the file to add the line that defines the `id` for `message MsgCreatePostResponse`:
8787

88-
```go
88+
```protobuf
8989
message MsgCreatePost {
9090
string creator = 1;
9191
string title = 2;
@@ -165,7 +165,7 @@ When you define the `Post` type in a proto file, Ignite CLI (with the help of `p
165165

166166
Create the `proto/blog/post.proto` file and define the `Post` message:
167167

168-
```go
168+
```protobuf
169169
syntax = "proto3";
170170
171171
package blog.blog;
@@ -202,7 +202,7 @@ Then, add these prefixes to the `x/blog/types/keys.go` file in the `const` and a
202202

203203
```go
204204
const (
205-
//...
205+
// ...
206206

207207
// Keep track of the index of posts
208208
PostKey = "Post-value-"
@@ -338,13 +338,13 @@ To define the types in proto files, make the following updates in `proto/blog/qu
338338

339339
1. Add the `import`:
340340

341-
```go
341+
```protobuf
342342
import "blog/post.proto";
343343
```
344344

345345
2. Add pagination to the post request:
346346

347-
```go
347+
```protobuf
348348
message QueryPostsRequest {
349349
// Adding pagination to request
350350
cosmos.base.query.v1beta1.PageRequest pagination = 1;
@@ -430,7 +430,7 @@ In the `x/blog/module.go` file:
430430
import (
431431
"context"
432432

433-
// ... other imports
433+
// ...
434434
)
435435
```
436436

@@ -469,7 +469,7 @@ blogd tx blog create-post foo bar --from alice
469469

470470
The transaction is output to the terminal. You are prompted to confirm the transaction:
471471

472-
```bash
472+
```
473473
{"body":{"messages":[{"@type":"/blog.blog.MsgCreatePost","creator":"blog1ctxp3pfdtr3sw9udz2ptuh59ce9z0eaa2zvv6w","title":"foo","body":"bar"}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""}},"signatures":[]}
474474
475475
confirm transaction before signing and broadcasting [y/N]: y
@@ -489,7 +489,7 @@ blogd q blog posts
489489

490490
The result:
491491

492-
```bash
492+
```yaml
493493
Post:
494494
- body: bar
495495
creator: blog1ctxp3pfdtr3sw9udz2ptuh59ce9z0eaa2zvv6w

0 commit comments

Comments
 (0)