specleap-framework 2.1.11 → 2.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/README.md +76 -7
- package/SETUP.md +99 -8
- package/package.json +1 -1
- package/scripts/convert-docs.sh +165 -0
- package/setup.sh +32 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,36 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [2.1.13] - 2026-05-01
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- **Confusion between the two install flows.** Reported by Styng during testing: with `git clone … && bash setup.sh`, the installer was not asking the carpeta-base / folder-name prompts that `bin/specleap` (the npx entry point) does ask. That looked like a regression but it's by design — the prompts live in `bin/specleap` (Node), not in `setup.sh` (bash). When the user clones with git they already chose where the code lives, and the second positional argument of `git clone` is the canonical way to set a custom folder name. The fix is making the difference obvious in docs and in runtime.
|
|
15
|
+
|
|
16
|
+
#### Changes
|
|
17
|
+
|
|
18
|
+
- `setup.sh` now prints a bilingual heads-up at the very start (before the language step) when the current folder is named `specleap-framework` (the `git clone` default) AND the script was invoked without `bin/specleap` having set `SPECLEAP_INSTALL_PATH`. The user gets a one-second pause, an explanation of how to clone with a custom name (`git clone <url> mi-proyecto`), and a [S/n] confirmation before continuing. If they cancel, the script exits 0 cleanly.
|
|
19
|
+
- `README.md`: rewrote the "Instalación Rápida" section as two clearly-labeled options (Opción A: vía npx — interactive prompts; Opción B: vía git clone — direct, name controlled by `git clone <url> <nombre>`) plus a comparison table so the reader picks intentionally.
|
|
20
|
+
- `SETUP.md`: replicated the same comparison upfront in the Quick Start section, with full examples for each path.
|
|
21
|
+
|
|
22
|
+
### Notes
|
|
23
|
+
|
|
24
|
+
- No code-path change in the actual installation logic. `bin/specleap` keeps its prompts; `setup.sh` runs the same setup it always ran. Only documentation and a single pre-check in `setup.sh` change.
|
|
25
|
+
- The pre-check in `setup.sh` is opt-out (Enter or `S` to continue), so users who really want a folder named `specleap-framework` aren't forced to do anything extra.
|
|
26
|
+
|
|
27
|
+
## [2.1.12] - 2026-04-30
|
|
28
|
+
|
|
29
|
+
### Added
|
|
30
|
+
|
|
31
|
+
- **`scripts/convert-docs.sh`** — wrapper sobre [Microsoft markitdown](https://github.com/microsoft/markitdown) para convertir PDF, Word, PowerPoint, Excel, HTML, CSV, JSON, XML, EPub, imágenes (OCR) y audio (transcripción) a Markdown que el framework pueda usar como contexto. markitdown es una **dependencia opcional** (no se incluye en el tarball npm, no se instala automáticamente): si no está presente, el script muestra el mensaje de instalación (`pip install markitdown` o `uv tool install markitdown`) y termina con exit 1 sin tocar ningún archivo. Bilingüe ES/EN según `SPECLEAP_LANG`.
|
|
32
|
+
- Acepta tanto un archivo individual (`brief.pdf` → `brief.md`) como una carpeta entera (recursivo, max 3 niveles, filtra por extensiones soportadas).
|
|
33
|
+
- Documentación en `README.md` (sección "Convertir documentos a Markdown") y `SETUP.md` (sección "Herramientas Opcionales") con caso de uso típico (briefs de cliente, user stories exportadas, reference docs).
|
|
34
|
+
|
|
35
|
+
### Notes
|
|
36
|
+
|
|
37
|
+
- Decisión de diseño: markitdown se queda como opcional para no imponer Python 3.10+ a usuarios que no lo necesiten. SpecLeap solo requiere bash + node + git + curl + jq como antes.
|
|
38
|
+
- Caso de uso típico: cliente entrega brief en PDF → `bash scripts/convert-docs.sh brief.pdf` → `brief.md` → se referencia desde el cuestionario inicial. El AI gana contexto rico desde el primer comando.
|
|
39
|
+
|
|
10
40
|
## [2.1.11] - 2026-04-30
|
|
11
41
|
|
|
12
42
|
### Fixed
|
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
SpecLeap convierte cualquier IDE con asistente de IA en un entorno de desarrollo spec-first. Combina un contrato de proyecto inmutable, agentes conversacionales especializados, 34 Agent Skills profesionales y un pipeline de validación en tres capas para entregar código consistente y probado sin improvisación.
|
|
22
22
|
|
|
23
|
-
**Versión actual:** 2.1.
|
|
23
|
+
**Versión actual:** 2.1.13 · **Licencia:** MIT · **Autor:** Styng Arias ([ConceptualCreative](https://conceptualcreative.com))
|
|
24
24
|
|
|
25
25
|
---
|
|
26
26
|
|
|
@@ -44,23 +44,57 @@ SpecLeap convierte cualquier IDE con asistente de IA en un entorno de desarrollo
|
|
|
44
44
|
|
|
45
45
|
## Instalación Rápida
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
Hay dos formas de instalar SpecLeap. Elige según tu preferencia:
|
|
48
|
+
|
|
49
|
+
### Opción A: Vía npm (instalación interactiva, recomendado)
|
|
48
50
|
|
|
49
51
|
```bash
|
|
50
52
|
npx specleap-framework@latest
|
|
51
53
|
```
|
|
52
54
|
|
|
53
|
-
|
|
55
|
+
El instalador te **pregunta dónde quieres la carpeta y con qué nombre** antes de copiar nada. Ideal si quieres un setup guiado paso a paso.
|
|
56
|
+
|
|
57
|
+
Ejemplo de lo que verás:
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
📁 ¿En qué carpeta base instalar SpecLeap?
|
|
61
|
+
Default: /Users/tu-usuario/Desktop
|
|
62
|
+
Carpeta base: ~/Downloads
|
|
63
|
+
|
|
64
|
+
📝 ¿Qué nombre quieres para la carpeta?
|
|
65
|
+
Default: specleap-framework
|
|
66
|
+
Nombre: mi-app-tienda
|
|
67
|
+
|
|
68
|
+
→ Resultado: /Users/tu-usuario/Downloads/mi-app-tienda/
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Opción B: Vía git clone (control directo, sin prompts)
|
|
54
72
|
|
|
55
73
|
```bash
|
|
56
|
-
git clone https://github.com/ConceptualCreative/specleap-framework.git
|
|
57
|
-
cd
|
|
74
|
+
git clone https://github.com/ConceptualCreative/specleap-framework.git mi-proyecto
|
|
75
|
+
cd mi-proyecto
|
|
58
76
|
bash setup.sh
|
|
59
77
|
```
|
|
60
78
|
|
|
61
|
-
|
|
79
|
+
Aquí **tú decides el nombre** pasándolo como segundo argumento de `git clone`. El setup arranca directo, sin preguntar carpeta/nombre porque ya estás dentro del repo donde quieres.
|
|
62
80
|
|
|
63
|
-
|
|
81
|
+
Si haces `git clone <url>` sin segundo argumento, la carpeta se llamará `specleap-framework` (default de git). El setup te avisará por si querías otro nombre.
|
|
82
|
+
|
|
83
|
+
### Diferencias rápidas
|
|
84
|
+
|
|
85
|
+
| | Vía npm | Vía git clone |
|
|
86
|
+
|---|---|---|
|
|
87
|
+
| **Pregunta carpeta y nombre** | ✅ Sí, interactivo | ❌ No, lo decides con `cd` y `git clone <url> <nombre>` |
|
|
88
|
+
| **Requiere Node.js** | ✅ Sí (≥ 18) | ⛔ No, solo Git + Bash |
|
|
89
|
+
| **Trae los archivos** | npm los descarga | git los clona del repo |
|
|
90
|
+
| **Ideal para** | Empezar rápido, no recordar el flujo de git | Devs que ya manejan git fluidamente |
|
|
91
|
+
|
|
92
|
+
A partir de aquí ambos flows son idénticos: el `setup.sh` solicita los tokens de GitHub y Asana, instala los 34 Agent Skills en `~/.skills/` y genera la estructura base. Tiempo total: 10 a 15 minutos.
|
|
93
|
+
|
|
94
|
+
**Requisitos previos:**
|
|
95
|
+
|
|
96
|
+
- Vía npm → Node.js ≥ 18, Git, Bash.
|
|
97
|
+
- Vía git clone → Git, Bash.
|
|
64
98
|
|
|
65
99
|
---
|
|
66
100
|
|
|
@@ -245,6 +279,41 @@ Ambos modos coexisten. Lo habitual es trabajar conversacionalmente en el día a
|
|
|
245
279
|
|
|
246
280
|
---
|
|
247
281
|
|
|
282
|
+
## Convertir documentos a Markdown (opcional)
|
|
283
|
+
|
|
284
|
+
Si tienes el brief de un cliente en PDF, user stories en Word, o specs antiguas en Excel, SpecLeap incluye un wrapper sobre [Microsoft markitdown](https://github.com/microsoft/markitdown) para convertirlos a Markdown que el framework pueda usar como contexto.
|
|
285
|
+
|
|
286
|
+
**Instalación de markitdown** (dependencia opcional):
|
|
287
|
+
|
|
288
|
+
```bash
|
|
289
|
+
pip install markitdown
|
|
290
|
+
# o, si usas uv:
|
|
291
|
+
uv tool install markitdown
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
Requiere Python 3.10+. No es obligatorio: SpecLeap funciona perfectamente sin él. Solo lo necesitas si vas a alimentar archivos no-Markdown.
|
|
295
|
+
|
|
296
|
+
**Uso:**
|
|
297
|
+
|
|
298
|
+
```bash
|
|
299
|
+
# Un archivo individual
|
|
300
|
+
bash scripts/convert-docs.sh brief.pdf
|
|
301
|
+
# → genera brief.md
|
|
302
|
+
|
|
303
|
+
# Una carpeta entera (recursivo, max 3 niveles)
|
|
304
|
+
bash scripts/convert-docs.sh ./briefings/
|
|
305
|
+
# → convierte todos los pdf/docx/xlsx/pptx/html/csv/json/xml/epub que encuentre
|
|
306
|
+
|
|
307
|
+
# Ayuda
|
|
308
|
+
bash scripts/convert-docs.sh --help
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
Formatos soportados: **PDF, Word, PowerPoint, Excel, HTML, CSV, JSON, XML, EPub, imágenes (con OCR), audio (con transcripción)**.
|
|
312
|
+
|
|
313
|
+
Si markitdown no está instalado, el script muestra un mensaje claro con las instrucciones de instalación y termina sin tocar nada.
|
|
314
|
+
|
|
315
|
+
---
|
|
316
|
+
|
|
248
317
|
## Preguntas Frecuentes (FAQ)
|
|
249
318
|
|
|
250
319
|
Las preguntas habituales están respondidas en archivos dedicados:
|
package/SETUP.md
CHANGED
|
@@ -2,23 +2,70 @@
|
|
|
2
2
|
|
|
3
3
|
## ⚡ Quick Start (5 minutos)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Hay **dos formas de instalar SpecLeap**. Elige la que prefieras según cómo te resulte más cómodo trabajar.
|
|
6
|
+
|
|
7
|
+
### Comparativa rápida
|
|
8
|
+
|
|
9
|
+
| | Opción A: vía npx | Opción B: vía git clone |
|
|
10
|
+
|---|---|---|
|
|
11
|
+
| **Pregunta carpeta y nombre** | ✅ Sí, prompt interactivo | ❌ No (lo decides con `cd` y `git clone <url> <nombre>`) |
|
|
12
|
+
| **Requiere** | Node.js ≥ 18, Git, Bash | Git, Bash |
|
|
13
|
+
| **Cuándo usar** | Quieres setup guiado | Manejas git fluidamente |
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
### Opción A: vía npx (recomendado para empezar)
|
|
6
18
|
|
|
7
19
|
```bash
|
|
8
|
-
|
|
9
|
-
|
|
20
|
+
cd ~/Downloads # o donde quieras que vaya el proyecto
|
|
21
|
+
npx specleap-framework@latest
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
El instalador te pregunta:
|
|
25
|
+
1. **Carpeta base** (default = donde estás).
|
|
26
|
+
2. **Nombre de la carpeta** (default = `specleap-framework`).
|
|
27
|
+
|
|
28
|
+
Después continúa con el setup normal (idioma, GitHub token, Asana token, skills, CodeRabbit).
|
|
29
|
+
|
|
30
|
+
**Ejemplo:**
|
|
31
|
+
|
|
10
32
|
```
|
|
33
|
+
📁 ¿En qué carpeta base instalar SpecLeap?
|
|
34
|
+
Default: /Users/tu-usuario/Downloads
|
|
35
|
+
Carpeta base: (Enter para usar default)
|
|
11
36
|
|
|
12
|
-
|
|
37
|
+
📝 ¿Qué nombre quieres para la carpeta?
|
|
38
|
+
Default: specleap-framework
|
|
39
|
+
Nombre: mi-app-tienda
|
|
40
|
+
|
|
41
|
+
→ Resultado final: /Users/tu-usuario/Downloads/mi-app-tienda/
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
### Opción B: vía git clone
|
|
13
47
|
|
|
14
48
|
```bash
|
|
15
|
-
|
|
49
|
+
# Clona el repo con el nombre que tú quieras (segundo argumento de git clone)
|
|
50
|
+
git clone https://github.com/ConceptualCreative/specleap-framework.git mi-proyecto
|
|
51
|
+
cd mi-proyecto
|
|
52
|
+
bash setup.sh
|
|
16
53
|
```
|
|
17
54
|
|
|
18
|
-
**
|
|
55
|
+
Aquí **no hay prompts de carpeta o nombre** — ya estás dentro de `mi-proyecto/` que tú nombraste con git. El `setup.sh` arranca directo con la selección de idioma.
|
|
56
|
+
|
|
57
|
+
Si haces `git clone <url>` **sin segundo argumento**, la carpeta se llamará `specleap-framework` por defecto. El setup te avisará por si esperabas otro nombre y te ofrecerá cancelar.
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
### Después del setup (ambas opciones)
|
|
62
|
+
|
|
63
|
+
**Qué hace `setup.sh`:**
|
|
19
64
|
- Selecciona idioma (Español/English)
|
|
20
|
-
-
|
|
21
|
-
-
|
|
65
|
+
- Pide tokens GitHub y Asana
|
|
66
|
+
- Instala los 34 Agent Skills en `~/.skills/`
|
|
67
|
+
- Configura CodeRabbit
|
|
68
|
+
- Crea estructura base + archivos de configuración
|
|
22
69
|
|
|
23
70
|
### Paso 3: Responder cuestionario
|
|
24
71
|
|
|
@@ -254,6 +301,50 @@ El commit es rechazado. Corrige y vuelve a intentar.
|
|
|
254
301
|
|
|
255
302
|
---
|
|
256
303
|
|
|
304
|
+
## 🔄 Herramientas Opcionales
|
|
305
|
+
|
|
306
|
+
### markitdown — Convertir PDF/Word/Excel a Markdown
|
|
307
|
+
|
|
308
|
+
Útil cuando un cliente te entrega el brief en PDF, las user stories en Word, o cualquier doc de referencia que quieras alimentar a SpecLeap como contexto. **No es obligatorio**: SpecLeap funciona sin él, sólo lo necesitas si trabajas con archivos no-Markdown.
|
|
309
|
+
|
|
310
|
+
**Requisito previo:** Python 3.10 o superior.
|
|
311
|
+
|
|
312
|
+
**Instalación:**
|
|
313
|
+
|
|
314
|
+
```bash
|
|
315
|
+
pip install markitdown
|
|
316
|
+
# o, si prefieres uv:
|
|
317
|
+
uv tool install markitdown
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
**Uso (vía wrapper de SpecLeap):**
|
|
321
|
+
|
|
322
|
+
```bash
|
|
323
|
+
# Un archivo
|
|
324
|
+
bash scripts/convert-docs.sh ./brief-cliente.pdf
|
|
325
|
+
|
|
326
|
+
# Una carpeta entera (max 3 niveles de profundidad)
|
|
327
|
+
bash scripts/convert-docs.sh ./referencias/
|
|
328
|
+
|
|
329
|
+
# Ayuda
|
|
330
|
+
bash scripts/convert-docs.sh --help
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
**Formatos soportados:** PDF, Word (.docx), PowerPoint (.pptx), Excel (.xlsx), HTML, CSV, JSON, XML, EPub, imágenes (con OCR), audio (con transcripción).
|
|
334
|
+
|
|
335
|
+
Si markitdown no está instalado, el script muestra el mensaje de instalación y termina con exit 1. No toca ningún archivo. Es seguro ejecutarlo aunque no lo tengas.
|
|
336
|
+
|
|
337
|
+
**Caso típico de uso en SpecLeap:**
|
|
338
|
+
|
|
339
|
+
1. Recibes el brief de un cliente en PDF.
|
|
340
|
+
2. `bash scripts/convert-docs.sh ./brief.pdf` → genera `brief.md`.
|
|
341
|
+
3. Lo pegas o referencias en el cuestionario al responder "¿Qué hace este proyecto?" / "¿Qué problema resuelve?".
|
|
342
|
+
4. El AI tiene contexto rico desde el primer comando.
|
|
343
|
+
|
|
344
|
+
Más info sobre markitdown: https://github.com/microsoft/markitdown
|
|
345
|
+
|
|
346
|
+
---
|
|
347
|
+
|
|
257
348
|
## 📚 Documentación Completa
|
|
258
349
|
|
|
259
350
|
### Guías Detalladas
|
package/package.json
CHANGED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# SpecLeap — Wrapper para convertir documentos a Markdown.
|
|
3
|
+
#
|
|
4
|
+
# Usa Microsoft markitdown (https://github.com/microsoft/markitdown) por
|
|
5
|
+
# debajo. markitdown es una dependencia OPCIONAL: si no está instalada,
|
|
6
|
+
# este script muestra cómo instalarla y termina sin tocar nada.
|
|
7
|
+
#
|
|
8
|
+
# Formatos soportados (por markitdown): PDF, Word (.docx), PowerPoint
|
|
9
|
+
# (.pptx), Excel (.xlsx), HTML, imágenes (con OCR), audio (con
|
|
10
|
+
# transcripción), CSV, JSON, XML, ZIP, EPub, YouTube URLs.
|
|
11
|
+
#
|
|
12
|
+
# Uso:
|
|
13
|
+
# bash scripts/convert-docs.sh <archivo-o-carpeta>
|
|
14
|
+
#
|
|
15
|
+
# Ejemplos:
|
|
16
|
+
# bash scripts/convert-docs.sh brief.pdf
|
|
17
|
+
# bash scripts/convert-docs.sh ./docs/
|
|
18
|
+
# bash scripts/convert-docs.sh user-stories.docx
|
|
19
|
+
|
|
20
|
+
set -euo pipefail
|
|
21
|
+
|
|
22
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
23
|
+
|
|
24
|
+
# ─── Detectar idioma ──────────────────────────────────────────────────────
|
|
25
|
+
SPECLEAP_LANG="${SPECLEAP_LANG:-}"
|
|
26
|
+
|
|
27
|
+
if [ -z "$SPECLEAP_LANG" ] && [ -f "$SCRIPT_DIR/../.specleap/config.json" ]; then
|
|
28
|
+
SPECLEAP_LANG=$(grep -o '"language": "[^"]*"' "$SCRIPT_DIR/../.specleap/config.json" 2>/dev/null | cut -d'"' -f4 || true)
|
|
29
|
+
fi
|
|
30
|
+
SPECLEAP_LANG="${SPECLEAP_LANG:-es}"
|
|
31
|
+
|
|
32
|
+
# ─── Mensajes bilingües ───────────────────────────────────────────────────
|
|
33
|
+
if [ "$SPECLEAP_LANG" = "en" ]; then
|
|
34
|
+
MSG_USAGE="Usage: bash scripts/convert-docs.sh <file-or-directory>"
|
|
35
|
+
MSG_NOT_INSTALLED="markitdown is not installed."
|
|
36
|
+
MSG_INSTALL_TIP="Install with: pip install markitdown (or: uv tool install markitdown)"
|
|
37
|
+
MSG_PYTHON_REQ="Requires Python 3.10 or higher."
|
|
38
|
+
MSG_DOCS="Docs: https://github.com/microsoft/markitdown"
|
|
39
|
+
MSG_CONVERTING="Converting"
|
|
40
|
+
MSG_DONE="Done"
|
|
41
|
+
MSG_NOT_FOUND="File or directory not found"
|
|
42
|
+
MSG_CONVERTED_TO="→"
|
|
43
|
+
MSG_NO_FILES="No convertible files found in"
|
|
44
|
+
MSG_SUMMARY="Summary"
|
|
45
|
+
MSG_FAIL="FAIL"
|
|
46
|
+
MSG_PROCESSING_DIR="Processing directory"
|
|
47
|
+
MSG_HELP_INTRO="Convert documents (PDF, Word, Excel, HTML, etc.) to Markdown using markitdown."
|
|
48
|
+
MSG_HELP_FORMATS="Supported formats: PDF, DOCX, PPTX, XLSX, HTML, CSV, JSON, XML, EPub, images, audio."
|
|
49
|
+
MSG_HELP_EXAMPLES="Examples:"
|
|
50
|
+
else
|
|
51
|
+
MSG_USAGE="Uso: bash scripts/convert-docs.sh <archivo-o-carpeta>"
|
|
52
|
+
MSG_NOT_INSTALLED="markitdown no está instalado."
|
|
53
|
+
MSG_INSTALL_TIP="Instala con: pip install markitdown (o: uv tool install markitdown)"
|
|
54
|
+
MSG_PYTHON_REQ="Requiere Python 3.10 o superior."
|
|
55
|
+
MSG_DOCS="Docs: https://github.com/microsoft/markitdown"
|
|
56
|
+
MSG_CONVERTING="Convirtiendo"
|
|
57
|
+
MSG_DONE="Listo"
|
|
58
|
+
MSG_NOT_FOUND="Archivo o carpeta no encontrado"
|
|
59
|
+
MSG_CONVERTED_TO="→"
|
|
60
|
+
MSG_NO_FILES="No se encontraron archivos convertibles en"
|
|
61
|
+
MSG_SUMMARY="Resumen"
|
|
62
|
+
MSG_FAIL="FALLO"
|
|
63
|
+
MSG_PROCESSING_DIR="Procesando carpeta"
|
|
64
|
+
MSG_HELP_INTRO="Convierte documentos (PDF, Word, Excel, HTML, etc.) a Markdown usando markitdown."
|
|
65
|
+
MSG_HELP_FORMATS="Formatos soportados: PDF, DOCX, PPTX, XLSX, HTML, CSV, JSON, XML, EPub, imágenes, audio."
|
|
66
|
+
MSG_HELP_EXAMPLES="Ejemplos:"
|
|
67
|
+
fi
|
|
68
|
+
|
|
69
|
+
# ─── Colores ──────────────────────────────────────────────────────────────
|
|
70
|
+
if [[ -t 1 ]]; then
|
|
71
|
+
RED='\033[0;31m'
|
|
72
|
+
GREEN='\033[0;32m'
|
|
73
|
+
YELLOW='\033[1;33m'
|
|
74
|
+
CYAN='\033[0;36m'
|
|
75
|
+
BOLD='\033[1m'
|
|
76
|
+
NC='\033[0m'
|
|
77
|
+
else
|
|
78
|
+
RED=''; GREEN=''; YELLOW=''; CYAN=''; BOLD=''; NC=''
|
|
79
|
+
fi
|
|
80
|
+
|
|
81
|
+
# ─── Help ─────────────────────────────────────────────────────────────────
|
|
82
|
+
show_help() {
|
|
83
|
+
echo "$MSG_HELP_INTRO"
|
|
84
|
+
echo ""
|
|
85
|
+
echo "$MSG_USAGE"
|
|
86
|
+
echo ""
|
|
87
|
+
echo "$MSG_HELP_FORMATS"
|
|
88
|
+
echo ""
|
|
89
|
+
echo "$MSG_HELP_EXAMPLES"
|
|
90
|
+
echo " bash scripts/convert-docs.sh brief.pdf"
|
|
91
|
+
echo " bash scripts/convert-docs.sh ./docs/"
|
|
92
|
+
echo " bash scripts/convert-docs.sh user-stories.docx"
|
|
93
|
+
echo ""
|
|
94
|
+
echo "$MSG_DOCS"
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if [ $# -lt 1 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
|
|
98
|
+
show_help
|
|
99
|
+
exit 0
|
|
100
|
+
fi
|
|
101
|
+
|
|
102
|
+
# ─── Verificar markitdown instalado ───────────────────────────────────────
|
|
103
|
+
if ! command -v markitdown >/dev/null 2>&1; then
|
|
104
|
+
echo -e "${RED}❌ $MSG_NOT_INSTALLED${NC}"
|
|
105
|
+
echo ""
|
|
106
|
+
echo -e "${YELLOW}💡 $MSG_INSTALL_TIP${NC}"
|
|
107
|
+
echo -e " $MSG_PYTHON_REQ"
|
|
108
|
+
echo ""
|
|
109
|
+
echo -e "${CYAN}📖 $MSG_DOCS${NC}"
|
|
110
|
+
exit 1
|
|
111
|
+
fi
|
|
112
|
+
|
|
113
|
+
INPUT="$1"
|
|
114
|
+
if [ ! -e "$INPUT" ]; then
|
|
115
|
+
echo -e "${RED}❌ $MSG_NOT_FOUND: $INPUT${NC}"
|
|
116
|
+
exit 1
|
|
117
|
+
fi
|
|
118
|
+
|
|
119
|
+
# ─── Conversión ────────────────────────────────────────────────────────────
|
|
120
|
+
CONVERTED_OK=0
|
|
121
|
+
CONVERTED_FAIL=0
|
|
122
|
+
|
|
123
|
+
convert_one() {
|
|
124
|
+
local file="$1"
|
|
125
|
+
local base="${file%.*}"
|
|
126
|
+
local out="${base}.md"
|
|
127
|
+
|
|
128
|
+
echo -ne " ${CYAN}→${NC} $MSG_CONVERTING $(basename "$file") ... "
|
|
129
|
+
if markitdown "$file" > "$out" 2>/dev/null; then
|
|
130
|
+
echo -e "${GREEN}✅${NC} $MSG_CONVERTED_TO $(basename "$out")"
|
|
131
|
+
CONVERTED_OK=$((CONVERTED_OK + 1))
|
|
132
|
+
else
|
|
133
|
+
echo -e "${RED}❌ $MSG_FAIL${NC}"
|
|
134
|
+
# No dejar archivo .md basura si falló
|
|
135
|
+
rm -f "$out"
|
|
136
|
+
CONVERTED_FAIL=$((CONVERTED_FAIL + 1))
|
|
137
|
+
fi
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
if [ -f "$INPUT" ]; then
|
|
141
|
+
convert_one "$INPUT"
|
|
142
|
+
elif [ -d "$INPUT" ]; then
|
|
143
|
+
echo -e "${BOLD}📁 $MSG_PROCESSING_DIR: $INPUT${NC}"
|
|
144
|
+
echo ""
|
|
145
|
+
|
|
146
|
+
# Extensiones que markitdown soporta
|
|
147
|
+
EXTENSIONS=(pdf docx xlsx pptx html htm csv json xml epub rtf odt ods odp txt)
|
|
148
|
+
FOUND_ANY=0
|
|
149
|
+
|
|
150
|
+
for ext in "${EXTENSIONS[@]}"; do
|
|
151
|
+
while IFS= read -r -d '' file; do
|
|
152
|
+
convert_one "$file"
|
|
153
|
+
FOUND_ANY=1
|
|
154
|
+
done < <(find "$INPUT" -maxdepth 3 -type f -iname "*.${ext}" -print0 2>/dev/null)
|
|
155
|
+
done
|
|
156
|
+
|
|
157
|
+
if [ $FOUND_ANY -eq 0 ]; then
|
|
158
|
+
echo -e "${YELLOW}⚠️ $MSG_NO_FILES $INPUT${NC}"
|
|
159
|
+
echo " (pdf, docx, xlsx, pptx, html, csv, json, xml, epub, ...)"
|
|
160
|
+
exit 0
|
|
161
|
+
fi
|
|
162
|
+
fi
|
|
163
|
+
|
|
164
|
+
echo ""
|
|
165
|
+
echo -e "${GREEN}✅ $MSG_DONE${NC} — $MSG_SUMMARY: ${BOLD}$CONVERTED_OK${NC} OK, ${BOLD}$CONVERTED_FAIL${NC} $MSG_FAIL"
|
package/setup.sh
CHANGED
|
@@ -48,6 +48,38 @@ echo -e "${YELLOW} v2.0.0 — Instalador Profesional${NC}"
|
|
|
48
48
|
echo -e "${CYAN}${LINE}${NC}"
|
|
49
49
|
echo ""
|
|
50
50
|
|
|
51
|
+
# ============================================
|
|
52
|
+
# PRE-CHECK: Aviso si la carpeta se llama "specleap-framework"
|
|
53
|
+
# ============================================
|
|
54
|
+
# Si el usuario clonó con `git clone <url>` (sin segundo argumento), la
|
|
55
|
+
# carpeta se llamará "specleap-framework" por defecto. Le avisamos por si
|
|
56
|
+
# quería otro nombre, antes de empezar el setup interactivo.
|
|
57
|
+
# Solo aplica cuando setup.sh se ejecuta directamente (no via bin/specleap,
|
|
58
|
+
# que ya pregunta nombre interactivamente). Detectamos este caso por
|
|
59
|
+
# ausencia de la variable SPECLEAP_INSTALL_PATH (que solo la pone bin/specleap).
|
|
60
|
+
|
|
61
|
+
CURRENT_FOLDER_NAME="$(basename "$(pwd)")"
|
|
62
|
+
|
|
63
|
+
if [ -z "${SPECLEAP_INSTALL_PATH:-}" ] && [ "$CURRENT_FOLDER_NAME" = "specleap-framework" ]; then
|
|
64
|
+
echo "ℹ️ Esta carpeta se llama 'specleap-framework' (nombre por defecto de git clone)."
|
|
65
|
+
echo " This folder is named 'specleap-framework' (git clone default)."
|
|
66
|
+
echo ""
|
|
67
|
+
echo " Si querías otro nombre / If you wanted a different name:"
|
|
68
|
+
echo " 1) Cancela con Ctrl+C / Cancel with Ctrl+C"
|
|
69
|
+
echo " 2) Vuelve a ejecutar / Run again with:"
|
|
70
|
+
echo " git clone https://github.com/ConceptualCreative/specleap-framework.git mi-proyecto"
|
|
71
|
+
echo " cd mi-proyecto"
|
|
72
|
+
echo " bash setup.sh"
|
|
73
|
+
echo ""
|
|
74
|
+
read -p "¿Continuar con el nombre 'specleap-framework'? / Continue with 'specleap-framework'? [S/n]: " CONTINUE_DEFAULT
|
|
75
|
+
if [[ "$CONTINUE_DEFAULT" =~ ^[Nn]$ ]]; then
|
|
76
|
+
echo ""
|
|
77
|
+
echo "Cancelado por el usuario / Cancelled by user."
|
|
78
|
+
exit 0
|
|
79
|
+
fi
|
|
80
|
+
echo ""
|
|
81
|
+
fi
|
|
82
|
+
|
|
51
83
|
# ============================================
|
|
52
84
|
# PASO 1: Selección de Idioma
|
|
53
85
|
# ============================================
|