Documentation
¶
Index ¶
- Variables
- func AttachmentFilenamesFromStorage(storage string) []string
- func ConvertMarkdownToStorage(markdown string) (string, error)
- func FormatMarkdownFile(frontmatter Frontmatter, body string) []byte
- func SyncAttachmentsFromStorage(ctx context.Context, client Client, pageID string, markdownPath string, ...) error
- func WarmUpMermaidRenderer(ctx context.Context)
- type Client
- type Frontmatter
- type MermaidResult
- type Page
- type RenderResult
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("not found")
ErrNotFound indicates that the requested Confluence resource does not exist.
Functions ¶
func AttachmentFilenamesFromStorage ¶
AttachmentFilenamesFromStorage extracts referenced attachment filenames in appearance order.
func ConvertMarkdownToStorage ¶
ConvertMarkdownToStorage converts the supported markdown subset to Confluence storage format.
func FormatMarkdownFile ¶
func FormatMarkdownFile(frontmatter Frontmatter, body string) []byte
FormatMarkdownFile renders a markdown file with the required frontmatter.
func SyncAttachmentsFromStorage ¶
func SyncAttachmentsFromStorage(ctx context.Context, client Client, pageID string, markdownPath string, storage string, attachmentSources map[string]string, generatedMermaid map[string]string) error
SyncAttachmentsFromStorage uploads all referenced attachments before page body update.
func WarmUpMermaidRenderer ¶
WarmUpMermaidRenderer primes mmdc once to reduce first render latency in watch mode.
Types ¶
type Client ¶
type Client interface {
SiteBaseURL() string
ResolveSpaceIDByKey(ctx context.Context, spaceKey string) (string, error)
ResolveSpaceRootPage(ctx context.Context, spaceID string) (string, error)
CreatePage(ctx context.Context, spaceID string, parentID string, title string, body string, draft bool) (Page, error)
UpdatePage(ctx context.Context, pageID string, title string, body string, draft bool) (Page, error)
PutAttachment(ctx context.Context, pageID string, filePath string) error
DeleteAttachment(ctx context.Context, pageID string, filename string) error
}
Client defines the Confluence operations required by the page commands.
type Frontmatter ¶
Frontmatter is the required metadata stored in local markdown files.
func ParseMarkdownFile ¶
func ParseMarkdownFile(data []byte) (Frontmatter, string, error)
ParseMarkdownFile parses and validates the required YAML frontmatter.
type MermaidResult ¶ added in v0.3.0
MermaidResult contains mermaid rendering output and generated attachment files.
func ConvertMarkdownToStorageWithMermaid ¶
func ConvertMarkdownToStorageWithMermaid(ctx context.Context, markdownPath string, markdown string) (MermaidResult, error)
ConvertMarkdownToStorageWithMermaid converts markdown to storage format and turns mermaid fenced blocks into attachment image macros.
type RenderResult ¶ added in v0.4.0
type RenderResult struct {
Storage string
AttachmentSources map[string]string
Warnings []string
Generated map[string]string
SaveCache func() error
}
RenderResult is the page-sync preparation output used by the CLI.
func RenderMarkdownForSync ¶ added in v0.4.0
func RenderMarkdownForSync(ctx context.Context, markdownPath string, markdown string, siteBaseURL string) (RenderResult, error)
RenderMarkdownForSync prepares markdown for page sync by resolving relative references first and then rendering any mermaid blocks.