mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-05-05 13:57:10 -04:00
Merge 24a806f1e3
into b59942ad9f
This commit is contained in:
commit
b8c7cae171
9 changed files with 345 additions and 16 deletions
37
src/tools/css-prettifier/css-prettifier.vue
Normal file
37
src/tools/css-prettifier/css-prettifier.vue
Normal file
|
@ -0,0 +1,37 @@
|
|||
<script setup lang="ts">
|
||||
import beautify from 'js-beautify';
|
||||
import TextareaCopyable from '@/components/TextareaCopyable.vue';
|
||||
|
||||
const inputCSS = ref('');
|
||||
const outputCSS = computed(() => {
|
||||
return beautify.css(inputCSS.value, {
|
||||
indent_char: ' ',
|
||||
indent_size: 2,
|
||||
eol: '\n',
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<c-input-text
|
||||
v-model:value="inputCSS"
|
||||
multiline raw-text
|
||||
placeholder="Your CSS content..."
|
||||
rows="8"
|
||||
autofocus
|
||||
label="Your CSS to format (can paste from clipboard):"
|
||||
/>
|
||||
|
||||
<n-divider />
|
||||
|
||||
<n-form-item label="Output prettified CSS:">
|
||||
<TextareaCopyable
|
||||
:value="outputCSS"
|
||||
multiline
|
||||
language="css"
|
||||
word-wrap
|
||||
/>
|
||||
</n-form-item>
|
||||
</div>
|
||||
</template>
|
12
src/tools/css-prettifier/index.ts
Normal file
12
src/tools/css-prettifier/index.ts
Normal file
|
@ -0,0 +1,12 @@
|
|||
import { BrandCss3 } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Css prettifier',
|
||||
path: '/css-prettifier',
|
||||
description: 'CSS Prettify',
|
||||
keywords: ['css', 'prettifier', 'beautify', 'prettier', 'format'],
|
||||
component: () => import('./css-prettifier.vue'),
|
||||
icon: BrandCss3,
|
||||
createdAt: new Date('2024-03-15'),
|
||||
});
|
40
src/tools/html-prettifier/html-prettifier.vue
Normal file
40
src/tools/html-prettifier/html-prettifier.vue
Normal file
|
@ -0,0 +1,40 @@
|
|||
<script setup lang="ts">
|
||||
import beautify from 'js-beautify';
|
||||
import TextareaCopyable from '@/components/TextareaCopyable.vue';
|
||||
|
||||
const inputHtml = ref('');
|
||||
const outputHtml = computed(() => {
|
||||
return beautify.html(inputHtml.value, {
|
||||
unformatted: ['code', 'pre', 'em', 'strong', 'span'],
|
||||
indent_inner_html: true,
|
||||
indent_char: ' ',
|
||||
indent_size: 2,
|
||||
eol: '\n',
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<c-input-text
|
||||
v-model:value="inputHtml"
|
||||
multiline raw-text
|
||||
placeholder="Your HTML content..."
|
||||
rows="8"
|
||||
autofocus
|
||||
label="Your HTML to format (can paste from clipboard):"
|
||||
paste-html
|
||||
/>
|
||||
|
||||
<n-divider />
|
||||
|
||||
<n-form-item label="Output prettified HTML:">
|
||||
<TextareaCopyable
|
||||
:value="outputHtml"
|
||||
multiline
|
||||
language="html"
|
||||
:word-wrap="true"
|
||||
/>
|
||||
</n-form-item>
|
||||
</div>
|
||||
</template>
|
12
src/tools/html-prettifier/index.ts
Normal file
12
src/tools/html-prettifier/index.ts
Normal file
|
@ -0,0 +1,12 @@
|
|||
import { BrandHtml5 } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Html Prettifier',
|
||||
path: '/html-prettifier',
|
||||
description: 'Prettify HTML code',
|
||||
keywords: ['html', 'prettifier', 'beautify', 'prettier', 'format'],
|
||||
component: () => import('./html-prettifier.vue'),
|
||||
icon: BrandHtml5,
|
||||
createdAt: new Date('2024-03-15'),
|
||||
});
|
|
@ -6,6 +6,9 @@ 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 javascriptPrettifier } from './javascript-prettifier';
|
||||
import { tool as cssPrettifier } from './css-prettifier';
|
||||
import { tool as htmlPrettifier } from './html-prettifier';
|
||||
import { tool as pdfSignatureChecker } from './pdf-signature-checker';
|
||||
import { tool as numeronymGenerator } from './numeronym-generator';
|
||||
import { tool as macAddressGenerator } from './mac-address-generator';
|
||||
|
@ -148,6 +151,9 @@ export const toolsByCategory: ToolCategory[] = [
|
|||
dockerRunToDockerComposeConverter,
|
||||
xmlFormatter,
|
||||
yamlViewer,
|
||||
cssPrettifier,
|
||||
htmlPrettifier,
|
||||
javascriptPrettifier,
|
||||
],
|
||||
},
|
||||
{
|
||||
|
|
12
src/tools/javascript-prettifier/index.ts
Normal file
12
src/tools/javascript-prettifier/index.ts
Normal file
|
@ -0,0 +1,12 @@
|
|||
import { BrandJavascript } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Javascript Prettifier',
|
||||
path: '/javascript-prettifier',
|
||||
description: 'JS/Javascript Prettifier',
|
||||
keywords: ['javascript', 'prettifier', 'beautify', 'prettier', 'format'],
|
||||
component: () => import('./javascript-prettifier.vue'),
|
||||
icon: BrandJavascript,
|
||||
createdAt: new Date('2024-03-15'),
|
||||
});
|
37
src/tools/javascript-prettifier/javascript-prettifier.vue
Normal file
37
src/tools/javascript-prettifier/javascript-prettifier.vue
Normal file
|
@ -0,0 +1,37 @@
|
|||
<script setup lang="ts">
|
||||
import beautify from 'js-beautify';
|
||||
import TextareaCopyable from '@/components/TextareaCopyable.vue';
|
||||
|
||||
const inputJS = ref('');
|
||||
const outputJS = computed(() => {
|
||||
return beautify(inputJS.value, {
|
||||
indent_char: ' ',
|
||||
indent_size: 2,
|
||||
eol: '\n',
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<c-input-text
|
||||
v-model:value="inputJS"
|
||||
multiline raw-text
|
||||
placeholder="Your JS content..."
|
||||
rows="8"
|
||||
autofocus
|
||||
label="Your JS to format (can paste from clipboard):"
|
||||
/>
|
||||
|
||||
<n-divider />
|
||||
|
||||
<n-form-item label="Output prettified JS:">
|
||||
<TextareaCopyable
|
||||
:value="outputJS"
|
||||
multiline
|
||||
language="javascript"
|
||||
word-wrap
|
||||
/>
|
||||
</n-form-item>
|
||||
</div>
|
||||
</template>
|
Loading…
Add table
Add a link
Reference in a new issue