supadeck 0.0.7 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/export.js +35 -0
- package/dist/cli/index.js +89 -30533
- package/dist/cli/serve.js +12 -0
- package/dist/cli/templates.js +69 -0
- package/dist/cli/workspace.js +26 -0
- package/dist/content/parse-deck.js +136 -0
- package/dist/content/rehype-shiki-code-blocks.js +139 -0
- package/dist/content/remark-unwrap-jsx-paragraphs.js +63 -0
- package/dist/export/pdf.js +40 -0
- package/dist/index.js +11 -2808
- package/dist/runtime/App.js +45 -0
- package/dist/runtime/components/Callout.js +13 -0
- package/dist/runtime/components/Center.js +4 -0
- package/dist/runtime/components/Columns.js +4 -0
- package/dist/runtime/components/Disclosure.js +5 -0
- package/dist/runtime/components/Frame.js +4 -0
- package/dist/runtime/components/index.js +4 -0
- package/dist/runtime/default-components.js +59 -0
- package/dist/runtime/hooks/slides.js +45 -0
- package/dist/runtime/layout/DeckSlide.js +6 -0
- package/dist/runtime/layout/SlideFrame.js +6 -0
- package/dist/runtime/main.js +21 -2868
- package/dist/runtime/primitives/DeckChrome.js +6 -0
- package/dist/runtime/primitives/DeckNavigation.js +4 -0
- package/dist/runtime/primitives/DeckProgress.js +5 -0
- package/dist/runtime/primitives/DeckTitle.js +4 -0
- package/dist/runtime/tailwind-hmr.js +67 -0
- package/dist/runtime/tailwind-sources.js +42 -0
- package/dist/runtime/theme-resolution.js +62 -0
- package/dist/runtime/theme-types.js +1 -0
- package/dist/runtime/themes/base/DefaultDeck.js +10 -0
- package/dist/runtime/themes/default/DefaultThemeDeck.js +22 -0
- package/dist/runtime/themes/default/components.js +100 -0
- package/dist/runtime/themes/default/index.js +15 -312
- package/dist/runtime/themes/sunset/index.js +10 -2737
- package/dist/runtime/utils/use-current-slide.js +19 -0
- package/dist/runtime/vite-config.js +201 -30209
- package/package.json +11 -16
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { build, preview } from "vite";
|
|
2
|
+
import { exportDeckToPdf } from "../export/pdf.js";
|
|
3
|
+
import { createSupadeckViteConfig } from "../runtime/vite-config.js";
|
|
4
|
+
export async function runExport({ deckPath, outputPath, themeOverride, }) {
|
|
5
|
+
const config = createSupadeckViteConfig({
|
|
6
|
+
deckPath,
|
|
7
|
+
themeOverride,
|
|
8
|
+
outputDirName: ".supadeck-dist",
|
|
9
|
+
});
|
|
10
|
+
await build(config);
|
|
11
|
+
const previewServer = await preview({
|
|
12
|
+
...config,
|
|
13
|
+
preview: {
|
|
14
|
+
host: "127.0.0.1",
|
|
15
|
+
port: 4173,
|
|
16
|
+
strictPort: false,
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
const urls = previewServer.resolvedUrls?.local ?? [];
|
|
20
|
+
const baseUrl = urls[0];
|
|
21
|
+
if (!baseUrl) {
|
|
22
|
+
await previewServer.httpServer?.close();
|
|
23
|
+
throw new Error("Unable to determine preview URL for PDF export.");
|
|
24
|
+
}
|
|
25
|
+
try {
|
|
26
|
+
await exportDeckToPdf({
|
|
27
|
+
url: `${baseUrl}?print=1`,
|
|
28
|
+
outputPath,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
finally {
|
|
32
|
+
await previewServer.httpServer?.close();
|
|
33
|
+
}
|
|
34
|
+
console.log(`[supadeck] PDF exported to ${outputPath}`);
|
|
35
|
+
}
|