Afegeix text des d'una URL remota o un arxiu local.
El shortcode accepta tres paràmetres:
- `src`: L'URL d'origen o ruta del fitxer (obligatori)
- `start`: Primera línia a mostrar (opcional, comença a 1)
- `end`: Número de l'última línia (opcional, per defecte és 0, l'última línia)
{{ admonition(type="info", text="`start` i `end` són inclusius. `start=3, end=3` mostrarà només la tercera línia.") }}
**Important**:
- **Arxius remots VS arxius locals**: Si `src` comença amb "http", es tractarà com un arxiu remot. D'altra banda, s'assumeix que és una ruta d'arxiu local.
@ -229,6 +237,12 @@ Mostra el text d'un arxiu local:
Añade texto desde una URL remota o un archivo local.
El shortcode acepta tres parámetros:
- `src`: La URL de origen o ruta del archivo (obligatorio)
- `start`: Primera línea a mostrar (opcional, empieza en 1)
- `end`: Número de la última línea (opcional, por defecto es 0, la última línea)
{{ admonition(type="info", text="`start` y `end` son inclusivos. `start=3, end=3` mostrará solo la tercera línea.") }}
**Importante**:
- **Archivos remotos VS archivos locales**: Si `src` empieza con "http", se tratará como un archivo remoto. De lo contrario, se asume que es una ruta de archivo local.
@ -230,6 +238,12 @@ Visualización de texto de un archivo local:
{{/* remote_text(src="ruta/a/archivo.txt") */}}
```
Mostar sólo las líneas 3 a 5 de un archivo remoto:
Embed text from a remote URL or a local file. To display the path or URL on the code block, see the [show source or path shortcode](#show-source-or-path).
The shortcode accepts three parameters:
- `src`: The source URL or file path (required)
- `start`: First line to display (optional, starts at 1)
- `end`: The ending line number (optional, defaults to 0, meaning the last line)
{{ admonition(type="info", text="`start` and `end` are inclusive. `start=3, end=3` will display only the third line.") }}
**Important**:
- **Remote VS local files**: If `src` starts with "http", it will be treated as a remote file. Otherwise, it assumes a local file path.
@ -229,6 +237,12 @@ Displaying text from a local file:
{{/* remote_text(src="path/to/file.txt") */}}
```
Display lines 3 to 7 (both inclusive) of a local file: