Embed *.txt file with rendering like PDF and other file types?

Howdy,

Obsidian Version 1.6.3 (Installer 1.5.3) on Macbook Apple Silicon

I frequently have plain text files (generated on Linux) that I copy to my Macbook and then drag and drop into my Obsidian notes.

Even though they are embedded with the syntax ![[some-logfile.txt]], they don’t render like PDF’s do when I switch to reading view. I can click the file to open in the default text editor, but I’d really love for them to render inside Obsidian so that I can scroll through it without leaving the app.

Is there a way to make text files do this in Obsidian?

Thanks, Mike

1 Like

Why embed the text file instead of copy and pasting the contents into a code block?

These files can be 1000’s of lines long and having it embedded is a lot cleaner than having the contents directly in the notes.

there are nothing to render in a plaintext file. it is just text with no imbded instructions for it to be rendered.

Files like PDFs are packed with styling code and graphics.

what you are asking about can not be done. Unless the text file is written in specific syntax, then syntax highlighters in text editiors will make it easier to style and read.

If you are using Obsidian to read logfiles with thousands of line, I believe you are using the wrong tool.

.txt files won’t embed like other notes(.md files), PDFs, or images.

However, you can use GitHub - sunxvming/obsidian-vscode-editor: Edit Code Files like VSCode in Obsidian. or similar to view and edit the .txt file within Obsidian.

Maybe something like that could work for you?

1 Like

Custom File Extensions and Types

obsidian://show-plugin?id=obsidian-custom-file-extensions-plugin

https://github.com/MeepTech/obsidian-custom-file-extensions-plugin

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.