embed

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package embed renders Obsidian image and note embeds, rebasing section-scoped transclusions so recursive diagnostics stay anchored to the original note lines.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MaxRenderDepth

func MaxRenderDepth() int

MaxRenderDepth returns the embed recursion limit enforced during rendering.

func New

func New(
	idx *model.VaultIndex,
	note *model.Note,
	outputNote *model.Note,
	diagCollector *diag.Collector,
	assetSink AssetSink,
	fallbackResolver gmwikilink.Resolver,
	convert func([]byte, io.Writer) error,
	renderEmbedded RenderEmbeddedFunc,
	imageCount *int,
	headingIDPrefix string,
	visited map[string]struct{},
	depth int,
) goldmark.Extender

New installs embed-aware wikilink rendering for pass 2.

func ScopeNoteToFragment

func ScopeNoteToFragment(note *model.Note, fragmentID string) *model.Note

ScopeNoteToFragment returns the note view used to render a heading-scoped embed.

Types

type AssetSink

type AssetSink interface {
	Register(vaultRelPath string) string
}

AssetSink mirrors markdown.AssetSink without importing the parent package.

type RenderEmbeddedFunc

type RenderEmbeddedFunc func(note *model.Note, source []byte, writer io.Writer, visited map[string]struct{}, depth int) error

RenderEmbeddedFunc renders a note or section embed in a child note context.

Jump to

Keyboard shortcuts

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