Quarkdown provides functions to retrieve information from files.
The following functions accept a
pathparameter, which 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.
The .read {path} docs ↗ function returns the string content of the specified file.
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:
..N), Quarkdown reads from the beginning of the file to line N.N..), Quarkdown reads from line N to the end of the file...), Quarkdown reads the entire file.The .listfiles {path} {sortby?} {order?} docs ↗ function returns an iterable of the files in a directory. The result is unordered by default, but you can sort it by name or date.
Like any other collection, you can iterate over the result or supply it to other functions. For example, you can perform automatic bulk inclusions via .includeall:
.includeall {.listfiles {somedirectory} sortby:{name}}The .filename {path} {extension?} docs ↗ function returns the file name from a given file path. The optional extension boolean parameter controls whether the file extension is included in the result.
.filename {assets/point.ts} extension:{no}point
The .csv {path} {mode?} {caption?} docs ↗ function loads a table from a CSV file. The first row of the CSV file always serves as the header row.
Tables loaded from CSV can also be manipulated. See Table manipulation for more information.
.csv {assets/people.csv}| Username | Birth year | Favorite food | Favorite drink |
|---|---|---|---|
| john | 1992 | Chicken | Orange juice |
| iamgio | 2002 | Pasta | Iced tea |
| daniel | 1986 | Sushi | Beer |
You can also provide a caption.
.csv {assets/people.csv} caption:{People data.}| Username | Birth year | Favorite food | Favorite drink |
|---|---|---|---|
| john | 1992 | Chicken | Orange juice |
| iamgio | 2002 | Pasta | Iced tea |
| daniel | 1986 | Sushi | Beer |
The mode parameter controls how the CSV file is parsed. It defaults to plain, which treats all cell content as plain text. If set to markdown, Quarkdown parses cell content as inline Quarkdown source code, allowing formatting, rich content, and inline function calls within the CSV.
Name, Favorite drink, Age *(as of 2026)*
Alice, Coffee, .subtract {2026} {1995}
Bob, *Pepsi*, .subtract {2026} {2001}.csv {assets/people2.csv} mode:{markdown}| Name | Favorite drink | Age (as of 2026) |
|---|---|---|
| Alice | Coffee | 31 |
| Bob | Pepsi | 25 |