Willian Saez108 downloadsEmbed the contents of a vault file as a syntax-highlighted code block via a codefile fenced block.
Embed the current contents of a vault file as a syntax-highlighted code block, instead of copy-pasting code into a fenced block.
Point a codefile block at a file. The language is inferred from the extension.
```codefile src/foo.abap
```
Line range (1-based, inclusive):
```codefile src/foo.abap:10-25
```
Single line: :10. The path can also go in the block body (first line) if you
prefer. Paths resolve like Obsidian links (relative to the current note,
shortest-unique names work).
npm install
npm run dev # watch build -> main.js
npm run build # type-check + production bundle
npm test # unit tests (parser, langMap)
Copy main.js, manifest.json, and styles.css into
<vault>/.obsidian/plugins/codefile/ to try it in a vault.