Skip to content

Commit

Permalink
helpers: Add smarter check for asciidoctor
Browse files Browse the repository at this point in the history
  • Loading branch information
miltador committed Jul 18, 2017
1 parent 6ceb0b4 commit 967151b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions helpers/content.go
Original file line number Diff line number Diff line change
Expand Up @@ -588,12 +588,13 @@ func getAsciidocContent(ctx *RenderingContext) []byte {
}

jww.INFO.Println("Rendering", ctx.DocumentName, "with", path, "...")
cmd := exec.Command(path, "--no-header-footer", "--safe")
args := []string{"--no-header-footer", "--safe"}
if isAsciidoctor {
// asciidoctor-specific arg to show stack traces on errors
cmd.Args = append(cmd.Args, "--trace")
args = append(args, "--trace")
}
cmd.Args = append(cmd.Args, "-")
args = append(args, "-")
cmd := exec.Command(path, args...)
cmd.Stdin = bytes.NewReader(cleanContent)
var out, cmderr bytes.Buffer
cmd.Stdout = &out
Expand Down Expand Up @@ -692,7 +693,7 @@ func getRstContent(ctx *RenderingContext) []byte {
}
}

return result[bodyStart+7: bodyEnd]
return result[bodyStart+7 : bodyEnd]
}

func orgRender(ctx *RenderingContext, c ContentSpec) []byte {
Expand Down

0 comments on commit 967151b

Please sign in to comment.