init
This commit is contained in:
commit
fa6a4c650f
93 files changed
+6555
No files matched your search
@@ -0,0 +1,43 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"html/template"
|
||||
|
||||
"pageswiki/internal/render"
|
||||
"pageswiki/internal/store"
|
||||
)
|
||||
|
||||
type Breadcrumb struct {
|
||||
Name string
|
||||
Path string
|
||||
}
|
||||
|
||||
type PageView struct {
|
||||
Path string
|
||||
Body string
|
||||
HTML template.HTML
|
||||
Tags []string
|
||||
Breadcrumbs []Breadcrumb
|
||||
}
|
||||
|
||||
type PageService struct {
|
||||
Store *store.Store
|
||||
}
|
||||
|
||||
func NewPageService(
|
||||
st *store.Store,
|
||||
) *PageService {
|
||||
|
||||
return &PageService{
|
||||
Store: st,
|
||||
}
|
||||
}
|
||||
|
||||
func (s *PageService) RenderHTML(
|
||||
markdown string,
|
||||
) template.HTML {
|
||||
|
||||
return render.SafeHTML(
|
||||
render.Markdown(markdown),
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user