notion2md

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(c *notionapi.Client, pageID string, blog config.Blog, options ConverterOptions) error

Types

type Converter

type Converter struct {
	*tomarkdown.Converter
	// contains filtered or unexported fields
}

func NewConverter

func NewConverter(
	client *notionapi.Client,
	page *notionapi.Page,
	blog config.Blog,
	options ConverterOptions,
) *Converter

NewConverter returns a converter for a Notion page.

func (*Converter) BlockRenderFunc

func (c *Converter) BlockRenderFunc(b *notionapi.Block) bool

func (*Converter) RenderBlock

func (c *Converter) RenderBlock(b *notionapi.Block)

func (*Converter) RenderImage

func (c *Converter) RenderImage(b *notionapi.Block)

func (*Converter) ToMarkdown

func (c *Converter) ToMarkdown(frontMatter string) error

type ConverterOptions

type ConverterOptions struct {
	// SkipTitle skips rendering the title.
	// This field prevents the title from being duplicated by the site generator.
	SkipTitle bool
}

type Formatter

type Formatter func(key, value string) (string, string)

Formatter returns formatted key and formatted value.

type FrontMatter

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

func NewFrontMatter

func NewFrontMatter(tableview *notionapi.TableView, formatter Formatter) *FrontMatter

func (*FrontMatter) AsYAML

func (f *FrontMatter) AsYAML(row *notionapi.TableRow) (string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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