feat: funciones Bash — install_nbconvert, notebook_to_pdf, export_analysis_pdfs
Infra: install_nbconvert (instala nbconvert+deps), notebook_to_pdf (convierte .ipynb a PDF). Pipeline: export_analysis_pdfs (exporta todos los notebooks de analysis/ a PDF). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
# install_nbconvert
|
||||
# ------------------
|
||||
# Instala nbconvert y playwright con chromium en un proyecto uv existente.
|
||||
# Idempotente: uv add no reinstala si los paquetes ya estan presentes.
|
||||
#
|
||||
# USO (sourced):
|
||||
# source install_nbconvert.sh
|
||||
# install_nbconvert /path/to/project
|
||||
|
||||
install_nbconvert() {
|
||||
local project_dir="$1"
|
||||
|
||||
if [ -z "$project_dir" ]; then
|
||||
echo "install_nbconvert: se requiere project_dir" >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ ! -d "$project_dir/.venv" ]; then
|
||||
echo "install_nbconvert: no existe .venv en $project_dir — ejecuta init_uv_venv primero" >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Instalar nbconvert y playwright via uv add
|
||||
(cd "$project_dir" && uv add nbconvert playwright 2>&1)
|
||||
|
||||
# Instalar chromium — capturar output, solo mostrar si hay error
|
||||
local playwright_output
|
||||
if ! playwright_output=$(cd "$project_dir" && uv run playwright install chromium 2>&1); then
|
||||
echo "$playwright_output" >&2
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
Reference in New Issue
Block a user