Documentation ¶
Overview ¶
Package mycomarkup provides an API for processing Mycomarkup-formatted documents.
Index ¶
- func BlockToHTML(block blocks.Block, counter *blocks.IDCounter) string
- func BlockTree(ctx mycocontext.Context, visitors ...func(block blocks.Block)) []blocks.Block
- func BlocksToHTML(_ mycocontext.Context, ast []blocks.Block) string
- func OpenGraphVisitors(ctx mycocontext.Context) (resultHTML func() string, descVisitor func(blocks.Block), ...)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BlockToHTML ¶ added in v0.4.0
BlockToHTML turns the given block into HTML. It supports only a subset of Mycomarkup.
func BlockTree ¶ added in v0.4.0
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 ¶ added in v0.4.0
func BlocksToHTML(_ mycocontext.Context, ast []blocks.Block) string
BlocksToHTML turns the blocks into their HTML representation.
func OpenGraphVisitors ¶ added in v0.5.0
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.
Types ¶
This section is empty.
Directories ¶
Path | Synopsis |
---|---|
Package blocks provides some of the Mycomarkup's blocks.
|
Package blocks provides some of the Mycomarkup's blocks. |
cmd
|
|
Package globals provides global variables.
|
Package globals provides global variables. |
Package links provides a data type for links.
|
Package links provides a data type for links. |
Package mycocontext provides a wrapper over context.Context and some operations on the wrapper.
|
Package mycocontext provides a wrapper over context.Context and some operations on the wrapper. |
Package parser turns the source text into a sequence of blocks.
|
Package parser turns the source text into a sequence of blocks. |
Package util provides simple utility functions usable in all modules.
|
Package util provides simple utility functions usable in all modules. |