Skip to content

Latest commit

 

History

History
69 lines (48 loc) · 1.92 KB

File metadata and controls

69 lines (48 loc) · 1.92 KB

All Pages Export Flag

Overview

The --all-pages flag provides a streamlined way to export all Confluence pages (not blog posts) without any user interaction. This is designed for automation and batch processing scenarios.

Implementation Details

Flag Behavior

When --all-pages is used:

  • Content Type: Only pages (not blog posts) are exported
  • Content Format: Both markdown and HTML are exported
  • Attachments: Automatically skipped
  • Index File: Automatically created
  • User Input: No prompts or selections required

Code Location

The flag is implemented in src/index.js:

.option('--all-pages', 'Export all pages (not blog posts) without user input - exports as markdown and HTML, skips attachments')

Logic Flow

  1. Flag Detection: Check options.allPages before interactive mode
  2. API Call: Use api.fetchAllPages() to get all pages
  3. Export Options: Set predefined options:
    • contentFormat: 'both'
    • includeAttachments: false
    • createIndex: true
  4. User Feedback: Display clear status messages about what will be exported

Usage Example

npm start -- --all-pages

Output

  • Exports all pages as both .md and .html files
  • Creates export-index.json with metadata
  • Skips all attachments
  • No user prompts or selections

Design Principles

  1. Simplicity: Single flag for complete automation
  2. Predictability: Fixed export options for consistent results
  3. Performance: Skips attachments for faster processing
  4. Completeness: Exports both formats for maximum compatibility

Future Considerations

  • Consider adding --all-blog-posts flag for blog-only exports
  • May add --content-type <type> for more granular control
  • Could add --format override for the all-pages mode

Testing

Test the flag with:

npm start -- --all-pages --dev

This will show verbose output to verify the behavior.