Skip to content

Commit d20794e

Browse files
authored
chore: Remove outdated local CLI documentation (#1272)
Reference: https://linear.app/speakeasy/issue/GEN-1020/bug-generating-broken-links-in-the-cli-reference Reference: https://www.speakeasy.com/docs/speakeasy-reference/cli/getting-started This change removes the outdated local CLI documentation in the `docs/` directory and updates the documentation generation script to remove that now extraneous logic. This also removes the unused Docusaurus positioning. The CLI documentation will remain and still be updated on the Speakeasy website.
1 parent 9f501ae commit d20794e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+61
-1907
lines changed

.github/workflows/documentation.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,10 @@ jobs:
4040
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
4141
with:
4242
go-version-file: "speakeasy/go.mod"
43-
- name: Generate speakeasy cli docs
44-
working-directory: speakeasy
45-
run: |
46-
go run cmd/docs/main.go
4743
- name: Generate speakeasy-registry doc-site docs
4844
working-directory: speakeasy
4945
run: |
50-
go run cmd/docs/main.go -out-dir ../speakeasy-registry/web/packages/marketing-site/src/pages/docs/speakeasy-reference/cli -doc-site
46+
go run cmd/docs/main.go -out-dir ../speakeasy-registry/web/packages/marketing-site/src/pages/docs/speakeasy-reference/cli
5147
- name: Create PR against speakeasy-registry
5248
uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # v7.0.6
5349
with:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
dist/
2+
/docs/
23
bin/
34
.idea/
45
*.iml

README.md

Lines changed: 50 additions & 39 deletions
Large diffs are not rendered by default.

cmd/docs/main.go

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@ package main
22

33
import (
44
"flag"
5-
"fmt"
65
"log"
76
"os"
87
"path/filepath"
98
"regexp"
109
"slices"
11-
"strings"
1210

1311
"github.com/speakeasy-api/speakeasy/cmd"
1412
"github.com/speakeasy-api/speakeasy/internal/docs"
@@ -18,7 +16,6 @@ var linkRegex = regexp.MustCompile(`\((.*?\.md)\)`)
1816

1917
func main() {
2018
outDir := flag.String("out-dir", "./docs", "The directory to output the docs to")
21-
docSite := flag.Bool("doc-site", false, "Whether to generate docs for the doc site")
2219
flag.Parse()
2320

2421
cmd.Init("", "")
@@ -36,34 +33,7 @@ func main() {
3633
log.Fatal(err)
3734
}
3835

39-
if err := docs.GenerateDocs(root, *outDir, *docSite); err != nil {
40-
log.Fatal(err)
41-
}
42-
43-
if *docSite {
44-
return
45-
}
46-
47-
readmeData, err := os.ReadFile("./README.md")
48-
if err != nil {
49-
log.Fatal(err)
50-
}
51-
52-
readme, _, _ := strings.Cut(string(readmeData), "## CLI")
53-
54-
speakeasyData, err := os.ReadFile("./docs/README.md")
55-
if err != nil {
56-
log.Fatal(err)
57-
}
58-
59-
speakeasyDoc := linkRegex.ReplaceAllStringFunc(string(speakeasyData), func(match string) string {
60-
return fmt.Sprintf("(docs/%s)", strings.Trim(match, "()"))
61-
})
62-
63-
speakeasyDoc = strings.ReplaceAll(speakeasyDoc, "## ", "### ")
64-
speakeasyDoc = strings.Replace(speakeasyDoc, "# speakeasy", "## CLI", 1)
65-
66-
if err := os.WriteFile("./README.md", []byte(fmt.Sprintf("%s%s", readme, speakeasyDoc)), 0o644); err != nil {
36+
if err := docs.GenerateDocs(root, *outDir); err != nil {
6737
log.Fatal(err)
6838
}
6939
}

docs/README.md

Lines changed: 0 additions & 59 deletions
This file was deleted.

docs/ask.md

Lines changed: 0 additions & 32 deletions
This file was deleted.

docs/auth/README.md

Lines changed: 0 additions & 36 deletions
This file was deleted.

docs/auth/login.md

Lines changed: 0 additions & 31 deletions
This file was deleted.

docs/auth/logout.md

Lines changed: 0 additions & 31 deletions
This file was deleted.

docs/auth/switch.md

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)