extension

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMarkdown

func NewMarkdown(f render.RenderCellFunc) nb.Extension

NewMarkdown overrides the default rendering function for markdown cells.

While its lax signature allows passing any arbitrary RenderCellFunc, it will be best used to extend nb with existing markdown converters. Package extension/adapters offers elegant wrappers for some of the popular options:

extension.NewMarkdown(
	adapter.Blackfriday(blackfriday.MarkdownCommon)
)

or

extension.NewMarkdown(
	adapter.Goldmark(func(b []byte, w io.Writer) error {
		return goldmark.Convert(b, w)
	})
)

func NewStream

func NewStream(f render.RenderCellFunc) nb.Extension

NewStream overrides the default rendering function for "stream" and "error" output cells. These will often be formatted with ANSI-color codes, which you may want to replace with styled HTML tags or strip from the output completely.

For example, use ansihtml with a dedicated adapter:

extension.NewStream(
	adapter.AnsiHtml(ansihtml.ConvertToHTML)
)

Types

This section is empty.

Directories

Path Synopsis
Package adapter provides convenient adapters for other popular packages making it simple to use those as nb extensions.
Package adapter provides convenient adapters for other popular packages making it simple to use those as nb extensions.
extra

Jump to

Keyboard shortcuts

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