mirror of https://github.com/VERT-sh/VERT.git
feat: umm actual documents support..
This commit is contained in:
parent
a84837cff4
commit
8f8ea34483
3
bun.lock
3
bun.lock
|
|
@ -4,6 +4,7 @@
|
||||||
"": {
|
"": {
|
||||||
"name": "unnamed-file-converter",
|
"name": "unnamed-file-converter",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@bjorn3/browser_wasi_shim": "^0.4.1",
|
||||||
"@ffmpeg/ffmpeg": "^0.12.15",
|
"@ffmpeg/ffmpeg": "^0.12.15",
|
||||||
"@ffmpeg/util": "^0.12.2",
|
"@ffmpeg/util": "^0.12.2",
|
||||||
"@fontsource/azeret-mono": "^5.1.1",
|
"@fontsource/azeret-mono": "^5.1.1",
|
||||||
|
|
@ -47,6 +48,8 @@
|
||||||
|
|
||||||
"@ampproject/remapping": ["@ampproject/remapping@2.3.0", "", { "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw=="],
|
"@ampproject/remapping": ["@ampproject/remapping@2.3.0", "", { "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw=="],
|
||||||
|
|
||||||
|
"@bjorn3/browser_wasi_shim": ["@bjorn3/browser_wasi_shim@0.4.1", "", {}, "sha512-54kpBQX69TZ8I1zyDC8sziv/zPT1zoIadv3CmdIZNZ5WDF1houMjAzRZ3dwWvhXObiEBjOxXyS8Ja7vA0EfGEQ=="],
|
||||||
|
|
||||||
"@esbuild/aix-ppc64": ["@esbuild/aix-ppc64@0.21.5", "", { "os": "aix", "cpu": "ppc64" }, "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ=="],
|
"@esbuild/aix-ppc64": ["@esbuild/aix-ppc64@0.21.5", "", { "os": "aix", "cpu": "ppc64" }, "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ=="],
|
||||||
|
|
||||||
"@esbuild/android-arm": ["@esbuild/android-arm@0.21.5", "", { "os": "android", "cpu": "arm" }, "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg=="],
|
"@esbuild/android-arm": ["@esbuild/android-arm@0.21.5", "", { "os": "android", "cpu": "arm" }, "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg=="],
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@
|
||||||
"vite": "^5.4.11"
|
"vite": "^5.4.11"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@bjorn3/browser_wasi_shim": "^0.4.1",
|
||||||
"@ffmpeg/ffmpeg": "^0.12.15",
|
"@ffmpeg/ffmpeg": "^0.12.15",
|
||||||
"@ffmpeg/util": "^0.12.2",
|
"@ffmpeg/util": "^0.12.2",
|
||||||
"@fontsource/azeret-mono": "^5.1.1",
|
"@fontsource/azeret-mono": "^5.1.1",
|
||||||
|
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 72 KiB |
|
|
@ -70,7 +70,7 @@
|
||||||
stroke="2"
|
stroke="2"
|
||||||
fill="none"
|
fill="none"
|
||||||
/>
|
/>
|
||||||
<p class="text-black font-normal">{message}</p>
|
<p class="text-black font-normal whitespace-pre-wrap">{message}</p>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
class="text-gray-600 hover:text-black flex-shrink-0"
|
class="text-gray-600 hover:text-black flex-shrink-0"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import { FFmpegConverter } from "./ffmpeg.svelte";
|
import { FFmpegConverter } from "./ffmpeg.svelte";
|
||||||
|
import { PandocConverter } from "./pandoc.svelte";
|
||||||
import { VertdConverter } from "./vertd.svelte";
|
import { VertdConverter } from "./vertd.svelte";
|
||||||
import { VipsConverter } from "./vips.svelte";
|
import { VipsConverter } from "./vips.svelte";
|
||||||
|
|
||||||
|
|
@ -6,4 +7,5 @@ export const converters = [
|
||||||
new VipsConverter(),
|
new VipsConverter(),
|
||||||
new FFmpegConverter(),
|
new FFmpegConverter(),
|
||||||
new VertdConverter(),
|
new VertdConverter(),
|
||||||
|
new PandocConverter(),
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,11 @@ export class PandocConverter extends Converter {
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
throw new Error(`[${result.errorKind}] ${result.error}`);
|
if (result.errorKind)
|
||||||
|
throw new Error(
|
||||||
|
`[${result.errorKind}] ${result.error}`,
|
||||||
|
);
|
||||||
|
else throw new Error(result.error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
worker.terminate();
|
worker.terminate();
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@
|
||||||
|
|
||||||
<!-- Main contributors -->
|
<!-- Main contributors -->
|
||||||
<div class="flex flex-col gap-4">
|
<div class="flex flex-col gap-4">
|
||||||
<div class="flex flex-row flex-wrap gap-2">
|
<div class="flex flex-col flex-wrap gap-2">
|
||||||
{#each mainContribs as contrib}
|
{#each mainContribs as contrib}
|
||||||
{@const { name, github, avatar, role } = contrib}
|
{@const { name, github, avatar, role } = contrib}
|
||||||
{@render contributor(name, github, avatar, role)}
|
{@render contributor(name, github, avatar, role)}
|
||||||
|
|
@ -94,5 +94,12 @@
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
<h2 class="mt-2 -mb-2">Libraries</h2>
|
||||||
|
<p class="font-normal">
|
||||||
|
A big thanks to FFmpeg (audio, video), libvips (images) and Pandoc
|
||||||
|
(documents) for maintaining such excellent libraries for so many
|
||||||
|
years. VERT relies on them to provide you with your conversions.
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</Panel>
|
</Panel>
|
||||||
|
|
|
||||||
|
|
@ -48,10 +48,15 @@ const handleMessage = async (message: any): Promise<any> => {
|
||||||
try {
|
try {
|
||||||
// eslint-disable-next-line prefer-const
|
// eslint-disable-next-line prefer-const
|
||||||
let { to, file }: { to: Format; file: File } = message;
|
let { to, file }: { to: Format; file: File } = message;
|
||||||
|
if (to === ".rtf") {
|
||||||
|
throw new Error(
|
||||||
|
"Converting into RTF is currently not supported.",
|
||||||
|
);
|
||||||
|
}
|
||||||
const buf = new Uint8Array(await file.arrayBuffer());
|
const buf = new Uint8Array(await file.arrayBuffer());
|
||||||
const args = `-f ${formatToReader(`.${file.name.split(".").pop() || ""}` as Format)} -t ${formatToReader(to)}`;
|
const args = `-f ${formatToReader(`.${file.name.split(".").pop() || ""}` as Format)} -t ${formatToReader(to)}`;
|
||||||
const [result, stderr] = await pandoc(args, buf);
|
const [result, stderr] = await pandoc(args, buf);
|
||||||
if (stderr) {
|
if (result.length === 0) {
|
||||||
return {
|
return {
|
||||||
type: "error",
|
type: "error",
|
||||||
error: stderr
|
error: stderr
|
||||||
|
|
|
||||||
|
|
@ -10,20 +10,34 @@
|
||||||
converters.find((c) => c.name === name)?.supportedFormats.join(", ") ||
|
converters.find((c) => c.name === name)?.supportedFormats.join(", ") ||
|
||||||
"none";
|
"none";
|
||||||
|
|
||||||
const status = $derived({
|
const status: {
|
||||||
images: {
|
[key: string]: {
|
||||||
ready: converters.find((c) => c.name === "libvips")?.ready,
|
ready: boolean;
|
||||||
|
formats: string;
|
||||||
|
icon: typeof Image;
|
||||||
|
};
|
||||||
|
} = $derived({
|
||||||
|
Images: {
|
||||||
|
ready: converters.find((c) => c.name === "libvips")?.ready || false,
|
||||||
formats: getSupportedFormats("libvips"),
|
formats: getSupportedFormats("libvips"),
|
||||||
|
icon: Image,
|
||||||
},
|
},
|
||||||
audio: {
|
Audio: {
|
||||||
ready: converters.find((c) => c.name === "ffmpeg")?.ready,
|
ready: converters.find((c) => c.name === "ffmpeg")?.ready || false,
|
||||||
formats: getSupportedFormats("ffmpeg"),
|
formats: getSupportedFormats("ffmpeg"),
|
||||||
|
icon: AudioLines,
|
||||||
},
|
},
|
||||||
video: {
|
Documents: {
|
||||||
|
ready: converters.find((c) => c.name === "pandoc")?.ready || false,
|
||||||
|
formats: getSupportedFormats("pandoc"),
|
||||||
|
icon: Image,
|
||||||
|
},
|
||||||
|
Video: {
|
||||||
ready:
|
ready:
|
||||||
converters.find((c) => c.name === "vertd")?.ready &&
|
converters.find((c) => c.name === "vertd")?.ready ||
|
||||||
$vertdLoaded,
|
(false && $vertdLoaded),
|
||||||
formats: getSupportedFormats("vertd"),
|
formats: getSupportedFormats("vertd"),
|
||||||
|
icon: Film,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
@ -58,79 +72,43 @@
|
||||||
<div class="mt-10 md:mt-16">
|
<div class="mt-10 md:mt-16">
|
||||||
<h2 class="text-center text-4xl">VERT supports...</h2>
|
<h2 class="text-center text-4xl">VERT supports...</h2>
|
||||||
|
|
||||||
<div class="grid gap-4 md:grid-cols-3 mt-8">
|
<div class="flex gap-4 mt-8 md:flex-row flex-col">
|
||||||
<div class="file-category-card">
|
{#each Object.entries(status) as [key, s]}
|
||||||
<div class="file-category-card-inner">
|
{@const Icon = s.icon}
|
||||||
<div class="icon-container bg-accent-blue">
|
<div class="file-category-card w-full">
|
||||||
<Image size="20" />
|
<div class="file-category-card-inner">
|
||||||
|
<div class="icon-container bg-accent-blue">
|
||||||
|
<Icon size="20" />
|
||||||
|
</div>
|
||||||
|
<span>{key}</span>
|
||||||
</div>
|
</div>
|
||||||
<span>Images</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="file-category-card-content">
|
<div class="file-category-card-content">
|
||||||
<p class="flex items-center justify-center gap-2">
|
{#if key === "Video"}
|
||||||
<Check size="20" /> Fully supported
|
<p>
|
||||||
</p>
|
Video uploads to a server for processing by
|
||||||
<p>
|
default, learn how to set it up locally <a
|
||||||
<b>Status: </b>
|
target="_blank"
|
||||||
{status.images.ready ? "ready" : "not ready"}
|
href="https://github.com/VERT-sh/VERT/wiki/How-to-convert-video-with-VERT"
|
||||||
</p>
|
>here</a
|
||||||
<p>
|
>.
|
||||||
<b>Supported formats:</b>
|
</p>
|
||||||
{status.images.formats}
|
{:else}
|
||||||
</p>
|
<p class="flex items-center justify-center gap-2">
|
||||||
</div>
|
<Check size="20" /> Fully supported
|
||||||
</div>
|
</p>
|
||||||
|
{/if}
|
||||||
<div class="file-category-card">
|
<p>
|
||||||
<div class="file-category-card-inner">
|
<b>Status: </b>
|
||||||
<div class="icon-container bg-accent-purple">
|
{s.ready ? "ready" : "not ready"}
|
||||||
<AudioLines size="20" />
|
</p>
|
||||||
|
<p>
|
||||||
|
<b>Supported formats:</b>
|
||||||
|
{s.formats}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<span>Audio</span>
|
|
||||||
</div>
|
</div>
|
||||||
|
{/each}
|
||||||
<div class="file-category-card-content">
|
|
||||||
<p class="flex items-center justify-center gap-2">
|
|
||||||
<Check size="20" /> Fully supported
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<b>Status: </b>
|
|
||||||
{status.audio.ready ? "ready" : "not ready"}
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<b>Supported formats:</b>
|
|
||||||
{status.audio.formats}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="file-category-card">
|
|
||||||
<div class="file-category-card-inner">
|
|
||||||
<div class="icon-container bg-accent-red">
|
|
||||||
<Film size="20" />
|
|
||||||
</div>
|
|
||||||
<span>Video *</span>
|
|
||||||
</div>
|
|
||||||
<div class="file-category-card-content">
|
|
||||||
<p>
|
|
||||||
Video uploads to a server for processing by default,
|
|
||||||
learn how to set it up locally <a
|
|
||||||
target="_blank"
|
|
||||||
href="https://github.com/VERT-sh/VERT/wiki/How-to-convert-video-with-VERT"
|
|
||||||
>here</a
|
|
||||||
>.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<b>Status: </b>
|
|
||||||
{status.video.ready ? "ready" : "not ready"}
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<b>Supported formats:</b>
|
|
||||||
{status.video.formats}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
import { InfoIcon } from "lucide-svelte";
|
import { InfoIcon } from "lucide-svelte";
|
||||||
import { onMount } from "svelte";
|
import { onMount } from "svelte";
|
||||||
import avatarNullptr from "$lib/assets/avatars/nullptr.jpg";
|
import avatarNullptr from "$lib/assets/avatars/nullptr.jpg";
|
||||||
import avatarRealmy from "$lib/assets/avatars/realmy.jpg";
|
import avatarLiam from "$lib/assets/avatars/liam.jpg";
|
||||||
import avatarJovannMC from "$lib/assets/avatars/jovannmc.jpg";
|
import avatarJovannMC from "$lib/assets/avatars/jovannmc.jpg";
|
||||||
import { GITHUB_API_URL } from "$lib/consts";
|
import { GITHUB_API_URL } from "$lib/consts";
|
||||||
import { addToast } from "$lib/store/ToastProvider";
|
import { addToast } from "$lib/store/ToastProvider";
|
||||||
|
|
@ -31,18 +31,18 @@
|
||||||
role: "Lead developer; conversion backend, UI implementation",
|
role: "Lead developer; conversion backend, UI implementation",
|
||||||
avatar: avatarNullptr,
|
avatar: avatarNullptr,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: "Realmy",
|
|
||||||
github: "https://github.com/RealmyTheMan",
|
|
||||||
role: "Lead designer; logo and branding, user interface design",
|
|
||||||
avatar: avatarRealmy,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: "JovannMC",
|
name: "JovannMC",
|
||||||
github: "https://github.com/JovannMC",
|
github: "https://github.com/JovannMC",
|
||||||
role: "Developer; UI implementation",
|
role: "Developer; UI implementation",
|
||||||
avatar: avatarJovannMC,
|
avatar: avatarJovannMC,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "Liam",
|
||||||
|
github: "https://x.com/z2rMC",
|
||||||
|
role: "Designer; UX, branding, marketing",
|
||||||
|
avatar: avatarLiam,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
let ghContribs: Contributor[] = [];
|
let ghContribs: Contributor[] = [];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue