Skip to content

Latest commit

 

History

History
43 lines (30 loc) · 1.03 KB

file_loader.rst

File metadata and controls

43 lines (30 loc) · 1.03 KB

File Loader Extension

The :any:`lookatme.contrib.file_loader` builtin extension allows external files to be sourced into the code block, optionally being transformed and optionally restricting the range of lines to display.

Format

The file loader extension modifies the code block markdown rendering by intercepting code blocks whose language equals file. The contents of the code block must be YAML that conforms to the :any:`FileSchema` schema.

The default schema is shown below:

path: path/to/the/file # required
relative: true         # relative to the slide source directory
lang: text             # pygments language to render in the code block
transform: null        # optional shell command to transform the file data
lines:
  start: 0
  end: null

Note

The line range is only applied AFTER transformations are performed on the file data.

Usage

E.g.

```file
path: ../source/main.c
lang: c
```