Skip to content

Commit 3573849

Browse files
authored
Merge branch 'main' into feat/email-parser
2 parents b50b790 + 6709498 commit 3573849

File tree

10 files changed

+105
-4
lines changed

10 files changed

+105
-4
lines changed

.github/logo-dark.png

39.5 KB
Loading

.github/logo-white.png

38.7 KB
Loading

.github/logo.png

-7.81 KB
Binary file not shown.

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
![logo](.github/logo.png)
1+
<picture>
2+
<source srcset="./.github/logo-dark.png" media="(prefers-color-scheme: light)">
3+
<source srcset="./.github/logo-white.png" media="(prefers-color-scheme: dark)">
4+
<img src="./.github/logo-dark.png" alt="logo">
5+
</picture>
26

37
Useful tools for developer and people working in IT. [Have a look !](https://it-tools.tech).
48

components.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ declare module '@vue/runtime-core' {
122122
LoremIpsumGenerator: typeof import('./src/tools/lorem-ipsum-generator/lorem-ipsum-generator.vue')['default']
123123
MacAddressGenerator: typeof import('./src/tools/mac-address-generator/mac-address-generator.vue')['default']
124124
MacAddressLookup: typeof import('./src/tools/mac-address-lookup/mac-address-lookup.vue')['default']
125+
MarkdownToHtml: typeof import('./src/tools/markdown-to-html/markdown-to-html.vue')['default']
125126
MathEvaluator: typeof import('./src/tools/math-evaluator/math-evaluator.vue')['default']
126127
MenuBar: typeof import('./src/tools/html-wysiwyg-editor/editor/menu-bar.vue')['default']
127128
MenuBarItem: typeof import('./src/tools/html-wysiwyg-editor/editor/menu-bar-item.vue')['default']

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"@tiptap/pm": "2.1.6",
4444
"@tiptap/starter-kit": "2.1.6",
4545
"@tiptap/vue-3": "2.0.3",
46+
"@types/markdown-it": "^13.0.7",
4647
"@types/figlet": "^1.5.8",
4748
"@vicons/material": "^0.12.0",
4849
"@vicons/tabler": "^0.12.0",
@@ -73,6 +74,7 @@
7374
"jwt-decode": "^3.1.2",
7475
"libphonenumber-js": "^1.10.28",
7576
"lodash": "^4.17.21",
77+
"markdown-it": "^14.0.0",
7678
"marked": "^10.0.0",
7779
"mathjs": "^11.9.1",
7880
"mime-types": "^2.1.35",

pnpm-lock.yaml

Lines changed: 39 additions & 3 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
@@ -11,6 +11,7 @@ import { tool as textToUnicode } from './text-to-unicode';
1111
import { tool as safelinkDecoder } from './safelink-decoder';
1212
import { tool as xmlToJson } from './xml-to-json';
1313
import { tool as jsonToXml } from './json-to-xml';
14+
import { tool as markdownToHtml } from './markdown-to-html';
1415
import { tool as pdfSignatureChecker } from './pdf-signature-checker';
1516
import { tool as numeronymGenerator } from './numeronym-generator';
1617
import { tool as macAddressGenerator } from './mac-address-generator';
@@ -114,6 +115,7 @@ export const toolsByCategory: ToolCategory[] = [
114115
tomlToYaml,
115116
xmlToJson,
116117
jsonToXml,
118+
markdownToHtml,
117119
],
118120
},
119121
{

src/tools/markdown-to-html/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: 'Markdown to HTML',
6+
path: '/markdown-to-html',
7+
description: 'Convert Markdown to Html and allow to print (as PDF)',
8+
keywords: ['markdown', 'html', 'converter', 'pdf'],
9+
component: () => import('./markdown-to-html.vue'),
10+
icon: Markdown,
11+
createdAt: new Date('2024-08-25'),
12+
});
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<script setup lang="ts">
2+
import markdownit from 'markdown-it';
3+
import TextareaCopyable from '@/components/TextareaCopyable.vue';
4+
5+
const inputMarkdown = ref('');
6+
const outputHtml = computed(() => {
7+
const md = markdownit();
8+
return md.render(inputMarkdown.value);
9+
});
10+
11+
function printHtml() {
12+
const w = window.open();
13+
if (w === null) {
14+
return;
15+
}
16+
w.document.body.innerHTML = outputHtml.value;
17+
w.print();
18+
}
19+
</script>
20+
21+
<template>
22+
<div>
23+
<c-input-text
24+
v-model:value="inputMarkdown"
25+
multiline raw-text
26+
placeholder="Your Markdown content..."
27+
rows="8"
28+
autofocus
29+
label="Your Markdown to convert:"
30+
/>
31+
32+
<n-divider />
33+
34+
<n-form-item label="Output HTML:">
35+
<TextareaCopyable :value="outputHtml" :word-wrap="true" language="html" />
36+
</n-form-item>
37+
38+
<div flex justify-center>
39+
<n-button @click="printHtml">
40+
Print as PDF
41+
</n-button>
42+
</div>
43+
</div>
44+
</template>

0 commit comments

Comments
 (0)