mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-05-04 13:29:13 -04:00
markdown-to-html
This commit is contained in:
parent
b986c49df6
commit
a97e1897e5
4 changed files with 24 additions and 6 deletions
|
@ -481,3 +481,11 @@ tools:
|
|||
description: >-
|
||||
Vereinheitlichen von E-Mail-Adressen auf ein Standardformat für einen
|
||||
einfacheren Vergleich. Nützlich für Deduplizierung und Datenbereinigung.
|
||||
markdown-to-html:
|
||||
title: Markdown zu HTML
|
||||
description: Markdown in HTML konvertieren und (als PDF) ausdrucken
|
||||
markdown: 'Dein zu konvertierender Markdown-Inhalt:'
|
||||
markdownInput: Dein Markdown-Inhalt...
|
||||
html: 'HTML-Ausgabe:'
|
||||
button:
|
||||
print: Als PDF drucken
|
||||
|
|
|
@ -450,3 +450,11 @@ tools:
|
|||
description: >-
|
||||
Normalize email addresses to a standard format for easier comparison.
|
||||
Useful for deduplication and data cleaning.
|
||||
markdown-to-html:
|
||||
title: Markdown to HTML
|
||||
description: Convert Markdown to HTML and allow to print (as PDF)
|
||||
markdown: 'Your Markdown to convert:'
|
||||
markdownInput: Your Markdown content...
|
||||
html: 'Output HTML:'
|
||||
button:
|
||||
print: Print as PDF
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
import { Markdown } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
import { translate } from '@/plugins/i18n.plugin';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Markdown to HTML',
|
||||
name: translate('tools.markdown-to-html.title'),
|
||||
path: '/markdown-to-html',
|
||||
description: 'Convert Markdown to Html and allow to print (as PDF)',
|
||||
description: translate('tools.markdown-to-html.description'),
|
||||
keywords: ['markdown', 'html', 'converter', 'pdf'],
|
||||
component: () => import('./markdown-to-html.vue'),
|
||||
icon: Markdown,
|
||||
|
|
|
@ -7,6 +7,7 @@ const outputHtml = computed(() => {
|
|||
const md = markdownit();
|
||||
return md.render(inputMarkdown.value);
|
||||
});
|
||||
const { t } = useI18n();
|
||||
|
||||
function printHtml() {
|
||||
const w = window.open();
|
||||
|
@ -23,21 +24,21 @@ function printHtml() {
|
|||
<c-input-text
|
||||
v-model:value="inputMarkdown"
|
||||
multiline raw-text
|
||||
placeholder="Your Markdown content..."
|
||||
:placeholder="t('tools.markdown-to-html.markdownInput')"
|
||||
rows="8"
|
||||
autofocus
|
||||
label="Your Markdown to convert:"
|
||||
:label="t('tools.markdown-to-html.markdown')"
|
||||
/>
|
||||
|
||||
<n-divider />
|
||||
|
||||
<n-form-item label="Output HTML:">
|
||||
<n-form-item :label="t('tools.markdown-to-html.html')">
|
||||
<TextareaCopyable :value="outputHtml" :word-wrap="true" language="html" />
|
||||
</n-form-item>
|
||||
|
||||
<div flex justify-center>
|
||||
<n-button @click="printHtml">
|
||||
Print as PDF
|
||||
{{ t('tools.markdown-to-html.button.print') }}
|
||||
</n-button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue