We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
file and cli helpers are defined as
https://github.com/mh-cbon/emd/blob/master/std/emd.go#L17 https://github.com/mh-cbon/emd/blob/master/std/emd.go#L59
they both embed the body response with a md block code markup like this,
res := ` ###### $ ` + fbin + ` ` + strings.Join(args, " ") + ` ` + "```sh" + ` ` + strings.TrimSpace(string(out)) + ` ` + "```"
It is made that way because when they was written, the generator instance g *emd.Generator did not implement, GetOut method, https://github.com/mh-cbon/emd/blob/master/emd/emd.go#L75
g *emd.Generator
GetOut
They simply returned a formatted string block.
Now that getout method exists, it is possible to change that.
color
{{exec "ls" | color "sh"}} {{exec "cat maing.go" | color "go"}}
deprecate cli / file, but keep them for compatibility (avoid major bump)
cli / file
add new exec/cat
exec/cat
the implementation must differ to take advantage of GetOut method to directly write on it, and return only the body response.
g.AddFunc("cat", func(f string) (string, error) { s, err := ioutil.ReadFile(f) if err != nil { return "", err } res := "\n###### > " + f + "\n" g.GetOut.Write([]byte(res))// err ? return strings.TrimSpace(string(s)), nil })
The text was updated successfully, but these errors were encountered:
164b157
No branches or pull requests
file and cli helpers are defined as
https://github.com/mh-cbon/emd/blob/master/std/emd.go#L17
https://github.com/mh-cbon/emd/blob/master/std/emd.go#L59
they both embed the body response with a md block code markup like this,
It is made that way because when they was written,
the generator instance
g *emd.Generator
did not implement,GetOut
method,https://github.com/mh-cbon/emd/blob/master/emd/emd.go#L75
They simply returned a formatted string block.
Now that getout method exists, it is possible to change that.
color
, to produce the same output as todaydeprecate
cli / file
, but keep them for compatibility (avoid major bump)add new
exec/cat
the implementation must differ to take advantage of
GetOut
method todirectly write on it, and return only the body response.
The text was updated successfully, but these errors were encountered: