Merge pull request #896 from urfave/versioned-docs
Setup basic versioned docs
This commit is contained in:
commit
850de854cd
@ -28,8 +28,8 @@ before_script:
|
||||
script:
|
||||
- go run build.go vet
|
||||
- go run build.go test
|
||||
- go run build.go gfmrun
|
||||
- go run build.go toc
|
||||
- go run build.go gfmrun docs/v1/manual.md
|
||||
- go run build.go toc docs/v1/manual.md
|
||||
|
||||
after_success:
|
||||
- bash <(curl -s https://codecov.io/bash)
|
||||
|
@ -25,4 +25,4 @@ install:
|
||||
build_script:
|
||||
- go run build.go vet
|
||||
- go run build.go test
|
||||
- go run build.go gfmrun
|
||||
- go run build.go gfmrun docs/v1/manual.md
|
||||
|
20
build.go
20
build.go
@ -127,8 +127,13 @@ func testCleanup() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func GfmrunActionFunc(_ *cli.Context) error {
|
||||
file, err := os.Open("README.md")
|
||||
func GfmrunActionFunc(c *cli.Context) error {
|
||||
filename := c.Args().Get(0)
|
||||
if filename == "" {
|
||||
filename = "README.md"
|
||||
}
|
||||
|
||||
file, err := os.Open(filename)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -146,11 +151,16 @@ func GfmrunActionFunc(_ *cli.Context) error {
|
||||
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 {
|
||||
err := runCmd("node_modules/.bin/markdown-toc", "-i", "README.md")
|
||||
func TocActionFunc(c *cli.Context) error {
|
||||
filename := c.Args().Get(0)
|
||||
if filename == "" {
|
||||
filename = "README.md"
|
||||
}
|
||||
|
||||
err := runCmd("node_modules/.bin/markdown-toc", "-i", filename)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
1478
docs/v1/manual.md
Normal file
1478
docs/v1/manual.md
Normal file
File diff suppressed because it is too large
Load Diff
0
docs/v2/.keep
Normal file
0
docs/v2/.keep
Normal file
Loading…
Reference in New Issue
Block a user