Files
wordpress-export-to-markdown/src/questions.js
T

129 lines
2.1 KiB
JavaScript
Raw Normal View History

2025-01-27 09:30:28 -05:00
import * as inquirer from '@inquirer/prompts';
// questions with a description are displayed in command line help
// questions with a prompt are included in the wizard (if not set on the command line)
2025-01-27 09:30:28 -05:00
export const all = [
{
name: 'wizard',
type: 'boolean',
description: 'Use wizard',
default: true
},
2025-01-27 09:30:28 -05:00
{
name: 'input',
type: 'file-path',
description: 'Path to WordPress export file',
default: 'export.xml',
prompt: inquirer.input
},
{
name: 'post-folders',
type: 'boolean',
description: 'Put each post into its own folder',
default: true,
choices: [
{
name: 'Yes',
value: true
2025-01-27 09:30:28 -05:00
},
{
name: 'No',
value: false
2025-01-27 09:30:28 -05:00
}
],
2025-01-27 17:12:17 -05:00
isPathQuestion: true,
2025-01-27 09:30:28 -05:00
prompt: inquirer.select
},
{
name: 'prefix-date',
type: 'boolean',
description: 'Prefix with date',
default: false,
choices: [
{
name: 'Yes',
value: true
2025-01-27 09:30:28 -05:00
},
{
name: 'No',
value: false
2025-01-27 09:30:28 -05:00
}
],
2025-01-27 17:12:17 -05:00
isPathQuestion: true,
2025-01-27 09:30:28 -05:00
prompt: inquirer.select
},
{
name: 'date-folders',
type: 'choice',
description: 'Organize into folders based on date',
default: 'none',
choices: [
{
name: 'Year folders',
value: 'year'
2025-01-27 09:30:28 -05:00
},
{
name: 'Year and month folders',
value: 'year-month'
2025-01-27 09:30:28 -05:00
},
{
name: 'No',
value: 'none'
2025-01-27 09:30:28 -05:00
}
],
2025-01-27 17:12:17 -05:00
isPathQuestion: true,
2025-01-27 09:30:28 -05:00
prompt: inquirer.select
},
{
name: 'save-images',
type: 'choice',
description: 'Save images',
default: 'all',
choices: [
{
name: 'Images attached to posts',
value: 'attached'
},
{
name: 'Images scraped from post body content',
value: 'scraped'
},
{
name: 'Both',
value: 'all'
},
{
name: 'No',
value: 'none'
}
],
prompt: inquirer.select
2025-01-31 13:11:07 -05:00
},
{
name: 'output',
type: 'folder-path',
description: 'Path to output folder',
default: 'output'
},
{
name: 'frontmatter-fields',
type: 'list',
default: ['title', 'date', 'categories', 'tags', 'coverImage']
},
{
name: 'image-file-request-delay',
type: 'integer',
default: 500
},
{
name: 'markdown-file-write-delay',
type: 'integer',
default: 25
},
{
name: 'include-time-with-date',
type: 'boolean',
default: false
},
2025-01-27 09:30:28 -05:00
];