debian-mirror-gitlab/app/assets/javascripts/notebook/cells/output/markdown.vue
2023-01-12 18:35:48 +00:00

42 lines
763 B
Vue

<script>
import { GlSafeHtmlDirective as SafeHtml } from '@gitlab/ui';
import Prompt from '../prompt.vue';
import Markdown from '../markdown.vue';
export default {
name: 'MarkdownOutput',
components: {
Prompt,
Markdown,
},
directives: {
SafeHtml,
},
props: {
count: {
type: Number,
required: true,
},
rawCode: {
type: Array,
required: true,
},
index: {
type: Number,
required: true,
},
},
computed: {
markdownContent() {
return { source: this.rawCode };
},
},
};
</script>
<template>
<div class="output">
<prompt type="Out" :count="count" :show-output="index === 0" />
<markdown :cell="markdownContent" :hide-prompt="true" />
</div>
</template>