Skip to content

Commit d72facf

Browse files
committed
feat(new tool): Paste as Markdown
1 parent e1b4f9a commit d72facf

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

src/tools/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { tool as asciiTextDrawer } from './ascii-text-drawer';
66

77
import { tool as textToUnicode } from './text-to-unicode';
88
import { tool as safelinkDecoder } from './safelink-decoder';
9+
import { tool as pasteAsMarkdown } from './paste-as-markdown';
910
import { tool as pdfSignatureChecker } from './pdf-signature-checker';
1011
import { tool as numeronymGenerator } from './numeronym-generator';
1112
import { tool as macAddressGenerator } from './mac-address-generator';
@@ -172,6 +173,7 @@ export const toolsByCategory: ToolCategory[] = [
172173
textDiff,
173174
numeronymGenerator,
174175
asciiTextDrawer,
176+
pasteAsMarkdown,
175177
],
176178
},
177179
{

src/tools/paste-as-markdown/index.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { Markdown } from '@vicons/tabler';
2+
import { defineTool } from '../tool';
3+
4+
export const tool = defineTool({
5+
name: 'Paste as Markdown',
6+
path: '/paste-as-markdown',
7+
description: 'Paste clipboard content as Markdown',
8+
keywords: ['paste', 'markdown'],
9+
component: () => import('./paste-as-markdown.vue'),
10+
icon: Markdown,
11+
createdAt: new Date('2024-07-14'),
12+
});
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<script setup lang="ts">
2+
import { subscribe } from '@github/paste-markdown';
3+
4+
// Subscribe the behavior to the textarea.
5+
subscribe(document.querySelector('.paste-zone textarea') as never);
6+
</script>
7+
8+
<template>
9+
<c-card title="Paste in Markdown" class="paste-zone">
10+
<textarea-copyable language="markdown" />
11+
</c-card>
12+
</template>

0 commit comments

Comments
 (0)