Skip to content

Commit

Permalink
working on docs
Browse files Browse the repository at this point in the history
  • Loading branch information
markbates committed Apr 18, 2019
1 parent 8fc906a commit cbacc45
Show file tree
Hide file tree
Showing 26 changed files with 116 additions and 44 deletions.
58 changes: 42 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,27 @@ Note: This file is auto-generated. Do Not Edit


## [`bootstrap#Form`](https://godoc.org/github.com/gobuffalo/helpers/forms/bootstrap#Form)
<p>Form implements a Plush helper around the
bootstrap.New function in the github.com/gobuffalo/tags/form/bootstrap package</p>
<p>Form implements a <code>github.com/gobuffalo/plush</code> helper around the
bootstrap.New function in the <code>github.com/gobuffalo/tags/form/bootstrap</code> package</p>


## [`bootstrap#FormFor`](https://godoc.org/github.com/gobuffalo/helpers/forms/bootstrap#FormFor)
<p>FormFor implements a Plush helper around the
bootstrap.NewFormFor function in the github.com/gobuffalo/tags/form/bootstrap package</p>
<p>FormFor implements a <code>github.com/gobuffalo/plush</code> helper around the
bootstrap.NewFormFor function in the <code>github.com/gobuffalo/tags/form/bootstrap</code> package</p>


## [`bootstrap#New`](https://godoc.org/github.com/gobuffalo/helpers/forms/bootstrap#New)
<p>New returns a map of the helpers within this package.</p>


## [`bootstrap#RemoteForm`](https://godoc.org/github.com/gobuffalo/helpers/forms/bootstrap#RemoteForm)
<p>RemoteForm implements a Plush helper around the
bootstrap.New function in the github.com/gobuffalo/tags/form/bootstrap package</p>
<p>RemoteForm implements a <code>github.com/gobuffalo/plush</code> helper around the
bootstrap.New function in the <code>github.com/gobuffalo/tags/form/bootstrap</code> package</p>


## [`bootstrap#RemoteFormFor`](https://godoc.org/github.com/gobuffalo/helpers/forms/bootstrap#RemoteFormFor)
<p>RemoteFormFor implements an AJAXified Plush helper around the
bootstrap.NewFormFor function in the github.com/gobuffalo/tags/form/bootstrap package</p>
<p>FormFor implements a <code>github.com/gobuffalo/plush</code> helper around the
bootstrap.NewFormFor function in the <code>github.com/gobuffalo/tags/form/bootstrap</code> package</p>

<pre><code>&lt;%= remoteFormFor(widget, {method: &#34;POST&#34;}) { %&gt;
&lt;% } %&gt;
Expand Down Expand Up @@ -56,57 +57,68 @@ You can pass an optional map of fields that will be set.</p>


## [`content#New`](https://godoc.org/github.com/gobuffalo/helpers/content#New)
<p>New returns a map of the helpers within this package.</p>


## [`debug#Debug`](https://godoc.org/github.com/gobuffalo/helpers/debug#Debug)
<p>Debug by verbosely printing out using &#39;pre&#39; tags.</p>


## [`debug#Inspect`](https://godoc.org/github.com/gobuffalo/helpers/debug#Inspect)
<p>Inspect the interface using the <code>%+v</code> formatter</p>


## [`debug#New`](https://godoc.org/github.com/gobuffalo/helpers/debug#New)
<p>New returns a map of the helpers within this package.</p>


## [`encoders#New`](https://godoc.org/github.com/gobuffalo/helpers/encoders#New)
<p>New returns a map of the helpers within this package.</p>


## [`encoders#Raw`](https://godoc.org/github.com/gobuffalo/helpers/encoders#Raw)
<p>Raw converts a <code>string</code> to a <code>template.HTML</code></p>


## [`encoders#ToJSON`](https://godoc.org/github.com/gobuffalo/helpers/encoders#ToJSON)
<p>ToJSON marshals the interface{} and returns it
as template.HTML</p>


## [`env#New`](https://godoc.org/github.com/gobuffalo/helpers/env#New)
<p>New returns a map of the helpers within this package.</p>


## [`escapes#HTMLEscape`](https://godoc.org/github.com/gobuffalo/helpers/escapes#HTMLEscape)
<p>HTMLEscape will escape a string for HTML</p>


## [`escapes#New`](https://godoc.org/github.com/gobuffalo/helpers/escapes#New)
<p>New returns a map of the helpers within this package.</p>


## [`forms#Form`](https://godoc.org/github.com/gobuffalo/helpers/forms#Form)
<p>Form implements a Plush helper around the
form.New function in the github.com/gobuffalo/tags/form package</p>
<p>Form implements a <code>github.com/gobuffalo/plush</code> helper around the
form.New function in the <code>github.com/gobuffalo/tags/form</code> package</p>


## [`forms#FormFor`](https://godoc.org/github.com/gobuffalo/helpers/forms#FormFor)
<p>FormFor implements a Plush helper around the
form.NewFormFor function in the github.com/gobuffalo/tags/form package</p>
<p>FormFor implements a <code>github.com/gobuffalo/plush</code> helper around the
form.NewFormFor function in the <code>github.com/gobuffalo/tags/form</code> package</p>


## [`forms#New`](https://godoc.org/github.com/gobuffalo/helpers/forms#New)
<p>New returns a map of the helpers within this package.</p>


## [`forms#RemoteForm`](https://godoc.org/github.com/gobuffalo/helpers/forms#RemoteForm)
<p>RemoteForm implements a Plush helper around the
form.New function in the github.com/gobuffalo/tags/form package</p>
<p>RemoteForm implements a <code>github.com/gobuffalo/plush</code> helper around the
form.New function in the <code>github.com/gobuffalo/tags/form</code> package</p>


## [`forms#RemoteFormFor`](https://godoc.org/github.com/gobuffalo/helpers/forms#RemoteFormFor)
<p>RemoteFormFor implements a Plush helper around the
form.NewFormFor function in the github.com/gobuffalo/tags/form package</p>
<p>RemoteFormFor implements a <code>github.com/gobuffalo/plush</code> helper around the
form.NewFormFor function in the <code>github.com/gobuffalo/tags/form</code> package</p>

<pre><code>&lt;%= remoteFormFor(widget, {method: &#34;POST&#34;}) { %&gt;
&lt;% } %&gt;
Expand All @@ -115,15 +127,21 @@ form.NewFormFor function in the github.com/gobuffalo/tags/form package</p>


## [`inflections#New`](https://godoc.org/github.com/gobuffalo/helpers/inflections#New)
<p>New returns a map of the helpers within this package.</p>


## [`iterators#Between`](https://godoc.org/github.com/gobuffalo/helpers/iterators#Between)
<p>Between will iterate up to, but not including <code>b</code></p>

<pre><code>Between(0,10) // 0,1,2,3,4,5,6,7,8,9
</code></pre>


## [`iterators#GroupBy`](https://godoc.org/github.com/gobuffalo/helpers/iterators#GroupBy)


## [`iterators#New`](https://godoc.org/github.com/gobuffalo/helpers/iterators#New)
<p>New returns a map of the helpers within this package.</p>


## [`iterators#Next`](https://godoc.org/github.com/gobuffalo/helpers/iterators#Next)
Expand All @@ -136,15 +154,21 @@ form.NewFormFor function in the github.com/gobuffalo/tags/form package</p>


## [`iterators#Until`](https://godoc.org/github.com/gobuffalo/helpers/iterators#Until)
<p>Until will iterate up to, but not including <code>a</code></p>

<pre><code>Until(3) // 0,1,2
</code></pre>


## [`meta#Len`](https://godoc.org/github.com/gobuffalo/helpers/meta#Len)


## [`meta#New`](https://godoc.org/github.com/gobuffalo/helpers/meta#New)
<p>New returns a map of the helpers within this package.</p>


## [`paths#New`](https://godoc.org/github.com/gobuffalo/helpers/paths#New)
<p>New returns a map of the helpers within this package.</p>


## [`paths#PathFor`](https://godoc.org/github.com/gobuffalo/helpers/paths#PathFor)
Expand Down Expand Up @@ -176,6 +200,7 @@ Rules:</p>


## [`tags#New`](https://godoc.org/github.com/gobuffalo/helpers/tags#New)
<p>New returns a map of the helpers within this package.</p>


## [`tags#RemoteLinkTo`](https://godoc.org/github.com/gobuffalo/helpers/tags#RemoteLinkTo)
Expand All @@ -191,6 +216,7 @@ Rules:</p>


## [`text#New`](https://godoc.org/github.com/gobuffalo/helpers/text#New)
<p>New returns a map of the helpers within this package.</p>


## [`text#Truncate`](https://godoc.org/github.com/gobuffalo/helpers/text#Truncate)
Expand Down
2 changes: 2 additions & 0 deletions content/content.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ package content

import "github.com/gobuffalo/helpers/hctx"

// Keys to be used in templates for the functions in this package.
const (
OfKey = "contentOf"
ForKey = "contentFor"
)

// New returns a map of the helpers within this package.
func New() hctx.Map {
return hctx.Map{
OfKey: ContentOf,
Expand Down
2 changes: 2 additions & 0 deletions debug/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ import (
"github.com/gobuffalo/helpers/hctx"
)

// Keys to be used in templates for the functions in this package.
const (
DebugKey = "debug"
InspectKey = "inspect"
)

// New returns a map of the helpers within this package.
func New() hctx.Map {
return hctx.Map{
DebugKey: Debug,
Expand Down
1 change: 1 addition & 0 deletions debug/inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
)

// Inspect the interface using the `%+v` formatter
func Inspect(v interface{}) string {
return fmt.Sprintf("%+v", v)
}
2 changes: 2 additions & 0 deletions encoders/encoders.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ package encoders

import "github.com/gobuffalo/helpers/hctx"

// Keys to be used in templates for the functions in this package.
const (
ToJSONKey = "toJSON"
RawKey = "raw"
)

// New returns a map of the helpers within this package.
func New() hctx.Map {
return hctx.Map{
"json": ToJSON,
Expand Down
2 changes: 2 additions & 0 deletions encoders/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (
"html/template"
)

// ToJSON marshals the interface{} and returns it
// as template.HTML
func ToJSON(v interface{}) (template.HTML, error) {
b, err := json.Marshal(v)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions encoders/raw.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package encoders

import "html/template"

// Raw converts a `string` to a `template.HTML`
func Raw(s string) template.HTML {
return template.HTML(s)
}
9 changes: 9 additions & 0 deletions env/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,26 @@ import (
"github.com/gobuffalo/helpers/hctx"
)

// Keys to be used in templates for the functions in this package.
const (
EnvKey = "env"
EnvOrKey = "envOr"
)

// New returns a map of the helpers within this package.
func New() hctx.Map {
return hctx.Map{
EnvKey: Env,
EnvOrKey: EnvOr,
}
}

// Env will return the specified environment variable,
// or an error if it can not be found
// <%= env("GOPATH") %>
var Env = envy.MustGet

// Env will return the specified environment variable,
// or the second argument, if not found
// <%= envOr("GOPATH", "~/go) %>
var EnvOr = envy.Get
2 changes: 2 additions & 0 deletions escapes/escapes.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ package escapes

import "github.com/gobuffalo/helpers/hctx"

// Keys to be used in templates for the functions in this package.
const (
JSEscapeKey = "jsEscape"
HTMLEscapeKey = "htmlEscape"
)

// New returns a map of the helpers within this package.
func New() hctx.Map {
return hctx.Map{
JSEscapeKey: JSEscape,
Expand Down
1 change: 1 addition & 0 deletions escapes/html.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"github.com/gobuffalo/helpers/hctx"
)

// HTMLEscape will escape a string for HTML
func HTMLEscape(s string, help hctx.HelperContext) (string, error) {
var err error
if help.HasBlock() {
Expand Down
1 change: 1 addition & 0 deletions escapes/js.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ package escapes

import "html/template"

// JSEscape will escape a string for Javascript
var JSEscape = template.JSEscapeString
2 changes: 2 additions & 0 deletions forms/bootstrap/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ import (
"github.com/gobuffalo/tags"
)

// Keys to be used in templates for the functions in this package.
const (
FormKey = "bootstrapForm"
RemoteFormKey = "remoteBootstrapForm"
FormForKey = "bootstrapFormFor"
RemoteFormForKey = "remoteBootstrapFormFor"
)

// New returns a map of the helpers within this package.
func New() hctx.Map {
return hctx.Map{
FormKey: Form,
Expand Down
8 changes: 4 additions & 4 deletions forms/bootstrap/form.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ import (
"github.com/gobuffalo/tags/form/bootstrap"
)

// Form implements a Plush helper around the
// bootstrap.New function in the github.com/gobuffalo/tags/form/bootstrap package
// Form implements a `github.com/gobuffalo/plush` helper around the
// bootstrap.New function in the `github.com/gobuffalo/tags/form/bootstrap` package
func Form(opts tags.Options, help hctx.HelperContext) (template.HTML, error) {
return helper(opts, help, func(opts tags.Options) helperable {
return bootstrap.New(opts)
})
}

// RemoteForm implements a Plush helper around the
// bootstrap.New function in the github.com/gobuffalo/tags/form/bootstrap package
// RemoteForm implements a `github.com/gobuffalo/plush` helper around the
// bootstrap.New function in the `github.com/gobuffalo/tags/form/bootstrap` package
func RemoteForm(opts tags.Options, help hctx.HelperContext) (template.HTML, error) {
if opts == nil {
opts = tags.Options{}
Expand Down
8 changes: 4 additions & 4 deletions forms/bootstrap/form_for.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"github.com/gobuffalo/tags/form/bootstrap"
)

// FormFor implements a Plush helper around the
// bootstrap.NewFormFor function in the github.com/gobuffalo/tags/form/bootstrap package
// FormFor implements a `github.com/gobuffalo/plush` helper around the
// bootstrap.NewFormFor function in the `github.com/gobuffalo/tags/form/bootstrap` package
func FormFor(model interface{}, opts tags.Options, help hctx.HelperContext) (template.HTML, error) {
if opts == nil {
opts = tags.Options{}
Expand All @@ -27,8 +27,8 @@ func FormFor(model interface{}, opts tags.Options, help hctx.HelperContext) (tem
})
}

// RemoteFormFor implements an AJAXified Plush helper around the
// bootstrap.NewFormFor function in the github.com/gobuffalo/tags/form/bootstrap package
// FormFor implements a `github.com/gobuffalo/plush` helper around the
// bootstrap.NewFormFor function in the `github.com/gobuffalo/tags/form/bootstrap` package
// <%= remoteFormFor(widget, {method: "POST"}) { %>
// <% } %>
// <form action="/widgets/b6b0ab24-19ae-4cdd-ad73-c5ecbddd6f91" id="widget-form" method="POST"><input name="_method" type="hidden" value="PUT"></form>
Expand Down
8 changes: 4 additions & 4 deletions forms/form.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ import (
"github.com/gobuffalo/tags/form"
)

// Form implements a Plush helper around the
// form.New function in the github.com/gobuffalo/tags/form package
// Form implements a `github.com/gobuffalo/plush` helper around the
// form.New function in the `github.com/gobuffalo/tags/form` package
func Form(opts tags.Options, help hctx.HelperContext) (template.HTML, error) {
return helper(opts, help, func(opts tags.Options) helperable {
return form.New(opts)
})
}

// RemoteForm implements a Plush helper around the
// form.New function in the github.com/gobuffalo/tags/form package
// RemoteForm implements a `github.com/gobuffalo/plush` helper around the
// form.New function in the `github.com/gobuffalo/tags/form` package
func RemoteForm(opts tags.Options, help hctx.HelperContext) (template.HTML, error) {
if opts == nil {
opts = tags.Options{}
Expand Down
8 changes: 4 additions & 4 deletions forms/form_for.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"github.com/gobuffalo/tags/form"
)

// FormFor implements a Plush helper around the
// form.NewFormFor function in the github.com/gobuffalo/tags/form package
// FormFor implements a `github.com/gobuffalo/plush` helper around the
// form.NewFormFor function in the `github.com/gobuffalo/tags/form` package
func FormFor(model interface{}, opts tags.Options, help hctx.HelperContext) (template.HTML, error) {
if opts == nil {
opts = tags.Options{}
Expand All @@ -27,8 +27,8 @@ func FormFor(model interface{}, opts tags.Options, help hctx.HelperContext) (tem
})
}

// RemoteFormFor implements a Plush helper around the
// form.NewFormFor function in the github.com/gobuffalo/tags/form package
// RemoteFormFor implements a `github.com/gobuffalo/plush` helper around the
// form.NewFormFor function in the `github.com/gobuffalo/tags/form` package
// <%= remoteFormFor(widget, {method: "POST"}) { %>
// <% } %>
// <form action="/widgets/b6b0ab24-19ae-4cdd-ad73-c5ecbddd6f91" id="widget-form" method="POST"><input name="_method" type="hidden" value="PUT"></form>
Expand Down
Loading

0 comments on commit cbacc45

Please sign in to comment.