wiki

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package wiki contains the shared Markdown/wiki parsing and normalization rules that define canonical Knowl workspace semantics.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IndexTargets

func IndexTargets(content string) ([]string, bool)

IndexTargets extracts both wiki links and bare list-item targets from index content.

func Links(from knowl.PageID, content string) []knowl.LinkReference

Links converts normalized page targets into unique wiki link references.

func MarkdownTargets

func MarkdownTargets(content string) ([]string, bool)

MarkdownTargets extracts normalized wiki-link targets from Markdown.

func NormalizePageTarget

func NormalizePageTarget(target string) string

NormalizePageTarget converts a wiki reference into a canonical page ID.

func PageIDFromPath

func PageIDFromPath(path string) (knowl.PageID, bool)

PageIDFromPath derives the canonical page ID from a wiki Markdown path.

func SourceRefs

func SourceRefs(content string) []string

SourceRefs returns a deterministic, deduplicated source-ref list.

Types

type Frontmatter

type Frontmatter struct {
	ID         string   `yaml:"id"`
	Title      string   `yaml:"title"`
	Type       string   `yaml:"type"`
	SourceRefs []string `yaml:"source_refs"`
}

Frontmatter is the bounded YAML metadata recognized on ordinary pages.

func ParseFrontmatter

func ParseFrontmatter(content string) (Frontmatter, error)

ParseFrontmatter reads and trims the leading YAML frontmatter block.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL