Attempt at comments for documentation
This commit is contained in:
parent
ad284c756b
commit
5c0eead38d
31
docs/.vuepress/components/Comments.vue
Normal file
31
docs/.vuepress/components/Comments.vue
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
<template></template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
destroyed() {
|
||||||
|
// remove comments section. It seems that utteranc does not support SPA
|
||||||
|
const utterances = document.querySelectorAll(".utterances");
|
||||||
|
const remove = e => e.parentElement.removeChild(e);
|
||||||
|
|
||||||
|
if (!!utterances) {
|
||||||
|
for (let i = 0; i < utterances.length; i++) {
|
||||||
|
remove(utterances[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
// this script adds HTML element and removes self
|
||||||
|
const script = document.createElement("script");
|
||||||
|
script.setAttribute("src", "https://utteranc.es/client.js");
|
||||||
|
script.setAttribute("repo", "noties/Markwon");
|
||||||
|
script.setAttribute("issue-term", "pathname");
|
||||||
|
script.setAttribute("label", "doc-comments");
|
||||||
|
script.setAttribute("theme", "github-light");
|
||||||
|
script.setAttribute("crossorigin", "anonymous");
|
||||||
|
script.setAttribute("async", true);
|
||||||
|
|
||||||
|
const page = document.querySelectorAll(".page")[0];
|
||||||
|
page.appendChild(script);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
@ -63,3 +63,5 @@ This section is kept due to historical reasons. Starting with version <Badge tex
|
|||||||
the amount of magic is reduced. To leverage your `Markwon` usage a concept of `Plugin`
|
the amount of magic is reduced. To leverage your `Markwon` usage a concept of `Plugin`
|
||||||
is introduced which helps to extend default behavior in a simple and _no-breaking-the-flow_ manner.
|
is introduced which helps to extend default behavior in a simple and _no-breaking-the-flow_ manner.
|
||||||
Head to the [next section](/docs/v3/core/plugins.md) to know more.
|
Head to the [next section](/docs/v3/core/plugins.md) to know more.
|
||||||
|
|
||||||
|
<Comments />
|
Loading…
x
Reference in New Issue
Block a user