Skip to content

Commit

Permalink
chore(renderer): remove unused funcs (#967)
Browse files Browse the repository at this point in the history
Signed-off-by: Xavier Coulon <[email protected]>
  • Loading branch information
xcoulon authored Mar 4, 2022
1 parent b4dc80e commit 7e03732
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions pkg/renderer/sgml/renderer.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ type Renderer interface {
// Render renders a document to the given output stream.
Render(ctx *renderer.Context, doc *types.Document, output io.Writer) (types.Metadata, error)

// SetFunction sets the named function.
SetFunction(name string, fn interface{})

// Templates returns the Templates used by this Renderer.
// It cannot be altered on a given Renderer, since the old
// templates may have already been parsed.
Expand All @@ -37,9 +34,6 @@ func NewRenderer(t Templates) Renderer {
// Establish some default function handlers.
functions: funcMap{
"escape": EscapeString,
"trimRight": trimRight,
"trimLeft": trimLeft,
"trim": trimBoth,
"halign": halign,
"valign": valign,
"lastInStrings": lastInStrings,
Expand All @@ -48,18 +42,6 @@ func NewRenderer(t Templates) Renderer {
return r
}

func trimLeft(s string) string {
return strings.TrimLeft(s, " ")
}

func trimRight(s string) string {
return strings.TrimRight(s, " ")
}

func trimBoth(s string) string {
return strings.Trim(s, " ")
}

var predefinedAttributes = map[string]string{
"sp": " ",
"blank": "",
Expand Down Expand Up @@ -127,10 +109,6 @@ func lastInStrings(slice []string, index int) bool {
return index == len(slice)-1
}

func (r *sgmlRenderer) SetFunction(name string, fn interface{}) {
r.functions[name] = fn
}

// Templates returns the Templates being used by this renderer.
// A copy is made, as we cannot change the original Templates
// due to it already being used.
Expand Down

0 comments on commit 7e03732

Please sign in to comment.