EU Parliament Monitor — API Documentation - v1.0.6
    Preparing search index...

    Module Aggregator/ArticleGenerator

    Barrel + thin CLI entry point for the article generator.

    The library was split (Refactor 7/8) into focused sub-modules under ./generator/ so the public API is importable without CLI side-effects:

    • ./generator/cli.tsparseCliArgs, CliOptions
    • ./generator/slug.ts — slug + default-description helpers
    • ./generator/discovery.tsdiscoverAnalysisRuns, grouping
    • ./generator/reader-guide-insertion.ts— Reader guide splice helper
    • ./generator/render-one.tsgenerateArticle(...) single-run
    • ./generator/render-batch.tsgenerateAllArticles(opts)

    This file remains the compiled CLI entry — npm run generate-article resolves to scripts/aggregator/article-generator.js. The process.exit, console.log, and process.argv side-effects live inside the isMain block below so that programmatic importers (production aggregator code, the test suite, downstream curators) see only the pure barrel exports.

    Always-14-languages-always-HTML contract: every CLI invocation renders every supported language to HTML. The legacy --lang / --language / --markdown-only flags have been removed. The programmatic generateArticle() API still accepts langs and markdownOnly for tests that need to scope a render for speed.

    Functions

    main
    parseCliArgs → parseCliArgs
    buildArticleSlug → buildArticleSlug
    sanitizeRunSuffix → sanitizeRunSuffix
    extractDefaultDescription → extractDefaultDescription
    discoverAnalysisRuns → discoverAnalysisRuns
    groupRunsForCollision → groupRunsForCollision
    insertReaderGuideAfterExecutiveBrief → insertReaderGuideAfterExecutiveBrief
    estimateReadingMinutes → estimateReadingMinutes
    buildLayerReadingTimes → buildLayerReadingTimes
    splitBodyIntoDisclosureLayers → splitBodyIntoDisclosureLayers
    generateArticle → generateArticle
    generateAllArticles → generateAllArticles

    Interfaces

    CliOptions → CliOptions
    GenerateResult → GenerateResult

    Type Aliases

    DiscoveredRun → DiscoveredRun