From f60d0618e678f287b8e0262b34ee6250b3d09098 Mon Sep 17 00:00:00 2001 From: Bel LaPointe Date: Mon, 28 Sep 2020 09:39:42 -0600 Subject: [PATCH] notes on ro dont have comments --- notes/file.go | 2 +- notes/notes.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/notes/file.go b/notes/file.go index 23d8971..c75b2b8 100755 --- a/notes/file.go +++ b/notes/file.go @@ -115,7 +115,7 @@ func (n *Notes) commentFormer(urlPath string, md []byte) html.RenderNodeFunc { } } return func(w io.Writer, node ast.Node, entering bool) (ast.WalkStatus, bool) { - if heading, ok := node.(*ast.Heading); ok && !entering { + if heading, ok := node.(*ast.Heading); !n.ro && ok && !entering { nextHeader() fmt.Fprintf(w, `
diff --git a/notes/notes.go b/notes/notes.go index 7a676ab..ccc144d 100755 --- a/notes/notes.go +++ b/notes/notes.go @@ -4,10 +4,12 @@ import "local/notes-server/config" type Notes struct { root string + ro bool } func New() *Notes { return &Notes{ root: config.Root, + ro: config.ReadOnly, } }