Skip to content

Commit 8177880

Browse files
docs: update llms.txt files
Generated by GitHub Actions
1 parent 41a5137 commit 8177880

1 file changed

Lines changed: 63 additions & 6 deletions

File tree

docs/llms-full.txt

Lines changed: 63 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ This example builds a JSON API payload with dynamic keys, nested structures, and
279279
### What to notice
280280

281281
- The dynamic account id is used in a JSON key position: `"account-{account_id}"`
282-
- Nested `dict`/`list` values are rendered as native JSON objects and arrays
282+
- Nested `dict`/`list`/`tuple` values are rendered as native JSON objects and arrays
283283
- String fragments like `"{display_name}-{first_role}"` stay readable
284284
- Bare scalar assembly like `active-{first_role}` becomes a JSON string
285285

@@ -301,6 +301,10 @@ Values passed to JSON interpolation slots must be JSON-serializable:
301301

302302
JSON rejects `float("inf")`, `float("nan")`, and non-string keys.
303303

304+
Nested `Template` objects are not rendered recursively when passed as interpolation values.
305+
Compose templates with PEP 750 template concatenation before calling `render_data`,
306+
`render_text`, or `render_result`.
307+
304308
## Profile
305309

306310
JSON currently supports one profile:
@@ -351,13 +355,17 @@ This example builds a TOML configuration with interpolated table headers, keys,
351355
## Supported types
352356

353357
- `str`, `int`, `float`, `bool`
354-
- `list` (rendered as TOML arrays)
358+
- `list`, `tuple` (rendered as TOML arrays)
355359
- `dict` (rendered as inline tables or nested tables)
356360
- `datetime`, `date`, `time` (rendered as TOML-native datetime literals)
357361

358362
!!! warning
359363
TOML has no null value — `None` is rejected. Offset-aware `time` values are also rejected.
360364

365+
Nested `Template` objects are not rendered recursively when passed as interpolation values.
366+
Compose templates with PEP 750 template concatenation before calling `render_data`,
367+
`render_text`, or `render_result`.
368+
361369
## Profiles
362370

363371
| Profile | Description | Default |
@@ -428,12 +436,16 @@ This example demonstrates YAML-specific features: anchors, aliases, tags, and bl
428436
## Supported types
429437

430438
- `str`, `int`, `float`, `bool`, `None`
431-
- `list` (rendered as YAML sequences)
439+
- `list`, `tuple` (rendered as YAML sequences)
432440
- `dict` (rendered as YAML mappings)
433441

434442
!!! warning
435443
Although YAML 1.2.2 Core Schema supports `.inf` and `.nan`, this library rejects `float("inf")` and `float("nan")` to keep output portable across parsers. Anchor/tag fragments must be non-empty and whitespace-free.
436444

445+
Nested `Template` objects are not rendered recursively when passed as interpolation values.
446+
Compose templates with PEP 750 template concatenation before calling `render_data`,
447+
`render_text`, or `render_result`.
448+
437449
## Profile
438450

