EU Parliament Monitor — API Documentation - v0.9.3
    Preparing search index...

    Function enhanceTradecraftCards

    • Replace the rendered Tradecraft References bullet lists with a pi-card-grid of richly described cards (icon, curated title, curated description, kind-aware CTA). The cards reuse the exact same class hooks as political-intelligence.html, so the site-wide CSS already styles them — no additional CSS is required.

      After the April-2026 reorder the rendered Markdown emits Artifact templates as the first sub-heading and Methodologies as the second, matching how readers encounter the run (artifacts first, methodology library second). The card upgrade follows the same order so the H3 positions stay aligned with the kind-aware CTA labels.

      Falls back to the original Markdown-rendered list when the expected structure (H2 → intro paragraph → Artifact-templates sub-heading → <ul> → Methodologies sub-heading → <ul>) is missing, so partially stripped or unusual articles are not silently corrupted.

      Parameters

      • bodyHtml: string

        The (already-localised) article body HTML

      • lang: LanguageCode

        Target language code for curated titles/descriptions

      Returns string

      Body HTML with the tradecraft section upgraded to cards