@funbrew/pdf 1.0.0 → 1.1.0
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/README.ja.md +6 -0
- package/README.md +6 -0
- package/package.json +1 -1
- package/src/index.d.ts +2 -0
- package/src/index.js +14 -0
package/README.ja.md
CHANGED
|
@@ -22,6 +22,12 @@ console.log(result.data.download_url);
|
|
|
22
22
|
// URL → PDF
|
|
23
23
|
const result = await pdf.fromUrl('https://example.com');
|
|
24
24
|
|
|
25
|
+
// Markdown → PDF
|
|
26
|
+
const result = await pdf.fromMarkdown('# Hello World', 'modern');
|
|
27
|
+
|
|
28
|
+
// Markdownテーマ一覧を取得
|
|
29
|
+
const themes = await pdf.markdownThemes();
|
|
30
|
+
|
|
25
31
|
// テンプレート → PDF
|
|
26
32
|
const result = await pdf.fromTemplate('invoice', {
|
|
27
33
|
company_name: 'FUNBREW Inc.',
|
package/README.md
CHANGED
|
@@ -24,6 +24,12 @@ console.log(result.data.download_url);
|
|
|
24
24
|
// URL to PDF
|
|
25
25
|
const result = await pdf.fromUrl('https://example.com');
|
|
26
26
|
|
|
27
|
+
// Markdown to PDF
|
|
28
|
+
const result = await pdf.fromMarkdown('# Hello World', 'modern');
|
|
29
|
+
|
|
30
|
+
// List available Markdown themes
|
|
31
|
+
const themes = await pdf.markdownThemes();
|
|
32
|
+
|
|
27
33
|
// Template to PDF
|
|
28
34
|
const result = await pdf.fromTemplate('invoice', {
|
|
29
35
|
company_name: 'Acme Inc.',
|
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -37,6 +37,8 @@ export class FunbrewPdf {
|
|
|
37
37
|
constructor(apiKey: string, options?: { baseUrl?: string });
|
|
38
38
|
fromHtml(html: string, options?: PdfOptions): Promise<PdfResult>;
|
|
39
39
|
fromUrl(url: string, options?: PdfOptions): Promise<PdfResult>;
|
|
40
|
+
fromMarkdown(markdown: string, theme?: 'business' | 'modern' | 'minimal' | 'academic' | 'creative', options?: PdfOptions): Promise<PdfResult>;
|
|
41
|
+
markdownThemes(): Promise<{ data: Array<{ id: string; name: string; description: string }> }>;
|
|
40
42
|
fromTemplate(slug: string, variables?: Record<string, string>, options?: PdfOptions): Promise<PdfResult>;
|
|
41
43
|
fromHtmlWithEmail(html: string, to: string, subject?: string, body?: string, options?: PdfOptions): Promise<PdfResult>;
|
|
42
44
|
batch(items: Array<Record<string, any>>): Promise<any>;
|
package/src/index.js
CHANGED
|
@@ -19,6 +19,20 @@ class FunbrewPdf {
|
|
|
19
19
|
return this._post('/api/pdf/generate-from-url', { url, ...options });
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
/** Generate PDF from Markdown */
|
|
23
|
+
async fromMarkdown(markdown, theme = 'business', options = {}) {
|
|
24
|
+
return this._post('/api/pdf/generate-from-markdown', {
|
|
25
|
+
markdown,
|
|
26
|
+
theme,
|
|
27
|
+
...options,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** Get available Markdown themes */
|
|
32
|
+
async markdownThemes() {
|
|
33
|
+
return this._get('/api/markdown/themes');
|
|
34
|
+
}
|
|
35
|
+
|
|
22
36
|
/** Generate PDF from template */
|
|
23
37
|
async fromTemplate(slug, variables = {}, options = {}) {
|
|
24
38
|
return this._post('/api/pdf/generate-from-template', {
|