3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-18 07:35:02 +00:00

dashboard: separate plugin usage/configuration, add usage guide + configuration guide

This commit is contained in:
Dragory 2019-09-29 15:53:14 +03:00
parent 616b3be2fd
commit 5006ae4962
10 changed files with 524 additions and 85 deletions

View file

@ -0,0 +1,34 @@
<template>
<div ref="rendered"></div>
</template>
<script>
import marked from "marked";
import hljs from "highlight.js";
export default {
props: ["content"],
methods: {
renderContent() {
const rendered = marked(this.content || "");
const target = this.$refs.rendered;
target.innerHTML = rendered;
target.querySelectorAll("code[class*='language-']").forEach(elem => {
if (elem.parentNode.tagName === 'PRE') {
elem.parentNode.classList.add('codeblock');
}
hljs.highlightBlock(elem);
});
}
},
mounted() {
this.renderContent();
},
watch: {
content() {
this.renderContent();
},
},
};
</script>