docs: templates de frontmatter YAML para function, pipeline, component y type
Añade plantillas de referencia que documentan el formato exacto del frontmatter YAML que cada .md debe seguir. Cubren los cuatro kinds: function, pipeline, component y type. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Vendored
+48
@@ -0,0 +1,48 @@
|
||||
---
|
||||
name: DataTable
|
||||
kind: component
|
||||
lang: typescript
|
||||
domain: core
|
||||
version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "DataTable<T>(props: { data: T[]; columns: ColumnDef<T>[]; onRowClick?: (row: T) => void }): JSX.Element"
|
||||
description: "Tabla de datos generica con soporte para columnas configurables y click en fila."
|
||||
tags: [table, component, generic, ui]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
returns_optional: false
|
||||
error_type: ""
|
||||
imports: [react]
|
||||
tested: false
|
||||
tests: []
|
||||
test_file_path: ""
|
||||
file_path: "functions/components/DataTable.tsx"
|
||||
props:
|
||||
- name: data
|
||||
type: "T[]"
|
||||
required: true
|
||||
description: "Array de datos a renderizar"
|
||||
- name: columns
|
||||
type: "ColumnDef<T>[]"
|
||||
required: true
|
||||
description: "Definicion de columnas"
|
||||
- name: onRowClick
|
||||
type: "(row: T) => void"
|
||||
required: false
|
||||
description: "Callback al hacer click en una fila"
|
||||
emits: [onRowClick]
|
||||
has_state: true
|
||||
framework: react
|
||||
variant: [default, compact, striped]
|
||||
---
|
||||
|
||||
## Ejemplo
|
||||
|
||||
```tsx
|
||||
<DataTable data={users} columns={cols} onRowClick={handleClick} />
|
||||
```
|
||||
|
||||
## Notas
|
||||
|
||||
Componente con estado interno para manejar seleccion y scroll.
|
||||
Vendored
+32
@@ -0,0 +1,32 @@
|
||||
---
|
||||
name: filter_slice
|
||||
kind: function
|
||||
lang: go
|
||||
domain: core
|
||||
version: "1.0.0"
|
||||
purity: pure
|
||||
signature: "func FilterSlice[T any](xs []T, pred func(T) bool) []T"
|
||||
description: "Filtra un slice aplicando un predicado sin mutar el original."
|
||||
tags: [slice, functional, generic]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
returns_optional: false
|
||||
error_type: ""
|
||||
imports: []
|
||||
tested: false
|
||||
tests: []
|
||||
test_file_path: ""
|
||||
file_path: "functions/core/filter_slice.go"
|
||||
---
|
||||
|
||||
## Ejemplo
|
||||
|
||||
```go
|
||||
evens := FilterSlice([]int{1, 2, 3, 4}, func(n int) bool { return n%2 == 0 })
|
||||
// evens = [2, 4]
|
||||
```
|
||||
|
||||
## Notas
|
||||
|
||||
Funcion pura generica. No muta el slice original — crea uno nuevo.
|
||||
Vendored
+31
@@ -0,0 +1,31 @@
|
||||
---
|
||||
name: tick_to_ohlcv
|
||||
kind: pipeline
|
||||
lang: go
|
||||
domain: finance
|
||||
version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "func TickToOHLCV(ctx context.Context, symbol string, interval time.Duration) ([]OHLCV, error)"
|
||||
description: "Pipeline que obtiene ticks de un exchange y los agrega en velas OHLCV."
|
||||
tags: [pipeline, finance, ohlcv, ticks]
|
||||
uses_functions: [fetch_ticks_go_io, aggregate_ohlcv_go_finance]
|
||||
uses_types: [ohlcv_go_finance, tick_go_finance]
|
||||
returns: [ohlcv_go_finance]
|
||||
returns_optional: false
|
||||
error_type: "error_go_core"
|
||||
imports: []
|
||||
tested: false
|
||||
tests: []
|
||||
test_file_path: ""
|
||||
file_path: "functions/pipelines/tick_to_ohlcv.go"
|
||||
---
|
||||
|
||||
## Ejemplo
|
||||
|
||||
```go
|
||||
candles, err := TickToOHLCV(ctx, "BTCUSDT", 5*time.Minute)
|
||||
```
|
||||
|
||||
## Notas
|
||||
|
||||
Pipeline impuro: orquesta fetch_ticks (IO) y aggregate_ohlcv (pura).
|
||||
Vendored
+23
@@ -0,0 +1,23 @@
|
||||
---
|
||||
name: ohlcv
|
||||
lang: go
|
||||
domain: finance
|
||||
version: "1.0.0"
|
||||
algebraic: product
|
||||
definition: |
|
||||
type OHLCV struct {
|
||||
Open float64
|
||||
High float64
|
||||
Low float64
|
||||
Close float64
|
||||
Volume float64
|
||||
}
|
||||
description: "Vela de mercado con precios de apertura, maximo, minimo, cierre y volumen."
|
||||
tags: [finance, market, candle]
|
||||
uses_types: []
|
||||
file_path: "types/finance/ohlcv.go"
|
||||
---
|
||||
|
||||
## Notas
|
||||
|
||||
Tipo producto — todos los campos siempre presentes. Modela una vela de mercado.
|
||||
Reference in New Issue
Block a user