Merge pull request #896 from urfave/versioned-docs

Setup basic versioned docs
This commit is contained in:
lynn [they] 2019-10-23 21:26:01 -07:00 committed by GitHub
commit 850de854cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 1507 additions and 1520 deletions

View File

@ -28,8 +28,8 @@ before_script:
script: script:
- go run build.go vet - go run build.go vet
- go run build.go test - go run build.go test
- go run build.go gfmrun - go run build.go gfmrun docs/v1/manual.md
- go run build.go toc - go run build.go toc docs/v1/manual.md
after_success: after_success:
- bash <(curl -s https://codecov.io/bash) - bash <(curl -s https://codecov.io/bash)

1527
README.md

File diff suppressed because it is too large Load Diff

View File

@ -25,4 +25,4 @@ install:
build_script: build_script:
- go run build.go vet - go run build.go vet
- go run build.go test - go run build.go test
- go run build.go gfmrun - go run build.go gfmrun docs/v1/manual.md

View File

@ -127,8 +127,13 @@ func testCleanup() error {
return nil return nil
} }
func GfmrunActionFunc(_ *cli.Context) error { func GfmrunActionFunc(c *cli.Context) error {
file, err := os.Open("README.md") filename := c.Args().Get(0)
if filename == "" {
filename = "README.md"
}
file, err := os.Open(filename)
if err != nil { if err != nil {
return err return err
} }
@ -146,11 +151,16 @@ func GfmrunActionFunc(_ *cli.Context) error {
return err return err
} }
return runCmd("gfmrun", "-c", fmt.Sprint(counter), "-s", "README.md") return runCmd("gfmrun", "-c", fmt.Sprint(counter), "-s", filename)
} }
func TocActionFunc(_ *cli.Context) error { func TocActionFunc(c *cli.Context) error {
err := runCmd("node_modules/.bin/markdown-toc", "-i", "README.md") filename := c.Args().Get(0)
if filename == "" {
filename = "README.md"
}
err := runCmd("node_modules/.bin/markdown-toc", "-i", filename)
if err != nil { if err != nil {
return err return err
} }

1478
docs/v1/manual.md Normal file

File diff suppressed because it is too large Load Diff

0
docs/v2/.keep Normal file
View File