aboutsummaryrefslogtreecommitdiffhomepage
path: root/transform
diff options
context:
space:
mode:
authorbep <[email protected]>2015-03-18 17:33:12 +0100
committerbep <[email protected]>2015-03-18 17:33:12 +0100
commite7099cfa26d31cc7544e6db37899678ef8bd65ff (patch)
tree3a0152bfbd63c84b23fc578063f9c02b0e9dd0f0 /transform
parent98ee69bce207a4c2a7c2ffca2b3e7c0ccdd6e8c9 (diff)
downloadhugo-e7099cfa26d31cc7544e6db37899678ef8bd65ff.tar.gz
hugo-e7099cfa26d31cc7544e6db37899678ef8bd65ff.zip
Un-export ContentReWriter
Diffstat (limited to 'transform')
-rw-r--r--transform/absurl.go4
-rw-r--r--transform/absurlreplacer.go6
-rw-r--r--transform/chain.go8
-rw-r--r--transform/chain_test.go8
-rw-r--r--transform/livereloadinject.go2
5 files changed, 14 insertions, 14 deletions
diff --git a/transform/absurl.go b/transform/absurl.go
index fa1d99306..b4bd1dff4 100644
--- a/transform/absurl.go
+++ b/transform/absurl.go
@@ -17,7 +17,7 @@ func initAbsURLReplacer(baseURL string) {
func AbsURL(absURL string) (trs []link, err error) {
initAbsURLReplacer(absURL)
- trs = append(trs, func(rw ContentReWriter) {
+ trs = append(trs, func(rw contentRewriter) {
ar.replaceInHTML(rw)
})
return
@@ -26,7 +26,7 @@ func AbsURL(absURL string) (trs []link, err error) {
func AbsURLInXML(absURL string) (trs []link, err error) {
initAbsURLReplacer(absURL)
- trs = append(trs, func(rw ContentReWriter) {
+ trs = append(trs, func(rw contentRewriter) {
ar.replaceInXML(rw)
})
return
diff --git a/transform/absurlreplacer.go b/transform/absurlreplacer.go
index 66fdaf689..1f3f77d9a 100644
--- a/transform/absurlreplacer.go
+++ b/transform/absurlreplacer.go
@@ -176,7 +176,7 @@ func (l *contentlexer) replace() {
}
}
-func doReplace(rw ContentReWriter, matchers []absURLMatcher) {
+func doReplace(rw contentRewriter, matchers []absURLMatcher) {
lexer := &contentlexer{
content: rw.Content(),
@@ -226,10 +226,10 @@ func newAbsURLReplacer(baseURL string) *absURLReplacer {
}
-func (au *absURLReplacer) replaceInHTML(rw ContentReWriter) {
+func (au *absURLReplacer) replaceInHTML(rw contentRewriter) {
doReplace(rw, au.htmlMatchers)
}
-func (au *absURLReplacer) replaceInXML(rw ContentReWriter) {
+func (au *absURLReplacer) replaceInXML(rw contentRewriter) {
doReplace(rw, au.xmlMatchers)
}
diff --git a/transform/chain.go b/transform/chain.go
index 0edcb6971..a42660245 100644
--- a/transform/chain.go
+++ b/transform/chain.go
@@ -6,7 +6,7 @@ import (
"io"
)
-type trans func(rw ContentReWriter)
+type trans func(rw contentRewriter)
type link trans
@@ -20,14 +20,14 @@ func NewEmptyTransforms() []link {
return make([]link, 0, 20)
}
-// ContentReWriter is an interface that enables rotation
+// contentRewriter is an interface that enables rotation
// of pooled buffers in the transformer chain.
-type ContentReWriter interface {
+type contentRewriter interface {
Content() []byte
io.Writer
}
-// Implements ContentReWriter
+// Implements contentRewriter
// Content is read from the from-buffer,
// and rewritten to to the to-buffer.
type fromToBuffer struct {
diff --git a/transform/chain_test.go b/transform/chain_test.go
index 2477c3abf..d8ceb8bca 100644
--- a/transform/chain_test.go
+++ b/transform/chain_test.go
@@ -56,17 +56,17 @@ func TestChainZeroTransformers(t *testing.T) {
}
func TestChaingMultipleTransformers(t *testing.T) {
- f1 := func(rw ContentReWriter) {
+ f1 := func(rw contentRewriter) {
rw.Write(bytes.Replace(rw.Content(), []byte("f1"), []byte("f1r"), -1))
}
- f2 := func(rw ContentReWriter) {
+ f2 := func(rw contentRewriter) {
rw.Write(bytes.Replace(rw.Content(), []byte("f2"), []byte("f2r"), -1))
}
- f3 := func(rw ContentReWriter) {
+ f3 := func(rw contentRewriter) {
rw.Write(bytes.Replace(rw.Content(), []byte("f3"), []byte("f3r"), -1))
}
- f4 := func(rw ContentReWriter) {
+ f4 := func(rw contentRewriter) {
rw.Write(bytes.Replace(rw.Content(), []byte("f4"), []byte("f4r"), -1))
}
diff --git a/transform/livereloadinject.go b/transform/livereloadinject.go
index bffedf040..1399533fc 100644
--- a/transform/livereloadinject.go
+++ b/transform/livereloadinject.go
@@ -5,7 +5,7 @@ import (
"github.com/spf13/viper"
)
-func LiveReloadInject(rw ContentReWriter) {
+func LiveReloadInject(rw contentRewriter) {
match := []byte("</body>")
port := viper.GetString("port")
replace := []byte(`<script>document.write('<script src="http://'