mnutt / davros

Personal file storage server
Apache License 2.0
298 stars 35 forks source link

No preview for .txt files? #14

Closed ovizii closed 8 years ago

ovizii commented 8 years ago

Is there a list of file types Davros has previews for?

mnutt commented 8 years ago

.txt files should be pretty easy to add, similarly to html. Here's a list of what we currently support: https://github.com/mnutt/davros/blob/master/app/lib/filetypes.js

ovizii commented 8 years ago

Cool, thanks. Would be awesome if you could add .txt possible .nfo? or maybe .md? Whatever people use for text these days ;-) maybe also .conf and .config .cf

mnutt commented 8 years ago

I'll add .txt, .nfo, .conf, .config, and .cf to display raw in an iframe. .md is actually rendered as markdown already.

ovizii commented 8 years ago

Awesome, thanks. I didn't see .md in the list, didn't even know what it stands for but I noticed the "readme" of this github project was actually an .md file so I just listed it :-)

mnutt commented 8 years ago

Fixed in https://github.com/mnutt/davros/commit/570b78f1895b68c7d968f5ac9472e3b0b7e16dbf.

ocdtrekkie commented 8 years ago

So, @mnutt is there any particular differentiation between how Davros handles a text file and an html file? They're both 'document' type, and https://github.com/mnutt/davros/blob/master/app/components/files/type-document.js seems pretty brief. If I put html tags in a txt, would it render it? Or does it just embed it and leave it up to the browser how to display it?

ocdtrekkie commented 8 years ago

Also, I noticed txt files, as a 'document' type, has a sandboxing requirement. Would it not make sense to have a 'text' type, which forced a raw text display? A lot of code type files would make a lot of sense to preview with text forced. (And heck, document types like html probably should have a "view raw" option that forces them to text as well.)