/

For the complete documentation index, see llms.txt. This page is also available as Markdown.

On this page

File text content

The .read {path} docs ↗ function returns the string content of the specified file.

The path parameter can be either a path relative to the main source file’s location or an absolute path. Use a slash (/) as the path separator, regardless of the operating system.

An optional lines parameter of type Range selects a specific range of lines (inclusive, starting from 1). An invalid or out-of-bounds range causes an error. If you do not provide a range, Quarkdown reads the entire file.

.read {myfile.txt} lines:{3..8}

Open ranges work as follows:

Example 1

.read is particularly useful in combination with functions such as .code, .mermaid and .css to load code snippets from external files.

.code
    .read {assets/point.ts}
export class Point {
    x: number;
    y: number;

    constructor(x: number, y: number) {
        this.x = x;
        this.y = y;
    }
}