mycomarkup – github.com/bouncepaw/mycomarkup Index | Files | Directories

package mycomarkup

import "github.com/bouncepaw/mycomarkup"

Package mycomarkup provides an API for processing Mycomarkup-formatted documents.

Index

Functions

func BlockToHTML

func BlockToHTML(block blocks.Block, counter *blocks.IDCounter) string

BlockToHTML turns the given block into HTML. It supports only a subset of Mycomarkup.

func BlockTree

func BlockTree(ctx mycocontext.Context, visitors ...func(block blocks.Block)) []blocks.Block

BlockTree returns a slice of blocks parsed from the Mycomarkup document contained in ctx.

Pass visitors. Visitors are functions (usually closures) that are called on every found block.

Visitors included with mycomarkup can be gotten from OpenGraphVisitors. More visitors coming soon.

func BlocksToHTML

func BlocksToHTML(_ mycocontext.Context, ast []blocks.Block) string

BlocksToHTML turns the blocks into their HTML representation.

func OpenGraphVisitors

func OpenGraphVisitors(ctx mycocontext.Context) (
	resultHTML func() string,
	descVisitor func(blocks.Block),
	imgVisitor func(blocks.Block),
)

OpenGraphVisitors returns visitors you should pass to BlockTree. They will figure out what should go to the final opengraph. Call resultHTML to get that result.

Source Files

generator.go html.go mycomarkup.go opengraph.go

Directories

PathSynopsis
blocksPackage blocks provides some of the Mycomarkup's blocks.
cmd
cmd/mycomarkup
globalsPackage globals provides global variables.
linksPackage links provides a data type for links.
mycocontextPackage mycocontext provides a wrapper over context.Context and some operations on the wrapper.
parserPackage parser turns the source text into a sequence of blocks.
utilPackage util provides simple utility functions usable in all modules.
Version
v1.0.4 (latest)
Published
Sep 10, 2021
Platform
linux/amd64
Imports
10 packages
Last checked
3 days ago

Tools for package owners.