Skip to content

Commit 7414705

Browse files
committed
Fix pdf preview
fixes `quarto preview —to pdf` for manuscript projects
1 parent 4cae2e6 commit 7414705

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/project/serve/serve.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ import { handleHttpRequests } from "../../core/http-server.ts";
119119
import { touch } from "../../core/file.ts";
120120
import { staticResource } from "../../preview/preview-static.ts";
121121
import { previewTextContent } from "../../preview/preview-text.ts";
122+
import { kManuscriptType } from "../types/manuscript/manuscript-types.ts";
122123

123124
export const kRenderNone = "none";
124125
export const kRenderDefault = "default";
@@ -474,10 +475,16 @@ async function internalPreviewServer(
474475
const pdfOutputFile = (finalOutput && pdfOutput)
475476
? (): string => {
476477
const project = watcher.project();
477-
return join(
478-
dirname(finalOutput),
479-
bookOutputStem(project.dir, project.config) + ".pdf",
480-
);
478+
if (projType.type == kManuscriptType) {
479+
// For manuscripts, just use the final output as is
480+
return finalOutput;
481+
} else {
482+
const outputFile = join(
483+
dirname(finalOutput),
484+
bookOutputStem(project.dir, project.config) + ".pdf",
485+
);
486+
return outputFile;
487+
}
481488
}
482489
: undefined;
483490

0 commit comments

Comments
 (0)