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 "fmt"
|
||||||
import "io"
|
import "io"
|
||||||
import "os"
|
import "os"
|
||||||
import "strings"
|
|
||||||
|
|
||||||
// Html is one of EmptyElement, ParentElement, Text, or RText.
|
// Html is one of EmptyElement, ParentElement, or Text.
|
||||||
type Html interface {
|
type Html interface {
|
||||||
io.WriterTo
|
io.WriterTo
|
||||||
|
|
||||||
@ -109,16 +108,6 @@ func (t Text) WriteTo(w io.Writer) (n int64, err error) {
|
|||||||
return
|
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
|
// Html5 functions
|
||||||
|
|
||||||
func Div(attribs ...Attrib) func(children ...Html) *ParentElement {
|
func Div(attribs ...Attrib) func(children ...Html) *ParentElement {
|
||||||
@ -172,7 +161,6 @@ func Main() {
|
|||||||
Img(Id("profile-photo")),
|
Img(Id("profile-photo")),
|
||||||
Text("hello"),
|
Text("hello"),
|
||||||
Img(Disabled()),
|
Img(Disabled()),
|
||||||
RText{strings.NewReader("goodbye!")},
|
|
||||||
)
|
)
|
||||||
|
|
||||||
n, err := WriteDocument(os.Stdout, page)
|
n, err := WriteDocument(os.Stdout, page)
|
||||||
|
Loading…
Reference in New Issue
Block a user