Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
175 changes: 0 additions & 175 deletions src/notebooks/deepnote/MimeTypeProcessor.ts

This file was deleted.

60 changes: 0 additions & 60 deletions src/notebooks/deepnote/OutputTypeDetector.ts

This file was deleted.

10 changes: 10 additions & 0 deletions src/notebooks/deepnote/converters/blockConverter.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import type { NotebookCellData } from 'vscode';

import type { DeepnoteBlock } from '../deepnoteTypes';

export interface BlockConverter {
applyChangesToBlock(block: DeepnoteBlock, cell: NotebookCellData): void;
canConvert(blockType: string): boolean;
convertToCell(block: DeepnoteBlock): NotebookCellData;
getSupportedTypes(): string[];
}
24 changes: 24 additions & 0 deletions src/notebooks/deepnote/converters/codeBlockConverter.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { NotebookCellData, NotebookCellKind } from 'vscode';

import type { BlockConverter } from './blockConverter';
import type { DeepnoteBlock } from '../deepnoteTypes';

export class CodeBlockConverter implements BlockConverter {
applyChangesToBlock(block: DeepnoteBlock, cell: NotebookCellData): void {
block.content = cell.value || '';
}

canConvert(blockType: string): boolean {
return blockType === 'code';
}

convertToCell(block: DeepnoteBlock): NotebookCellData {
const cell = new NotebookCellData(NotebookCellKind.Code, block.content || '', 'python');

return cell;
}

getSupportedTypes(): string[] {
return ['code'];
}
}
Loading