Skip to content

Commit 9cee2d1

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

File tree

6 files changed

+52
-8
lines changed

6 files changed

+52
-8
lines changed

components.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ declare module '@vue/runtime-core' {
148148
NumeronymGenerator: typeof import('./src/tools/numeronym-generator/numeronym-generator.vue')['default']
149149
OtpCodeGeneratorAndValidator: typeof import('./src/tools/otp-code-generator-and-validator/otp-code-generator-and-validator.vue')['default']
150150
PasswordStrengthAnalyser: typeof import('./src/tools/password-strength-analyser/password-strength-analyser.vue')['default']
151+
PasteAsMarkdown: typeof import('./src/tools/paste-as-markdown/paste-as-markdown.vue')['default']
151152
PdfSignatureChecker: typeof import('./src/tools/pdf-signature-checker/pdf-signature-checker.vue')['default']
152153
PdfSignatureDetails: typeof import('./src/tools/pdf-signature-checker/components/pdf-signature-details.vue')['default']
153154
PercentageCalculator: typeof import('./src/tools/percentage-calculator/percentage-calculator.vue')['default']

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"release": "node ./scripts/release.mjs"
3636
},
3737
"dependencies": {
38+
"@github/paste-markdown": "^1.5.3",
3839
"@it-tools/bip39": "^0.0.4",
3940
"@it-tools/oggen": "^1.3.0",
4041
"@sindresorhus/slugify": "^2.2.1",

pnpm-lock.yaml

Lines changed: 16 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<script setup lang="ts">
2+
import { subscribe } from '@github/paste-markdown';
3+
4+
const inputElement = ref<HTMLElement>();
5+
const markdown = ref('');
6+
7+
// Subscribe the behavior to the textarea.
8+
onMounted(() => {
9+
subscribe(inputElement.value as never);
10+
});
11+
</script>
12+
13+
<template>
14+
<c-card title="Paste in Markdown" class="paste-zone">
15+
<textarea
16+
ref="inputElement"
17+
rows="10"
18+
/>
19+
</c-card>
20+
</template>

0 commit comments

Comments
 (0)