|
|
@@ -38,14 +38,14 @@ export async function persistDraftOutline(ctx, { 细纲 }) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-/** 序1 建书 → book.yaml + 大纲/总纲.md + 大纲/第01卷.md + .gitignore + git init + core.quotepath */
|
|
|
+/** 序1 建书 → book.yaml + 大纲/总纲.md + 大纲/卷纲/第01卷.md + .gitignore + git init + core.quotepath */
|
|
|
export async function persistCreateBook(ctx, { book, 总纲, 卷纲 }) {
|
|
|
try {
|
|
|
const gitignore = await buildGitignore(ctx.repoPath, ['.cache/', '工作区/'])
|
|
|
const written = await writeAtomicBatch(ctx.repoPath, [
|
|
|
{ path: 'book.yaml', content: serializeYAML(book) },
|
|
|
{ path: path.join('大纲', '总纲.md'), content: 总纲 },
|
|
|
- { path: path.join('大纲', '第01卷.md'), content: 卷纲 },
|
|
|
+ { path: path.join('大纲', '卷纲', '第01卷.md'), content: 卷纲 },
|
|
|
{ path: '.gitignore', content: gitignore },
|
|
|
])
|
|
|
// P0-2:书仓库工程化(spec quality §3.3 钉死建书流程负责 git init + core.quotepath)
|
|
|
@@ -58,15 +58,15 @@ export async function persistCreateBook(ctx, { book, 总纲, 卷纲 }) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-/** 序4 卷复盘 → 定稿/摘要/卷摘要/NN.md + 大纲/第{卷号+1}卷.md(+ 可选伏笔条目) */
|
|
|
+/** 序4 卷复盘 → 定稿/摘要/卷摘要/第NN卷.md + 大纲/卷纲/第{卷号+1}卷.md(+ 可选伏笔条目) */
|
|
|
export async function persistVolumeReview(ctx, { 卷号, 卷摘要, 下卷卷纲, 伏笔条目 = [] }) {
|
|
|
try {
|
|
|
const files = []
|
|
|
const nn = String(卷号).padStart(2, '0')
|
|
|
- files.push({ path: path.join('定稿', '摘要', '卷摘要', `${nn}.md`), content: 卷摘要 })
|
|
|
+ files.push({ path: path.join('定稿', '摘要', '卷摘要', `第${nn}卷.md`), content: 卷摘要 })
|
|
|
if (下卷卷纲) {
|
|
|
const next = String(卷号 + 1).padStart(2, '0')
|
|
|
- files.push({ path: path.join('大纲', `第${next}卷.md`), content: 下卷卷纲 })
|
|
|
+ files.push({ path: path.join('大纲', '卷纲', `第${next}卷.md`), content: 下卷卷纲 })
|
|
|
}
|
|
|
for (const e of 伏笔条目) {
|
|
|
const body = `---\n${serializeYAML(e.frontMatter || {})}\n---\n${e.body || ''}`
|