Skip to content

Commit 1b98914

Browse files
authored
docs: upgrade docusaurus (#121)
1 parent 614ebd6 commit 1b98914

7 files changed

Lines changed: 746 additions & 743 deletions

File tree

cmd/namespace.go

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77

88
"github.com/MakeNowJust/heredoc"
99
"github.com/odpf/salt/printer"
10+
"github.com/odpf/salt/term"
1011
stencilv1beta1 "github.com/odpf/stencil/server/odpf/stencil/v1beta1"
1112
"github.com/spf13/cobra"
1213
"google.golang.org/grpc"
@@ -17,12 +18,12 @@ func NamespaceCmd() *cobra.Command {
1718
Use: "namespace",
1819
Aliases: []string{"namespace"},
1920
Short: "Manage namespace",
20-
Long: "Work with namespaces",
21+
Long: "Work with namespaces.",
2122
Example: heredoc.Doc(`
2223
$ stencil namespace list
2324
$ stencil namespace create
24-
$ stencil namespace get
25-
$ stencil namespace update
25+
$ stencil namespace view
26+
$ stencil namespace edit
2627
$ stencil namespace delete
2728
`),
2829
Annotations: map[string]string{
@@ -55,6 +56,7 @@ func listNamespaceCmd() *cobra.Command {
5556
"group:core": "true",
5657
},
5758
RunE: func(cmd *cobra.Command, args []string) error {
59+
cs := term.NewColorScheme()
5860
s := printer.Spin("")
5961
defer s.Stop()
6062

@@ -75,14 +77,14 @@ func listNamespaceCmd() *cobra.Command {
7577

7678
s.Stop()
7779

78-
fmt.Printf(" \nShowing %d namespaces \n", len(namespaces))
80+
fmt.Printf(" \nShowing %[1]d of %[1]d namespaces \n \n", len(namespaces))
7981

80-
report = append(report, []string{"NAMESPACE"})
82+
report = append(report, []string{"INDEX", "NAMESPACE", "FORMAT", "COMPATIBILITY", "DESCRIPTION"})
83+
index := 1
8184

8285
for _, n := range namespaces {
83-
report = append(report, []string{
84-
n,
85-
})
86+
report = append(report, []string{cs.Greenf("#%02d", index), n, "-", "-", "-"})
87+
index++
8688
}
8789
printer.Table(os.Stdout, report)
8890
return nil
@@ -105,7 +107,7 @@ func createNamespaceCmd() *cobra.Command {
105107
Short: "Create a namespace",
106108
Args: cobra.ExactArgs(1),
107109
Example: heredoc.Doc(`
108-
$ stencil namespace create <namespace-id> --format=<schema-format> –-comp=<schema-compatibility> -desc=<description>
110+
$ stencil namespace create <namespace-id> --format=<schema-format> --comp=<schema-compatibility> --desc=<description>
109111
`),
110112
Annotations: map[string]string{
111113
"group:core": "true",
@@ -137,7 +139,7 @@ func createNamespaceCmd() *cobra.Command {
137139

138140
spinner.Stop()
139141

140-
fmt.Printf("namespace successfully created with id: %s", namespace.GetId())
142+
fmt.Printf("Namespace successfully created with id: %s", namespace.GetId())
141143
return nil
142144
},
143145
}
@@ -162,11 +164,11 @@ func updateNamespaceCmd() *cobra.Command {
162164
var req stencilv1beta1.UpdateNamespaceRequest
163165

164166
cmd := &cobra.Command{
165-
Use: "update",
166-
Short: "Update a namespace",
167+
Use: "edit",
168+
Short: "Edit a namespace",
167169
Args: cobra.ExactArgs(1),
168170
Example: heredoc.Doc(`
169-
$ stencil namespace update <namespace-id> –-format=<schema-format> –-comp=<schema-compatibility> -desc=<description>
171+
$ stencil namespace edit <namespace-id> --format=<schema-format> --comp=<schema-compatibility> --desc=<description>
170172
`),
171173
Annotations: map[string]string{
172174
"group:core": "true",
@@ -196,7 +198,7 @@ func updateNamespaceCmd() *cobra.Command {
196198

197199
spinner.Stop()
198200

199-
fmt.Printf("namespace successfully updated")
201+
fmt.Printf("Namespace successfully updated")
200202
return nil
201203
},
202204
}
@@ -221,11 +223,11 @@ func getNamespaceCmd() *cobra.Command {
221223
var req stencilv1beta1.GetNamespaceRequest
222224

223225
cmd := &cobra.Command{
224-
Use: "get",
226+
Use: "view",
225227
Short: "View a namespace",
226228
Args: cobra.ExactArgs(1),
227229
Example: heredoc.Doc(`
228-
$ stencil namespace get <namespace-id>
230+
$ stencil namespace view <namespace-id>
229231
`),
230232
Annotations: map[string]string{
231233
"group:core": "true",
@@ -310,7 +312,7 @@ func deleteNamespaceCmd() *cobra.Command {
310312

311313
spinner.Stop()
312314

313-
fmt.Printf("namespace successfully deleted")
315+
fmt.Printf("Namespace successfully deleted")
314316

315317
return nil
316318
},

cmd/schema.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ func SchemaCmd() *cobra.Command {
3939
Example: heredoc.Doc(`
4040
$ stencil schema list
4141
$ stencil schema create
42-
$ stencil schema get
43-
$ stencil schema update
42+
$ stencil schema view
43+
$ stencil schema edit
4444
$ stencil schema delete
4545
$ stencil schema version
4646
$ stencil schema graph
@@ -202,11 +202,11 @@ func updateSchemaCmd() *cobra.Command {
202202
var req stencilv1beta1.UpdateSchemaMetadataRequest
203203

204204
cmd := &cobra.Command{
205-
Use: "update",
205+
Use: "edit",
206206
Short: "Edit a schema",
207207
Args: cobra.ExactArgs(1),
208208
Example: heredoc.Doc(`
209-
$ stencil schema update <schema-id> --namespace=<namespace-id> -comp=<schema-compatibility>
209+
$ stencil schema edit <schema-id> --namespace=<namespace-id> --comp=<schema-compatibility>
210210
`),
211211
Annotations: map[string]string{
212212
"group:core": "true",
@@ -260,11 +260,11 @@ func getSchemaCmd() *cobra.Command {
260260
var resMetadata *stencilv1beta1.GetSchemaMetadataResponse
261261

262262
cmd := &cobra.Command{
263-
Use: "get",
263+
Use: "view",
264264
Short: "View a schema",
265265
Args: cobra.ExactArgs(1),
266266
Example: heredoc.Doc(`
267-
$ stencil schema get <schema-id> --namespace=<namespace-id> --version <version> --metadata <metadata>
267+
$ stencil schema view <schema-id> --namespace=<namespace-id> --version <version> --metadata <metadata>
268268
`),
269269
Annotations: map[string]string{
270270
"group:core": "true",

cmd/search.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func SearchCmd() *cobra.Command {
2121
var req stencilv1beta1.SearchRequest
2222

2323
cmd := &cobra.Command{
24-
Use: "search",
24+
Use: "search <query>",
2525
Aliases: []string{"search"},
2626
Short: "Search",
2727
Long: "Search your queries on schemas",

docs/docs/guides/1_quickstart.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ $ echo "{
122122

123123
```bash
124124
# Create namespace named "quickstart" with backward compatibility enabled
125-
$ stencil namespace create -c COMPATIBILITY_BACKWARD -f FORMAT_PROTOBUF -d "For quickstart guide" --host http://localhost:8000
125+
$ stencil namespace create quickstart -c COMPATIBILITY_BACKWARD -f FORMAT_PROTOBUF -d "For quickstart guide" --host http://localhost:8000
126126

127127
# List namespaces
128128
$ stencil namespace list

docs/docusaurus.config.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@ const darkCodeTheme = require('prism-react-renderer/themes/dracula');
4747
colorMode: {
4848
defaultMode: 'light',
4949
respectPrefersColorScheme: true,
50-
switchConfig: {
51-
darkIcon: '☾',
52-
lightIcon: '☀️',
53-
},
5450
},
5551
navbar: {
5652
title: 'Stencil',

docs/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
"write-heading-ids": "docusaurus write-heading-ids"
1515
},
1616
"dependencies": {
17-
"@docusaurus/core": "^0.0.0-4608",
18-
"@docusaurus/plugin-google-gtag": "^2.0.0-beta.6",
19-
"@docusaurus/preset-classic": "^0.0.0-4608",
17+
"@docusaurus/core": "^2.0.0-beta.17",
18+
"@docusaurus/plugin-google-gtag": "^2.0.0-beta.17",
19+
"@docusaurus/preset-classic": "^2.0.0-beta.17",
2020
"@mdx-js/react": "^1.6.21",
2121
"@svgr/webpack": "^6.0.0",
2222
"classnames": "^2.3.1",

0 commit comments

Comments
 (0)