attributes

package module
v0.0.0-...-52da21a Latest Latest
Warning

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

Go to latest
Published: May 29, 2021 License: MIT Imports: 6 Imported by: 3

README

goldmark-attributes

GoDoc

GoldMark block attributes extension.

# Document {#main}

> Why, you may take the most gallant sailor, the most intrepid airman or the
> most audacious soldier, put them at a table together – what do you get? The
> sum of their fears.
{.epigraph}
<h1 id="main">Document</h1>
<blockquote class="epigraph"><p>Why, you may take the most gallant sailor, the
most intrepid airman or the most audacious soldier, put them at a table 
together – what do you get? The sum of their fears.</p>
</blockquote>
var md = goldmark.New(attributes.Enable)
var source = []byte("{#id .class1}\ntext")
err := md.Convert(source, os.Stdout)
if err != nil {
    log.Fatal(err)
}

Documentation

Overview

Package attributes is a extension for the goldmark (http://github.com/yuin/goldmark).

This extension adds support for block attributes in markdowns.

paragraph text with attributes
{#id .class option="value"}
Example
package main

import (
	"log"
	"os"

	attributes "github.com/mdigger/goldmark-attributes"
	"github.com/yuin/goldmark"
)

func main() {
	var source = []byte(`
text
{#id .class}
`)
	var md = goldmark.New(attributes.Enable)
	err := md.Convert(source, os.Stdout)
	if err != nil {
		log.Fatal(err)
	}
}
Output:

<p id="id" class="class">text</p>

Index

Examples

Constants

This section is empty.

Variables

Enable is a goldmark.Option with block attributes support.

View Source
var Extension goldmark.Extender = new(extension)

Extension is a goldmark.Extender with markdown block attributes support.

View Source
var KindAttributes = ast.NewNodeKind("BlockAttributes")

KindAttributes is a NodeKind of the attributes block node.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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