applyIDStrategyReplacements replaces sequential-style placeholders in template content.
(content []byte, examples idStrategyExamples)
| 493 | |
| 494 | // applyIDStrategyReplacements replaces sequential-style placeholders in template content. |
| 495 | func applyIDStrategyReplacements(content []byte, examples idStrategyExamples) []byte { |
| 496 | // Only apply if non-sequential (sequential is already the default in templates) |
| 497 | if examples.exampleID == "001" { |
| 498 | return content |
| 499 | } |
| 500 | result := content |
| 501 | result = bytes.ReplaceAll(result, []byte(`id: "001"`), []byte(fmt.Sprintf(`id: "%s"`, examples.exampleID))) |
| 502 | result = bytes.ReplaceAll(result, []byte("015-add-user-auth.md"), []byte(examples.exampleFilename)) |
| 503 | result = bytes.ReplaceAll(result, []byte("NNN-descriptive-title.md"), []byte(examples.filePattern)) |
| 504 | return result |
| 505 | } |
| 506 | |
| 507 | // idStrategySpecSection returns a markdown section documenting the chosen ID strategy. |
| 508 | func idStrategySpecSection(cfg idStrategyConfig) string { |
no outgoing calls