Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExtractedData ¶
type ExtractedData struct {
Tags []string
Property *storepb.MemoPayload_Property
}
ExtractedData contains all metadata extracted from markdown in a single pass.
type Service ¶
type Service interface {
// ExtractAll extracts tags, properties, and references in a single parse (most efficient)
ExtractAll(content []byte) (*ExtractedData, error)
// ExtractTags returns all #tags found in content
ExtractTags(content []byte) ([]string, error)
// ExtractProperties computes boolean properties
ExtractProperties(content []byte) (*storepb.MemoPayload_Property, error)
// RenderMarkdown renders goldmark AST back to markdown text
RenderMarkdown(content []byte) (string, error)
// RenderHTML renders markdown content to HTML
RenderHTML(content []byte) (string, error)
// GenerateSnippet creates plain text summary
GenerateSnippet(content []byte, maxLength int) (string, error)
// ValidateContent checks for syntax errors
ValidateContent(content []byte) error
// RenameTag renames all occurrences of oldTag to newTag in content
RenameTag(content []byte, oldTag, newTag string) (string, error)
}
Service handles markdown metadata extraction. It uses goldmark to parse markdown and extract tags, properties, and snippets. HTML rendering is primarily done on frontend using markdown-it, but backend provides RenderHTML for RSS feeds and other server-side rendering needs.
func NewService ¶
NewService creates a new markdown service with the given options.
Click to show internal directories.
Click to hide internal directories.