| 294 | } |
| 295 | |
| 296 | func validateOutputPaths(inputs []input, hasChildren map[string]bool) error { |
| 297 | seen := make(map[string]string, len(inputs)) |
| 298 | for _, in := range inputs { |
| 299 | outRel := in.outputPath(hasChildren) |
| 300 | if previous, ok := seen[outRel]; ok { |
| 301 | return fmt.Errorf("docpost: output path collision %q for %s and %s", outRel, previous, in.fileName) |
| 302 | } |
| 303 | seen[outRel] = in.fileName |
| 304 | } |
| 305 | return nil |
| 306 | } |
| 307 | |
| 308 | // remapLinks rewrites any `](agh_xxx)` link target in the body to its |
| 309 | // absolute URL under linkBasePath. Runs after TransformMarkdown has already |