Repository navigation
feat: add arXiv papers, GitHub code and file links from an address - #75
Merged
Merged
Conversation
Add from URL takes an arXiv paper page, a GitHub repository, folder or file, or a link to any file. The browser downloads it directly, so no server is involved and no site list is kept: a site that does not allow cross-origin reads gets a sentence asking the reader to download the file and drag it in. An arXiv abstract page stands for its PDF and a GitHub file page for its raw content; both open once added. A GitHub folder is listed once through the API, filtered by the rules a chosen folder follows before anything is downloaded, and then fetched file by file from raw content.
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.
What
The Add menu gains Add from URL…. Paste an address and the browser downloads it directly. No server is involved and no list of sites is kept.
abs/<id>orpdf/<id>)blob/<ref>/<path>)tree/<ref>/<dir>)httpslinkHow
core/url-import.tsturns an address into a target. arXiv and GitHub pages are rewritten to the file they stand for. Any otherhttpsaddress is downloaded as given.selectFolderFiles(now generic over file metadata) then applies the folder rules: hidden and dependency folders, files over 1 MiB, unreadable formats, and the 5000-file limit. This happens before anything is downloaded, and the skipped count stays accurate. The remaining files come fromraw.githubusercontent.com, six at a time.use-file-librarygainsaddFromUrl. A folder goes through the samesettleFolderpath as a folder picked from disk, so duplicates, limits and status messages are shared. A single file's id is returned and opened once the library lists it.Limits
/is read as the ref's first segment.Verification
pnpm checkpasses.url-importunit tests: arXiv forms, GitHub forms, generic links, and rejected input.arxiv.org/abs/1706.03762opens.github.com/octocat/Spoon-Knifeis added as a folder.example.comshows the cross-origin message.