Repository navigation
Document viewers: PDF, Word, Excel, Markdown, CSV, code and logs - #174
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The viewer of the web app (and installed PWA) now previews documents instead of offering a download. Old binary Office formats (.doc, .xls, .ppt) are intentionally not supported.
<iframe>, which does not work inside a page on Android or iOS.;included) with a "Source" toggleBig text files and logs. Text is read in 2 MB windows (8 MB for CSV) with Range requests. Bigger files show their start or end and can switch between both.
.logfiles open at their end, scrolled to the last line. Encoding: UTF-16 with BOM, UTF-8, else Windows-1252. A window cut inside a UTF-8 character is trimmed instead of falling back.Safety.
rehype-raw); react-markdown dropsjavascript:URLs.altChunks) are not rendered, and onlyhttp(s),mailtoand#links are kept.Bundle. Every viewer is its own lazy chunk (opening a .txt does not load pdf.js). The heavy ones are excluded from the PWA precache: they are useless offline, where documents cannot be read. Precache stays at 2.05 MB (was 2.00), initial JS 242.9 KB gzip of 250 KB. The "CSS" figure of
check-chunks.mjsgrew because it sums every.cssin the output, including the lazy pdf.js stylesheet;index.htmlstill links only the main CSS.Also.
neutralscale, which is reversed in the light theme.New dependencies (all MIT or Apache-2.0,
npm auditclean):pdfjs-dist,docx-preview,read-excel-file,react-markdown,remark-gfm,highlight.js,papaparse.Checks.