htmlformater

package
v0.0.0-...-fc402b7 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2015 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Format

func Format(as *attributedtext.AttributedString) string

func Formater

func Formater(attr ...attributedtext.Attribute) func(string) string
Example
package main

import (
	"fmt"

	"github.com/muhqu/go-attributedtext/textstyle"
	"github.com/muhqu/go-attributedtext/textstyle/htmlformater"
)

func main() {

	err := htmlformater.Formater(textstyle.Red.ForegroundColor())
	info := htmlformater.Formater(textstyle.Yellow.ForegroundColor())
	fatal := htmlformater.Formater(textstyle.Red.ForegroundColor(), textstyle.Bold, textstyle.Underline, textstyle.White.BackgroundColor())

	fmt.Printf("%s\n", err("Hello"))
	fmt.Printf("%s\n", info("World"))
	fmt.Printf("%s\n", fatal("<Fatal>"))

}
Output:


<font color="red">Hello</font>
<font color="yellow">World</font>
<font bgcolor="white"><u><b><font color="red">&lt;Fatal&gt;</font></b></u></font>

Types

This section is empty.

Jump to

Keyboard shortcuts

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