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:
parent
616b3be2fd
commit
5006ae4962
10 changed files with 524 additions and 85 deletions
34
dashboard/src/components/docs/MarkdownBlock.vue
Normal file
34
dashboard/src/components/docs/MarkdownBlock.vue
Normal 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>
|
Loading…
Add table
Add a link
Reference in a new issue