From 974036e5a00802801068888fde125e6041ccdb88 Mon Sep 17 00:00:00 2001 From: facundoolano Date: Thu, 15 Feb 2024 18:38:09 -0300 Subject: [PATCH] tweak org heading levels --- templates/templates.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/templates/templates.go b/templates/templates.go index b47c3c8..44fed9f 100644 --- a/templates/templates.go +++ b/templates/templates.go @@ -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 }