Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[hotfix] Simplify pdf renderer. #225

Merged
merged 1 commit into from
Apr 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions packages/doxdox-renderer-pdf/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
import { tmpdir } from 'node:os';

import { writeFile } from 'node:fs/promises';

import { join } from 'node:path';

import { markdownTable } from 'markdown-table';

import MarkdownIt from 'markdown-it';
Expand Down Expand Up @@ -173,15 +167,11 @@ export default async (doc: Doc): Promise<Buffer> => {
</html>
`;

const tempPath = join(tmpdir(), 'temp.html');

await writeFile(tempPath, html);

const browser = await puppeteer.launch({ headless: true });

const page = await browser.newPage();

await page.goto(`file://${tempPath}`, {
await page.setContent(html, {
waitUntil: 'networkidle0'
});

Expand Down