Skip to content

Commit

Permalink
Map different modes to cell types
Browse files Browse the repository at this point in the history
  • Loading branch information
guerler committed Jan 19, 2025
1 parent 5a13988 commit cbd9382
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion client/src/components/Markdown/Editor/CellCode.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const props = defineProps({
},
mode: {
type: String,
default: "javascript",
default: "json",
},
});
Expand Down
12 changes: 11 additions & 1 deletion client/src/components/Markdown/Editor/CellEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<hr class="solid m-0" />
<div class="d-flex my-1 mx-3">
<span class="cell-name small text-primary">{{ cell.name }}</span>
<CellCode :model-value="cell.content" class="ml-2" />
<CellCode :model-value="cell.content" :mode="getMode(cell.name)" class="ml-2" />
</div>
<hr class="solid m-0" />
</div>
Expand All @@ -32,6 +32,16 @@ interface CellType {
const cells = ref<Array<CellType>>(parseMarkdown(props.markdownText));
function getMode(cellName: string) {
switch (cellName) {
case "galaxy":
return "python";
case "markdown":
return "markdown";
}
return "json";
}
function onClick(cellIndex: number, cellType: string) {
console.log([cellIndex, cellType]);
}
Expand Down

0 comments on commit cbd9382

Please sign in to comment.