-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FilesList: add download all button #105
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
const fileData = snap.val(); | ||
console.log('fileData:'); | ||
console.log(fileData); | ||
const code = 'TODO'; // extract from fileData? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: get code from YJS? idk how YJS works @thecodingwizard
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for legacy IDE, would want to iterate over editor-[lang]
for each lang
and obtain the code for each of them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For YJS:
- Edit https://github.com/cpinitiative/ide-yjs/blob/main/src/index.ts to add a route to access / download a file. Specifically, https://github.com/cpinitiative/ide-yjs/blob/764c6277af0e2f6c23e6719590d500eb91ce122f/src/index.ts#L64 here
targetDoc.getText("monaco")
probably will give you the code. - in this repository, add an api route similar to /copyFile, but instead of copying the file it just returns the contents of a particular file
- in this file, call the api route to get the file
If we wanted to be really fancy, we could even make the YJS server API handler return a ZIP file containing all of that users' files, so we only have to make one API request to get all the files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For Firepad:
https://firepad.io/docs/#headless is probably what we want.
todos: