Documentation
¶
Index ¶
- func ExtractNotionUUID(s string) (string, bool)
- func GetClient() (*mcp.Client, error)
- func IsEmoji(r rune) bool
- func LooksLikeID(s string) bool
- func RequireClient() (*mcp.Client, error)
- func RequireOfficialAPIClient(overrides config.APIOverrides) (*api.Client, error)
- func ResolveDatabaseID(ctx context.Context, client *mcp.Client, input string) (string, error)
- func ResolvePageID(ctx context.Context, client *mcp.Client, input string) (string, error)
- func SetAccessToken(token string)
- func SetFrontmatterID(content string, notionID string) string
- type Frontmatter
- type OfficialAPIConfig
- type PageRef
- type PageRefKind
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractNotionUUID ¶ added in v0.4.0
ExtractNotionUUID finds exactly 32 hex digits in a string and returns the canonical UUID format (8-4-4-4-12).
func LooksLikeID ¶ added in v0.3.0
LooksLikeID returns true if the string is a valid Notion UUID (32 or 36 hex chars).
func RequireClient ¶
func RequireOfficialAPIClient ¶ added in v0.6.0
func RequireOfficialAPIClient(overrides config.APIOverrides) (*api.Client, error)
func ResolveDatabaseID ¶ added in v0.5.0
ResolveDatabaseID resolves any database reference (URL, ID, or name) to a database ID. Like ResolvePageID but filters for databases/data sources.
func ResolvePageID ¶ added in v0.3.0
ResolvePageID resolves any page reference (URL, ID, or name) to a page ID. For URLs, it extracts the embedded UUID. For names, it searches and requires an exact unique match.
func SetAccessToken ¶
func SetAccessToken(token string)
func SetFrontmatterID ¶ added in v0.4.0
SetFrontmatterID returns the content with notion-id set in frontmatter. If frontmatter already exists, it updates or adds the notion-id field. If no frontmatter exists, it prepends a new frontmatter block.
Types ¶
type Frontmatter ¶ added in v0.4.0
type Frontmatter struct {
NotionID string
}
func ParseFrontmatter ¶ added in v0.4.0
func ParseFrontmatter(content string) (Frontmatter, string)
ParseFrontmatter extracts frontmatter and body from a markdown string. Returns the parsed frontmatter (if any) and the body without frontmatter.
type OfficialAPIConfig ¶ added in v0.6.0
type OfficialAPIConfig struct {
Config config.Config
ConfigPath string
APITokenSource string
HasConfigToken bool
}
func LoadOfficialAPIConfig ¶ added in v0.6.0
func LoadOfficialAPIConfig(overrides config.APIOverrides) (*OfficialAPIConfig, error)
type PageRef ¶ added in v0.3.0
type PageRef struct {
Kind PageRefKind
Raw string
ID string // canonical UUID if Kind==RefID
}
func ParsePageRef ¶ added in v0.3.0
ParsePageRef classifies an input string as a URL, ID, or name.
type PageRefKind ¶ added in v0.3.0
type PageRefKind int
const ( RefID PageRefKind = iota RefURL RefName )