Render text-based files

The idea here would be to be able to embed in a page a file that was uploaded. For instance a docker-compose.yml file or any text based file. This would allow to display the file as well as to allow to download it.

Another possibility (perhaps more powerful) would be to supercharge the code block in a way that you can name it:

```yaml  docker-compose.yml
...
\```

you can then download the code block with GET /my-docker-tutorial?dl=docker-compose.yml (or any url scheme you like :slight_smile: )

There is a way to include a live preview of a different text file. Unfortunately, you cannot edit the file from this preview. You’d have to navigate to the original file to make any changes. If you add the following into your templates (for example, as β€œinclude-note.md”) you can then attach the files as a preview. I made a pull request about this template, because I think it would be nice to have this functionality by default. Though I think there should be a better way to do this. If I’m not mistaken, in Obsidian you can add files simply by β€œ![Descriptive name](path to the file)”.

---
tags: template
description: Add a live preview of a note
hooks.snippet.slashCommand: include-note
---
```include
raw: "[[|^|]]"

(The code snippet is kinda borked, but you can find it in the pull request on Github.)

image

I don’t think this lets you include non markdown files. It would be nice to be able to to at least link to to non silverbullet files on disk. Would be really useful for PDFs as well.