{"record":{"id":"24e3de9a6575ae59","repo":"jdx/mise","slug":"does-not-contain-the-task-placeholder-start","errorCode":null,"errorMessage":"{} does not contain the `{TASK_PLACEHOLDER_START}` marker required by --inject, add:\n\n{TASK_PLACEHOLDER_START}\n{TASK_PLACEHOLDER_END}","messagePattern":"(.+?) does not contain the `(.+?)` marker required by --inject, add:\n\n(.+?)\n(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/generate/task_docs.rs","lineNumber":145,"sourceCode":"            let mut out = vec![];\n            for task in &visible_tasks {\n                out.push(task.render_markdown(&config).await?);\n            }\n            miseprintln!(\"{}\", out.join(\"\\n\\n\").trim());\n        }\n        Ok(())\n    }\n}\n\n/// Replace everything between the mise-tasks markers in `contents` with `doc`.\n///\n/// Both markers must be present, with the end marker after the start marker. When\n/// a marker is missing this errors instead of writing anything: falling back to\n/// \"the block starts at byte 0\" truncated files that had no markers at all, and\n/// panicked outright on files shorter than the marker (discussions/4676).\nfn inject_task_docs(contents: &str, doc: &str, output: &Path) -> eyre::Result<String> {\n    let Some(start) = contents.find(TASK_PLACEHOLDER_START) else {\n        bail!(\n            \"{} does not contain the `{TASK_PLACEHOLDER_START}` marker required by --inject, add:\\n\\n{TASK_PLACEHOLDER_START}\\n{TASK_PLACEHOLDER_END}\",\n            file::display_path(output)\n        );\n    };\n    let body_start = start + TASK_PLACEHOLDER_START.len();\n    let Some(end) = contents[body_start..]\n        .find(TASK_PLACEHOLDER_END)\n        .map(|e| e + body_start)\n    else {\n        bail!(\n            \"{} contains `{TASK_PLACEHOLDER_START}` but no `{TASK_PLACEHOLDER_END}` after it, --inject requires both markers\",\n            file::display_path(output)\n        );\n    };\n    let mut contents = contents.to_string();\n    contents.replace_range(body_start..end, doc);\n    Ok(contents)\n}","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/cli/generate/task_docs.rs#L127-L163","documentation":"`mise generate task-docs --inject` requires the target doc to contain explicit TASK_PLACEHOLDER_START/END markers between which generated docs are inserted. When the start marker is missing, mise errors instead of guessing (historically it truncated files without markers and panicked on short files — discussion #4676).","triggerScenarios":"inject_task_docs() does not find TASK_PLACEHOLDER_START in the output file's contents; also fires if only the end marker exists or it precedes the start marker.","commonSituations":"Freshly created README/docs file where markers were never added; markers accidentally deleted during editing; wrong --output file passed.","solutions":["Add the marker block to the doc file:\n<!-- start marker -->\n<!-- end marker -->\nat the location where generated docs should appear","Verify you pointed --output at the correct file that contains the markers","Re-generate the doc scaffold if markers were deleted"],"exampleFix":"// before (README.md)\n# Tasks\n// after (README.md)\n# Tasks\n<!-- mise tasks:start -->\n<!-- mise tasks:end -->","handlingStrategy":"validation","validationCode":"grep -q 'mise tasks:start' README.md || echo 'marker missing'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Scaffold docs with the marker block included","Never delete marker comments during doc edits","Guard the inject step in CI to fail early with a clear message"],"tags":["cli","generate","docs","marker"],"backgroundTag":"missing-required-argument","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}