Skip to content

Commit

Permalink
Added basic compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
cohansen committed Sep 25, 2024
1 parent 78d20f3 commit a0b1035
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/components/sequencing/SequenceEditor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,12 @@
setSequenceAdaptation(undefined);
}
function compile(): void {
if (selectedOutputFormat?.compile) {
selectedOutputFormat.compile(sequenceOutput);
}
}
async function sequenceUpdateListener(viewUpdate: ViewUpdate) {
const sequence = viewUpdate.state.doc.toString();
disableCopyAndExport = sequence === '';
Expand Down Expand Up @@ -369,6 +375,10 @@
{/each}
</Menu>
</div>

{#if selectedOutputFormat?.compile}
<button class="st-button icon-button secondary ellipsis" on:click={compile}>Compile</button>
{/if}
</div>
</svelte:fragment>

Expand Down
1 change: 1 addition & 0 deletions src/types/sequencing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export type DictionaryType = {
};

export interface IOutputFormat {
compile?: (output: string) => Promise<void>;
fileExtension: string;
linter?: (
diagnostics: Diagnostic[],
Expand Down

0 comments on commit a0b1035

Please sign in to comment.