tweak org heading levels

This commit is contained in:
facundoolano 2024-02-15 18:38:09 -03:00
parent 6cc4077816
commit 974036e5a0

View file

@ -107,7 +107,12 @@ func (templ Template) Render(context map[string]interface{}) ([]byte, error) {
if ext == ".org" {
// org-mode rendering
doc := org.New().Parse(bytes.NewReader(content), templ.SrcPath)
contentStr, err := doc.Write(org.NewHTMLWriter())
htmlWriter := org.NewHTMLWriter()
// make * -> h1, ** -> h2, etc
htmlWriter.TopLevelHLevel = 1
contentStr, err := doc.Write(htmlWriter)
if err != nil {
return nil, err
}