Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/green-ants-raise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@alauda/doom": patch
---

feat: add exporting log info
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v20.19.1
v20.19.2
2 changes: 1 addition & 1 deletion src/cli/export-pdf-core/generatePdf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export async function generatePdf({
allOutlines,
)

const message = `\nExported to ${yellow(exportedPath)}\n`
const message = `Exported to ${yellow(exportedPath)}\n`
process.stdout.write(message)

await fs.rm(tempDir, { force: true, recursive: true })
Expand Down
2 changes: 1 addition & 1 deletion src/cli/export-pdf-core/utils/mergePDF.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ export async function mergePDF(
const saveFilePath = join(saveDirPath, outFile)

if (pages.length === 0) {
process.stdout.write(
process.stderr.write(
red(
'The website has no pages, please check whether the export path is set correctly',
),
Expand Down
7 changes: 5 additions & 2 deletions src/cli/export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,12 @@ export const exportCommand = new Command('export')
sidebarItems: DoomSidebar[],
lang = config.lang!,
) => {
// console.log(sidebarItems, collectPages(sidebarItems))
const pages = collectPages(sidebarItems)
logger.start(
`Exporting ${lang} language documents with ${pages.length} pages...`,
)
await generatePdf({
pages: collectPages(sidebarItems),
pages,
outFile: getPdfName(lang, config.userBase, config.title),
...commonOptions,
})
Expand Down