Summary
Allow users to download the current editor content as a file with appropriate extension.
Requirements
File Extension Mapping
| Language |
Extension |
| JavaScript |
.js |
| TypeScript |
.ts |
| Python |
.py |
| HTML |
.html |
| CSS |
.css |
| Markdown |
.md |
| JSON |
.json |
| SQL |
.sql |
Technical Notes
function downloadFile(content, filename) {
const blob = new Blob([content], { type: 'text/plain' });
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = filename;
a.click();
URL.revokeObjectURL(url);
}
Acceptance Criteria
Summary
Allow users to download the current editor content as a file with appropriate extension.
Requirements
collabpad-{roomId}.{ext}File Extension Mapping
Technical Notes
Acceptance Criteria