marp

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package marp implements the Marp Markdown backend for slidekit.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	// contains filtered or unexported fields
}

Backend implements the model.Backend interface for Marp Markdown files.

func NewBackend

func NewBackend() *Backend

NewBackend creates a new Marp backend.

func (*Backend) Apply

func (b *Backend) Apply(_ context.Context, ref model.Ref, diff *model.Diff) error

Apply writes the diff to the file. For Marp, this means rewriting the file.

func (*Backend) Create

func (b *Backend) Create(_ context.Context, deck *model.Deck) (model.Ref, error)

Create creates a new Marp presentation file.

func (*Backend) Info

func (b *Backend) Info() model.BackendInfo

Info returns backend metadata.

func (*Backend) Plan

func (b *Backend) Plan(_ context.Context, ref model.Ref, desired *model.Deck) (*model.Diff, error)

Plan computes changes needed to reach desired state.

func (*Backend) Read

func (b *Backend) Read(ctx context.Context, ref model.Ref) (*model.Deck, error)

Read loads a Marp presentation from a file.

type Frontmatter

type Frontmatter struct {
	Marp     bool
	Theme    string
	Paginate bool
	Style    string
	Custom   map[string]string
}

Frontmatter holds parsed YAML frontmatter.

type Reader

type Reader struct{}

Reader parses Marp Markdown files into the canonical slide model.

func NewReader

func NewReader() *Reader

NewReader creates a new Marp reader.

func (*Reader) Parse

func (r *Reader) Parse(content string) (*model.Deck, error)

Parse parses Marp Markdown content into a Deck.

func (*Reader) Read

func (r *Reader) Read(ctx context.Context, ref model.Ref) (*model.Deck, error)

Read implements the Backend interface for reading from a Ref.

func (*Reader) ReadFile

func (r *Reader) ReadFile(path string) (*model.Deck, error)

ReadFile reads a Marp Markdown file and returns a Deck.

type Writer

type Writer struct{}

Writer converts a Deck back to Marp Markdown format.

func NewWriter

func NewWriter() *Writer

NewWriter creates a new Marp writer.

func (*Writer) Encode

func (w *Writer) Encode(deck *model.Deck) string

Encode converts a Deck to Marp Markdown string.

func (*Writer) WriteFile

func (w *Writer) WriteFile(deck *model.Deck, path string) error

WriteFile writes a deck to a Marp Markdown file.

Jump to

Keyboard shortcuts

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