mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
replace unmaintained markdown-it-vue with simpler markdown-it component
This commit is contained in:
parent
366c4d44c6
commit
58afb5a171
@ -1,58 +1,31 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- <v-main fluid class="d-block">-->
|
<div class="markdown-body" v-html="rendered"></div>
|
||||||
<!-- <markdown-it-vue class="d-block" :content="mdcontent" :options="mdoptions"/>-->
|
|
||||||
<markdown-it-vue class="md-body" ref="myMarkdownItVue" :content="mdcontent" :options="options"/>
|
|
||||||
<!-- </v-main>-->
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import MarkdownItVue from 'markdown-it-vue'
|
import "markdown-it"
|
||||||
// https://www.npmjs.com/package/markdown-it-replace-link
|
import "markdown-it-imsize"
|
||||||
// https://www.npmjs.com/package/markdown-it-relativelink
|
let mdit = require('markdown-it')({
|
||||||
// import 'markdown-it-link-attributes'
|
html: true,
|
||||||
// import 'markdown-it-relativelink'
|
linkify: true,
|
||||||
// let mireli = require('markdown-it-relativelink')({prefix: 'http://example.com/'})
|
typography: true
|
||||||
|
}).use(require('markdown-it-imsize'))
|
||||||
import 'markdown-it-replace-link'
|
|
||||||
|
|
||||||
let mireplink = require('markdown-it-replace-link')
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "MarkdownVue",
|
name: "MarkdownVue",
|
||||||
components: {MarkdownItVue},
|
|
||||||
mounted() {
|
|
||||||
let mmd = this.$refs.myMarkdownItVue;
|
|
||||||
mmd.use(mireplink);
|
|
||||||
|
|
||||||
// mmd.use(mirl)
|
|
||||||
// console.log("typeof(mmd):" + typeof (mmd))
|
|
||||||
|
|
||||||
},
|
|
||||||
// data() {
|
|
||||||
// let options = {
|
|
||||||
// markdownIt: {
|
|
||||||
// linkify: true
|
|
||||||
// },
|
|
||||||
// linkAttributes: {
|
|
||||||
// attrs: {
|
|
||||||
// target: '_blank',
|
|
||||||
// rel: 'noopener'
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// replaceLink: function(link, env) {
|
|
||||||
// return "LINK:" + link;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// return {options}
|
|
||||||
// },
|
|
||||||
props: {
|
props: {
|
||||||
mdcontent: String,
|
mdcontent: String
|
||||||
options: {
|
},
|
||||||
testing: "one two three"
|
computed: {
|
||||||
|
rendered() {
|
||||||
|
let rendered = mdit.render(this.mdcontent);
|
||||||
|
// console.log("got rendered:" + rendered.length + " characters")
|
||||||
|
return rendered
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
||||||
.v-application code {
|
.v-application code {
|
||||||
|
@ -92,21 +92,23 @@ export default {
|
|||||||
let categories = await store.getters["docs/getCategories"]
|
let categories = await store.getters["docs/getCategories"]
|
||||||
let active_category = docpaths.getCategory(route, categories);
|
let active_category = docpaths.getCategory(route, categories);
|
||||||
let active_topic = docpaths.getTopic(route, categories, active_category);
|
let active_topic = docpaths.getTopic(route, categories, active_category);
|
||||||
|
let markdown_body = active_topic.content;
|
||||||
|
|
||||||
|
// console.log("markdown_body is " + markdown_body.length + " characters")
|
||||||
return {
|
return {
|
||||||
active_category,
|
active_category,
|
||||||
active_topic,
|
active_topic,
|
||||||
markdown_body: active_topic.content
|
markdown_body: markdown_body
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async toggleDrawer() {
|
async toggleDrawer() {
|
||||||
this.isDrawerOpen=!this.isDrawerOpen;
|
this.isDrawerOpen=!this.isDrawerOpen;
|
||||||
// await this.$store.dispatch("docs/setIsDrawerOpen", this.$store.getters["docs/getIsDrawerOpen"])
|
// await this.$store.dispatch("docs/setIsDrawerOpen", this.$store.getters["docs/getIsDrawerOpen"])
|
||||||
console.log("toggled drawer, now " + this.isDrawerOpen)
|
// console.log("toggled drawer, now " + this.isDrawerOpen)
|
||||||
},
|
},
|
||||||
menuChanged(evt) {
|
menuChanged(evt) {
|
||||||
console.log("menu changed:" + JSON.stringify(evt, null, 2))
|
// console.log("menu changed:" + JSON.stringify(evt, null, 2))
|
||||||
this.$forceUpdate()
|
this.$forceUpdate()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user