File Reader
Embed repository files as code blocks using the FileReader pseudo-component.
Overview
FileReader is a pseudo-component used to read a file and convert it into a markdown code block. This solves the issue of changing code blocks manually if a file you are referencing changes.
Warning
This is not a Svelte component — it is processed at build time by a remark plugin and replaced with a code fence.
Usage
This "component" is a remark plugin and follows the same fenced-code metadata conventions described in the Code Blocks page.
Place the tag directly in your markdown like the following:
<FileReader
file="src/app.css"
title="app.css"
caption="Website style sheet"
highlight="2,4-6"
showLineNumbers
/> .md
The plugin converts that into a fenced code block:
```ts {2,4-6} showLineNumbers title="app.css" caption="Website style sheet"
// (file contents...)
``` .md