resuml 1.2.3 → 1.2.5
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/api.d.ts +8 -0
- package/dist/api.js +69 -46
- package/dist/api.js.map +1 -1
- package/dist/index.d.ts +55 -0
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/dist/loadResume-BFCirLAW.d.ts +359 -0
- package/package.json +1 -1
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Command } from 'commander';
|
|
3
|
+
import { R as ResumeSchema } from './loadResume-BFCirLAW.js';
|
|
4
|
+
export { l as loadResumeFiles, p as processResumeData } from './loadResume-BFCirLAW.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Load a theme module by name
|
|
8
|
+
* @param themeName The name of the theme to load
|
|
9
|
+
* @param options Optional settings (autoInstall: boolean)
|
|
10
|
+
* @returns The loaded theme module
|
|
11
|
+
*/
|
|
12
|
+
declare function loadTheme(themeName: string, options?: {
|
|
13
|
+
autoInstall?: boolean;
|
|
14
|
+
}): Promise<any>;
|
|
15
|
+
|
|
16
|
+
interface ThemeConfig {
|
|
17
|
+
sections?: {
|
|
18
|
+
order?: string[];
|
|
19
|
+
exclude?: string[];
|
|
20
|
+
};
|
|
21
|
+
layout?: {
|
|
22
|
+
style?: string;
|
|
23
|
+
};
|
|
24
|
+
styling?: Record<string, string | number>;
|
|
25
|
+
labels?: Record<string, string>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Render a resume using the specified theme
|
|
29
|
+
* @param themeName Name of the theme to use
|
|
30
|
+
* @param resumeData Resume data to render
|
|
31
|
+
* @param themeConfig Theme configuration
|
|
32
|
+
* @param inlineCss Optional CSS to include in the HTML
|
|
33
|
+
* @param language Language code for localization
|
|
34
|
+
* @returns Object containing the rendered HTML
|
|
35
|
+
*/
|
|
36
|
+
declare function renderTheme(themeName: string, resumeData: ResumeSchema, themeConfig?: ThemeConfig, inlineCss?: string, language?: string): Promise<{
|
|
37
|
+
htmlOutput: string;
|
|
38
|
+
}>;
|
|
39
|
+
/**
|
|
40
|
+
* Injects CSS into HTML content
|
|
41
|
+
* @param html HTML content
|
|
42
|
+
* @param css CSS to inject
|
|
43
|
+
* @returns HTML with injected CSS
|
|
44
|
+
*/
|
|
45
|
+
declare function injectCss(html: string, css?: string): string;
|
|
46
|
+
|
|
47
|
+
declare const themeRender_injectCss: typeof injectCss;
|
|
48
|
+
declare const themeRender_renderTheme: typeof renderTheme;
|
|
49
|
+
declare namespace themeRender {
|
|
50
|
+
export { themeRender_injectCss as injectCss, themeRender_renderTheme as renderTheme };
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
declare const program: Command;
|
|
54
|
+
|
|
55
|
+
export { loadTheme, program, themeRender };
|
package/dist/index.js
CHANGED
|
@@ -6882,9 +6882,10 @@ async function installTheme(packageName) {
|
|
|
6882
6882
|
throw new Error(`Failed to install ${packageName}: ${error.message}`);
|
|
6883
6883
|
}
|
|
6884
6884
|
}
|
|
6885
|
-
async function loadTheme(themeName) {
|
|
6885
|
+
async function loadTheme(themeName, options) {
|
|
6886
6886
|
let jsonResumeThemeName;
|
|
6887
6887
|
let nativeThemeName;
|
|
6888
|
+
const autoInstall = options?.autoInstall !== false;
|
|
6888
6889
|
try {
|
|
6889
6890
|
jsonResumeThemeName = themeName.startsWith("jsonresume-theme-") ? themeName : `jsonresume-theme-${themeName}`;
|
|
6890
6891
|
try {
|
|
@@ -6894,6 +6895,12 @@ async function loadTheme(themeName) {
|
|
|
6894
6895
|
try {
|
|
6895
6896
|
return require2(nativeThemeName);
|
|
6896
6897
|
} catch (_nativeError) {
|
|
6898
|
+
if (!autoInstall) {
|
|
6899
|
+
throw new Error(
|
|
6900
|
+
`Theme package ${jsonResumeThemeName} or ${nativeThemeName} not found in node_modules.
|
|
6901
|
+
Please install the theme package manually.`
|
|
6902
|
+
);
|
|
6903
|
+
}
|
|
6897
6904
|
console.log(`\u{1F4E6} Theme ${jsonResumeThemeName} not found. Installing...`);
|
|
6898
6905
|
try {
|
|
6899
6906
|
await installTheme(jsonResumeThemeName);
|