feat(new tool): Paste as Markdown

This commit is contained in:
sharevb 2024-08-09 21:19:23 +02:00
parent e1b4f9aafe
commit d72facf062
3 changed files with 26 additions and 0 deletions

View File

@ -6,6 +6,7 @@ import { tool as asciiTextDrawer } from './ascii-text-drawer';
import { tool as textToUnicode } from './text-to-unicode';
import { tool as safelinkDecoder } from './safelink-decoder';
import { tool as pasteAsMarkdown } from './paste-as-markdown';
import { tool as pdfSignatureChecker } from './pdf-signature-checker';
import { tool as numeronymGenerator } from './numeronym-generator';
import { tool as macAddressGenerator } from './mac-address-generator';
@ -172,6 +173,7 @@ export const toolsByCategory: ToolCategory[] = [
textDiff,
numeronymGenerator,
asciiTextDrawer,
pasteAsMarkdown,
],
},
{

View File

@ -0,0 +1,12 @@
import { Markdown } from '@vicons/tabler';
import { defineTool } from '../tool';
export const tool = defineTool({
name: 'Paste as Markdown',
path: '/paste-as-markdown',
description: 'Paste clipboard content as Markdown',
keywords: ['paste', 'markdown'],
component: () => import('./paste-as-markdown.vue'),
icon: Markdown,
createdAt: new Date('2024-07-14'),
});

View File

@ -0,0 +1,12 @@
<script setup lang="ts">
import { subscribe } from '@github/paste-markdown';
// Subscribe the behavior to the textarea.
subscribe(document.querySelector('.paste-zone textarea') as never);
</script>
<template>
<c-card title="Paste in Markdown" class="paste-zone">
<textarea-copyable language="markdown" />
</c-card>
</template>