---
name: export_analysis_pdfs
kind: pipeline
lang: bash
domain: pipelines
version: "1.0.0"
purity: impure
signature: "export_analysis_pdfs(nombre: string, [pattern: string]) -> void"
description: "Exporta todos los notebooks de un analisis Jupyter a PDF. Instala nbconvert y playwright automaticamente si no estan presentes."
tags: [pipeline, jupyter, pdf, export, nbconvert, launcher]
uses_functions:
  - assert_command_exists_bash_shell
  - install_nbconvert_bash_infra
  - notebook_to_pdf_bash_infra
uses_types: []
returns: []
returns_optional: false
error_type: "error_go_core"
imports: []
params:
  - name: nombre
    desc: "nombre del análisis en analysis/{nombre}/"
  - name: pattern
    desc: "glob de notebooks a exportar (default: notebooks/*.ipynb)"
output: "sin salida directa; genera PDFs en notebooks/pdf/"
tested: false
tests: []
test_file_path: ""
file_path: "bash/functions/pipelines/export_analysis_pdfs.sh"
---

## Ejemplo

```bash
# Exportar todos los notebooks de un analisis
./export_analysis_pdfs.sh finanzas

# Con pattern especifico
./export_analysis_pdfs.sh ml "notebooks/01_*.ipynb"

# Via fn run
fn run export_analysis_pdfs finanzas
fn run export_analysis_pdfs ml "notebooks/01_*.ipynb"
```

## Flujo

1. `assert_command_exists uv` — verifica que uv esta disponible
2. `install_nbconvert` — instala nbconvert y playwright con chromium (idempotente)
3. `notebook_to_pdf` — convierte notebooks al patron indicado a PDF en `notebooks/pdf/`

## Notas

El analysis debe existir previamente en `analysis/{nombre}/` con un venv inicializado. Los PDFs se generan en `analysis/{nombre}/notebooks/pdf/` por defecto. El pipeline usa `set -euo pipefail` — cualquier fallo detiene la ejecucion.