439451
| Profile | Description | Default |
@@ -710,6 +722,40 @@ extend-exclude = ["generated", "vendor"]
710722
ignore-file = ".t-linterignore"
711723
```
712724

725+
## Language detection
726+
727+
t-linter identifies structured-data templates from PEP 593 `Annotated`
728+
metadata on `string.templatelib.Template`:
729+
730+
```python
731+
from string.templatelib import Template
732+
from typing import Annotated
733+
734+
payload: Annotated[Template, "json"] = t'{"name": {name}}'
735+
config: Annotated[Template, "toml"] = t"name = {name}"
736+
manifest: Annotated[Template, "yaml"] = t"name: {name}"
737+
```
738+
739+
The wrapper packages export aliases for the same convention:
740+
741+
```python
742+
from json_tstring import JsonTemplate, render_data as render_json
743+
from toml_tstring import TomlTemplate, render_data as render_toml
744+
from yaml_tstring import YamlTemplate, render_data as render_yaml
745+
746+
payload: JsonTemplate = t'{"name": {name}}'
747+
config: TomlTemplate = t"name = {name}"
748+
manifest: YamlTemplate = t"name: {name}"
749+
750+
json_data = render_json(payload)
751+
toml_data = render_toml(config)
752+
yaml_data = render_yaml(manifest)
753+
```
754+
755+
For this project, t-linter recognizes the metadata tags `json`, `toml`,
756+
`yaml`, and `yml`. The aliases above use the canonical `json`, `toml`, and
757+
`yaml` tags.
758+
713759
## How it works with tstring-structured-data
714760

715761
t-linter and tstring-structured-data share the same Rust parsing and formatting backends:
@@ -1140,13 +1186,21 @@ class RenderResult(Generic[TData]):
11401186
| `TomlProfile` | `Literal["1.0", "1.1"]` | `toml_tstring` |
11411187
| `YamlProfile` | `Literal["1.2.2"]` | `yaml_tstring` |
11421188

1189+
### Template aliases
1190+
1191+
| Type | Definition | Package |
1192+
|------|------------|---------|
1193+
| `JsonTemplate` | `Annotated[Template, "json"]` | `json_tstring` |
1194+
| `TomlTemplate` | `Annotated[Template, "toml"]` | `toml_tstring` |
1195+
| `YamlTemplate` | `Annotated[Template, "yaml"]` | `yaml_tstring` |
1196+
11431197
### Value types
11441198

11451199
| Type | Definition | Package |
11461200
|------|-----------|---------|
1147-
| `JsonValue` | `dict \| list \| str \| int \| float \| bool \| None` | `tstring_core` |
1148-
| `TomlValue` | `dict \| list \| str \| int \| float \| bool \| datetime \| date \| time` | `tstring_core` |
1149-
| `YamlValue` | `dict \| list \| str \| int \| float \| bool \| None` | `tstring_core` |
1201+
| `JsonValue` | `dict \| list \| tuple \| str \| int \| float \| bool \| None` | `tstring_core` |
1202+
| `TomlValue` | `dict \| list \| tuple \| str \| int \| float \| bool \| datetime \| date \| time` | `tstring_core` |
1203+
| `YamlValue` | `dict \| list \| tuple \| str \| int \| float \| bool \| None` | `tstring_core` |
11501204

11511205
## Exceptions
11521206

@@ -1211,6 +1265,7 @@ internal wrapper-package imports, but it is not part of the public contract.
12111265
### Supported and tested
12121266

12131267
- top-level scalar, object, and array values
1268+
- Python `list` and `tuple` values as JSON arrays
12141269
- whole-value, object-key, quoted-key-fragment, and string-fragment interpolation
12151270
- RFC 8259 number forms, escape sequences, surrogate pairs, and representative examples
12161271
- JSON data normalization through `serde_json`
@@ -1230,6 +1285,7 @@ internal wrapper-package imports, but it is not part of the public contract.
12301285
### Supported and tested
12311286

12321287
- assignments, dotted keys, table headers, array-of-table headers, arrays, and inline tables
1288+
- Python `list` and `tuple` values as TOML arrays
12331289
- basic, literal, multiline basic, and multiline literal strings
12341290
- TOML 1.0 numeric, string, date, time, and datetime forms exercised in tests
12351291
- interpolation in keys, headers, values, and string fragments
@@ -1261,6 +1317,7 @@ internal wrapper-package imports, but it is not part of the public contract.
12611317
### Supported and tested
12621318

12631319
- block and flow mappings/sequences
1320+
- Python `list` and `tuple` values as YAML sequences
12641321
- plain, single-quoted, double-quoted, and block scalars
12651322
- anchors, aliases, tags, directives, and explicit document markers
12661323
- multi-document streams

0 commit comments

Comments
 (0)