algoo / preview-generator

generates previews of files with cache management
https://pypi.org/project/preview-generator/
MIT License
228 stars 50 forks source link

HTML preview only for archive/zip file type? #196

Open BoPeng opened 4 years ago

BoPeng commented 4 years ago

I came across this project with the hope to find a static preview generator that generates HTML preview for most file types, just was disappointed to find that only archive/zip file types support HTML preview.

My understanding is that HTML is pretty expressive and can

  1. for file types with text preview, use <pre><pre> to include text-based preview.
  2. for file types with jpeg preview, use embedded <img> to include them.

Would not this allow the generation of HTML preview for most file types? Am I missing anything here or am I supposed to program these by myself? Also, it would be helpful to use generate syntax highlighted HTML preview for source code (e.g. use pygmant), which the primary reason for me to search for a preview generator.

inkhey commented 4 years ago

Hello,

HTML preview goal is currently not very clear in preview_generator, we currently focus on pdf and jpeg preview. I do agree that HTML preview can be improved, but the meaning of it may be very unclear depending on the context. The biggest problem i see is the "path" issue:

Feel free to suggest solution to this and propose HTML preview for builder that lack it. As soon as you know what you want, it should be relatively easy to add those to preview_generator.