(w io.Writer, doc outputDoc)
| 109 | } |
| 110 | |
| 111 | func genOutputMarkdown(w io.Writer, doc outputDoc) { |
| 112 | const ( |
| 113 | rawString = "This is a *raw* output, for each record it receives a buffer containing the serialized record, plus a list holding a set of fields (`output.fields` in TOML)." |
| 114 | nonRawString = "This is a *non-raw* output, it doesn't receive whole records. Instead it receives a list of fields for each record (`output.fields` in TOML)." |
| 115 | ) |
| 116 | |
| 117 | fmt.Fprintf(w, "## Output *%s*\n", doc.name) |
| 118 | fmt.Fprintln(w) |
| 119 | fmt.Fprintln(w, "### Overview") |
| 120 | if doc.raw { |
| 121 | fmt.Fprintln(w, rawString) |
| 122 | } else { |
| 123 | fmt.Fprintln(w, nonRawString) |
| 124 | } |
| 125 | fmt.Fprintln(w) |
| 126 | fmt.Fprintln(w) |
| 127 | fmt.Fprintln(w, doc.help) |
| 128 | fmt.Fprintln(w) |
| 129 | fmt.Fprintln(w, "### Configuration") |
| 130 | if len(doc.keys) == 0 { |
| 131 | fmt.Fprintf(w, "No configuration available") |
| 132 | } else { |
| 133 | fmt.Fprintf(w, "\nKeys available in the `[output.config]` section:\n\n") |
| 134 | genConfigKeysMarkdown(w, doc.keys) |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | func genUploadMarkdown(w io.Writer, doc uploadDoc) { |
| 139 | fmt.Fprintf(w, "## Upload *%s*\n", doc.name) |
no test coverage detected