feat(app/web): add copy markdown code button (#1246)

This commit is contained in:
Sercan Üste
2022-10-04 00:23:29 +03:00
committed by GitHub
parent cb145da1cd
commit 8d78db6923
3 changed files with 13 additions and 15 deletions

View File

@@ -84,7 +84,9 @@
tab: {
immediate: true,
handler(current) {
if (current === "action")
if (current === "markdown")
this.clipboard = new ClipboardJS(".copy-markdown")
else if (current === "action")
this.clipboard = new ClipboardJS(".copy-action")
else
this.clipboard?.destroy()

View File

@@ -190,6 +190,9 @@
<div class="image" :class="{pending:generated.pending}" v-html="generated.content||templates.placeholder.image"></div>
</div>
<div v-else-if="tab == 'markdown'">
<div>
<button class="copy-markdown" data-clipboard-target=".code">Copy Markdown Code</button>
</div>
Add the markdown below to your <i>README.md</i> <template v-if="user">at <a :href="repo">{{ user }}/{{ user }}</a></template>
<div class="code">
<Prism language="markdown" :code="embed"></Prism>