ref(file_handling): consolidate modules related to file content manipulation

This commit is contained in:
Kristian Borgwarth 2026-04-06 22:41:46 +02:00
parent 716a541005
commit 6fb27781f9
7 changed files with 8 additions and 10 deletions

View file

@ -0,0 +1,2 @@
// Package filehandling provides utilities for handling files, including reading, writing, and manipulating file contents.
package filehandling

View file

@ -1,4 +1,4 @@
package frontmatter
package filehandling
import (
"bytes"

View file

@ -1,4 +1,4 @@
package frontmatter
package filehandling
import (
"bytes"

View file

@ -1,4 +1,4 @@
package template
package filehandling
import (
"os"

View file

@ -1,2 +0,0 @@
// Package frontmatter contains utilities for parsing front matter from documents.
package frontmatter

View file

@ -5,7 +5,7 @@ import (
"encoding/json"
"path/filepath"
"github.com/KristianJBorgwarth/dendrite.daemon/core/frontmatter"
filehandling "github.com/KristianJBorgwarth/dendrite.daemon/core/file_handling"
"github.com/KristianJBorgwarth/dendrite.daemon/core/models"
"github.com/KristianJBorgwarth/dendrite.daemon/core/template"
"github.com/KristianJBorgwarth/dendrite.daemon/core/utils"
@ -34,7 +34,7 @@ func (h *CreateNoteHandler) Handle(ctx context.Context, raw json.RawMessage) (an
return nil, err
}
slug := frontmatter.Slugify(cmd.Title)
slug := filehandling.Slugify(cmd.Title)
var templatePath string
if cmd.TemplateName != "" {
@ -48,7 +48,7 @@ func (h *CreateNoteHandler) Handle(ctx context.Context, raw json.RawMessage) (an
return nil, err
}
tags, err := frontmatter.ParseTags(data)
tags, err := filehandling.ParseTags(data)
if err != nil {
return nil, err
}

View file

@ -1,2 +0,0 @@
// Package template provides implementations for generating notes from templates
package template