salixmd

package module
v0.0.0-...-10293f2 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

README

salixmd

Salix tag for markdown rendering.

Template Example:

<div>
    #markdown:
        # Example!
        [example](https://example.com)
    #!markdown
</div>

Code Example:

md := goldmark.New(goldmark.WithExtensions(extension.GFM))

tmpl, err := salix.New().ParseFile("example.txt")
if err != nil {
	panic(err)
}

err = tmpl.
	WithTagMap(map[string]salix.Tag{
		"markdown": salixmd.New(md),
	}).
	Execute(os.Stdout)
if err != nil {
	panic(err)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tag

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

func New

func New(md goldmark.Markdown) Tag

func (Tag) Run

func (t Tag) Run(tc *salix.TagContext, block, args []ast.Node) error

Jump to

Keyboard shortcuts

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