aboutsummaryrefslogtreecommitdiffhomepage
path: root/markup/converter/hooks/hooks.go
diff options
context:
space:
mode:
Diffstat (limited to 'markup/converter/hooks/hooks.go')
-rw-r--r--markup/converter/hooks/hooks.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/markup/converter/hooks/hooks.go b/markup/converter/hooks/hooks.go
index 54babd320..1e335fa46 100644
--- a/markup/converter/hooks/hooks.go
+++ b/markup/converter/hooks/hooks.go
@@ -78,6 +78,19 @@ type CodeblockContext interface {
Ordinal() int
}
+// PassThroughContext is the context passed to a passthrough render hook.
+type PassthroughContext interface {
+ AttributesProvider
+ text.Positioner
+ PageProvider
+
+ // Currently one of "inline" or "block".
+ Type() string
+
+ // Zero-based ordinal for all passthrough elements in the document.
+ Ordinal() int
+}
+
type AttributesOptionsSliceProvider interface {
AttributesSlice() []attributes.Attribute
OptionsSlice() []attributes.Attribute
@@ -91,6 +104,10 @@ type CodeBlockRenderer interface {
RenderCodeblock(cctx context.Context, w hugio.FlexiWriter, ctx CodeblockContext) error
}
+type PassthroughRenderer interface {
+ RenderPassthrough(cctx context.Context, w io.Writer, ctx PassthroughContext) error
+}
+
type IsDefaultCodeBlockRendererProvider interface {
IsDefaultCodeBlockRenderer() bool
}
@@ -143,6 +160,7 @@ const (
ImageRendererType
HeadingRendererType
CodeBlockRendererType
+ PassthroughRendererType
)
type GetRendererFunc func(t RendererType, id any) any