mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-05-08 07:11:03 -04:00
Created simple markdown viewer
This commit is contained in:
parent
80e46c9292
commit
d48119bf06
9 changed files with 103 additions and 0 deletions
43
src/tools/markdown-viewer/markdown-viewer.vue
Normal file
43
src/tools/markdown-viewer/markdown-viewer.vue
Normal file
|
@ -0,0 +1,43 @@
|
|||
<script setup lang="ts">
|
||||
import { useStorage } from '@vueuse/core';
|
||||
import showdown from 'showdown'
|
||||
import CCard from "@/ui/c-card/c-card.vue";
|
||||
|
||||
const converter = new showdown.Converter()
|
||||
const inputElement = ref<HTMLElement>();
|
||||
const rawMd = useStorage('json-prettify:raw-json', '{"hello": "world", "foo": "bar"}');
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<n-form-item
|
||||
label="Your raw MD"
|
||||
>
|
||||
<c-input-text
|
||||
ref="inputElement"
|
||||
v-model:value="rawMd"
|
||||
placeholder="Paste your raw JSON here..."
|
||||
rows="35"
|
||||
multiline
|
||||
autocomplete="off"
|
||||
autocorrect="off"
|
||||
autocapitalize="off"
|
||||
spellcheck="false"
|
||||
monospace
|
||||
/>
|
||||
</n-form-item>
|
||||
<n-form-item label="Prettified version of your MD">
|
||||
<c-card style="width: 100%; overflow: scroll" v-html="converter.makeHtml(rawMd)"></c-card>
|
||||
</n-form-item>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.result-card {
|
||||
position: relative;
|
||||
.copy-button {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
Loading…
Add table
Add a link
Reference in a new issue