Attempt at comments for documentation

This commit is contained in:
Dimitry Ivanov 2019-04-05 14:50:57 +03:00
parent ad284c756b
commit 5c0eead38d
2 changed files with 33 additions and 0 deletions

View 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>

View File

@ -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`
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.
<Comments />