Skip to content

Commit

Permalink
fix: format
Browse files Browse the repository at this point in the history
Signed-off-by: nιcнolaѕ wιlde <[email protected]>
  • Loading branch information
nicholaswilde committed Jul 16, 2022
1 parent 1d19339 commit a7d5246
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/document/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import (
"errors"
"fmt"
"io/ioutil"
"net/url"
"os"
"path/filepath"
"strings"
"text/template"
"net/url"

"github.com/Masterminds/sprig/v3"
"github.com/aquilax/cooklang-go"
Expand Down Expand Up @@ -323,14 +323,14 @@ func newRecipeDocumentationTemplate(recipeSearchRoot string, recipeInfo cook.Rec
documentationTemplate := template.New(recipeInfo.RecipePath)
documentationTemplate.Funcs(sprig.TxtFuncMap())
documentationTemplate.Funcs(template.FuncMap{"getSource": func(source string) string {
_, err := url.ParseRequestURI(source)
_, err := url.ParseRequestURI(source)
if err != nil {
return source
}
u, err := url.Parse(source)
if err != nil || u.Scheme == "" || u.Host == "" {
return source
}
}
return "<" + source + ">"
}})
documentationTemplate.Funcs(template.FuncMap{"sumTimers": func(steps []cooklang.Step) string {
Expand Down

0 comments on commit a7d5246

Please sign in to comment.