Removed RText
This commit is contained in:
parent
baef46c4b0
commit
451e99c4a6
14
hatmill.go
14
hatmill.go
@ -3,9 +3,8 @@ package hatmill
|
||||
import "fmt"
|
||||
import "io"
|
||||
import "os"
|
||||
import "strings"
|
||||
|
||||
// Html is one of EmptyElement, ParentElement, Text, or RText.
|
||||
// Html is one of EmptyElement, ParentElement, or Text.
|
||||
type Html interface {
|
||||
io.WriterTo
|
||||
|
||||
@ -109,16 +108,6 @@ func (t Text) WriteTo(w io.Writer) (n int64, err error) {
|
||||
return
|
||||
}
|
||||
|
||||
type RText struct {
|
||||
io.Reader
|
||||
}
|
||||
|
||||
func (RText) isHtml() {}
|
||||
|
||||
func (rt RText) WriteTo(w io.Writer) (n int64, err error) {
|
||||
return io.Copy(w, rt.Reader)
|
||||
}
|
||||
|
||||
// Html5 functions
|
||||
|
||||
func Div(attribs ...Attrib) func(children ...Html) *ParentElement {
|
||||
@ -172,7 +161,6 @@ func Main() {
|
||||
Img(Id("profile-photo")),
|
||||
Text("hello"),
|
||||
Img(Disabled()),
|
||||
RText{strings.NewReader("goodbye!")},
|
||||
)
|
||||
|
||||
n, err := WriteDocument(os.Stdout, page)
|
||||
|
Loading…
Reference in New Issue
Block a user