ref(file_handling): consolidate modules related to file content manipulation
This commit is contained in:
parent
716a541005
commit
6fb27781f9
7 changed files with 8 additions and 10 deletions
2
core/file_handling/doc.go
Normal file
2
core/file_handling/doc.go
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
// Package filehandling provides utilities for handling files, including reading, writing, and manipulating file contents.
|
||||
package filehandling
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package frontmatter
|
||||
package filehandling
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package frontmatter
|
||||
package filehandling
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package template
|
||||
package filehandling
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
// Package frontmatter contains utilities for parsing front matter from documents.
|
||||
package frontmatter
|
||||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,2 +0,0 @@
|
|||
// Package template provides implementations for generating notes from templates
|
||||
package template
|
||||
Loading…
Add table
Reference in a new issue