Process reads markdown from the given io.Reader searching for an embedmd command. When a command is found, it is executed and the output is written into the given io.Writer with the rest of standard markdown.
(ctx context.Context, out io.Writer, in io.Reader, opts ...Option)
| 63 | // command. When a command is found, it is executed and the output is written |
| 64 | // into the given io.Writer with the rest of standard markdown. |
| 65 | func Process(ctx context.Context, out io.Writer, in io.Reader, opts ...Option) error { |
| 66 | e := embedder{Fetcher: fetcher{}} |
| 67 | for _, opt := range opts { |
| 68 | opt.f(&e) |
| 69 | } |
| 70 | return process(out, in, e.runCommand) |
| 71 | } |
| 72 | |
| 73 | // An Option provides a way to adapt the Process function to your needs. |
| 74 | type Option struct{ f func(*embedder) } |
searching dependent graphs…