2023-10-16 02:30:03 +02:00
|
|
|
<template>
|
|
|
|
<div class="config-container" ref="root">
|
2023-10-17 02:12:12 +02:00
|
|
|
<CopyButton :text="extension.config_snippet" />
|
2023-10-16 02:30:03 +02:00
|
|
|
<pre><code class="config-snippet" v-html="highlightedConfigSnippet" /></pre>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import 'highlight.js/lib/common'
|
2023-10-17 02:10:17 +02:00
|
|
|
import 'highlight.js/styles/stackoverflow-dark.min.css'
|
2023-10-16 02:30:03 +02:00
|
|
|
import hljs from "highlight.js"
|
2023-10-17 02:12:12 +02:00
|
|
|
import CopyButton from "@/components/elements/CopyButton"
|
2023-10-16 02:30:03 +02:00
|
|
|
import Utils from "@/Utils";
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: "Extension",
|
|
|
|
mixins: [Utils],
|
2023-10-17 02:12:12 +02:00
|
|
|
components: {
|
|
|
|
CopyButton,
|
|
|
|
},
|
2023-10-17 16:38:46 +02:00
|
|
|
|
2023-10-16 02:30:03 +02:00
|
|
|
props: {
|
|
|
|
extension: {
|
|
|
|
type: Object,
|
|
|
|
required: true,
|
|
|
|
},
|
2023-10-17 16:38:46 +02:00
|
|
|
|
|
|
|
configFile: {
|
|
|
|
type: String,
|
|
|
|
},
|
2023-10-16 02:30:03 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
computed: {
|
|
|
|
highlightedConfigSnippet() {
|
|
|
|
return hljs.highlight(
|
|
|
|
'yaml',
|
2023-10-17 16:38:46 +02:00
|
|
|
`# Add this configuration template to ${this.configFile}\n` +
|
2023-10-16 02:30:03 +02:00
|
|
|
this.extension.config_snippet,
|
|
|
|
).value.trim()
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
2023-10-17 02:12:12 +02:00
|
|
|
@import "common.scss";
|
|
|
|
|
2023-10-16 02:30:03 +02:00
|
|
|
.config-container {
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
position: relative;
|
|
|
|
display: flex;
|
|
|
|
}
|
|
|
|
</style>
|