html

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2024 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	CSSWriter io.Writer
}

type Option

type Option func(*Config)

func WithCSSWriter

func WithCSSWriter(w io.Writer) Option

WithCSSWriter

type Renderer

type Renderer struct {
	render.CellWrapper
	// contains filtered or unexported fields
}

Renderer renders the notebook as HTML. It supports "markdown", "code", and "raw" cells with different mime-types of the their data.

func NewRenderer

func NewRenderer(opts ...Option) *Renderer

NewRenderer configures a new HTML renderer and embeds a *Wrapper to implement render.CellWrapper.

func (*Renderer) RegisterFuncs

func (r *Renderer) RegisterFuncs(reg render.RenderCellFuncRegistry)

type Wrapper

type Wrapper struct {
	Config
}

Wrapper wraps cells in the HTML produced by the original Jupyter's nbconvert.

func (*Wrapper) Wrap

func (wr *Wrapper) Wrap(w io.Writer, cell schema.Cell, render render.RenderCellFunc) error

func (*Wrapper) WrapInput

func (wr *Wrapper) WrapInput(w io.Writer, cell schema.Cell, render render.RenderCellFunc) error

func (*Wrapper) WrapOutput

func (wr *Wrapper) WrapOutput(w io.Writer, cell schema.Outputter, render render.RenderCellFunc) error

type WriterOnce

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

WriterOnce writes to the writer once only. TODO: move to util

func (*WriterOnce) Write

func (w *WriterOnce) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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