Skip to content

File data

Giorgio Garofalo edited this page Oct 5, 2024 · 8 revisions

Quarkdown offers functions to retrieve information from files.

Note

The following functions refer to a path parameter, which accepts the path to the target file, which may be relative to the location of the main source file, or absolute.
A slash (/) is the global path separator, agnostic to the current file system in use.

File text content

The .read {path} function returns the string content of the given file.

An optional lines parameter of type Range is also supported, which allows for the selection of a specific range of lines (inclusive, starting from 1). An invalid or out of bounds range causes an error.
If no range is provided, the whole file is read.

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

Tip

.read is particularly useful when used in combination with .code in order to load code snippets from external files:

.code {java}
  .read {Point.java}

Table from CSV

The .csv {path} function loads a table from a CSV file. The parsing is delegated to the kotlin-csv library.

The first row of the CSV file is always used as the header row.

.csv {people.csv}

Getting started [NEW!]

Documentation

CLI tools

Markdown enhancements

Functions

Setting up

Multi-file projects

Layout

Charts & diagrams

Scripting & control flow

Utilities

Slides

I/O

Native content

Value types

Built-in libraries

  • Paper: abstract, definitions, theorems, and more

Extra features

Inside Quarkdown

Clone this wiki locally