helpers: add --initial-header-level=2 to rst2html (#3528)
authorFrank Braun <frank@cryptogroup.net>
Tue, 27 Jun 2017 10:26:33 +0000 (10:26 +0000)
committerAnthony Fok <foka@debian.org>
Tue, 27 Jun 2017 10:26:33 +0000 (04:26 -0600)
reStructuredText doesn't have explicit section levels but sets them in
the order of appearance. Since level 1 is already set from the title in
the front matter it makes more sense to start with level 2 when
converting with rst2html.

helpers/content.go

index bb547de25f2d2068b9f6670408a19144fa7cbd49..4a96c50141af402223a3cf4713d0ccb168fd6343 100644 (file)
@@ -637,7 +637,7 @@ func getRstContent(ctx *RenderingContext) []byte {
        }
 
        jww.INFO.Println("Rendering", ctx.DocumentName, "with", path, "...")
-       cmd := exec.Command(python, path, "--leave-comments")
+       cmd := exec.Command(python, path, "--leave-comments", "--initial-header-level=2")
        cmd.Stdin = bytes.NewReader(cleanContent)
        var out, cmderr bytes.Buffer
        cmd.Stdout = &out