@anja.codes/vitakit 0.2.0 → 0.3.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.
Files changed (40) hide show
  1. package/README.md +4 -3
  2. package/dist/check.mjs +14 -12
  3. package/dist/chunks/authoring.mjs +50 -45
  4. package/dist/{shared/vitakit.By5VWQ1n.mjs → chunks/bibliography.mjs} +73 -170
  5. package/dist/chunks/build.mjs +19 -17
  6. package/dist/chunks/documents.mjs +15 -6
  7. package/dist/chunks/draft.mjs +3 -3
  8. package/dist/chunks/eject.mjs +2 -2
  9. package/dist/chunks/emit.mjs +38 -22
  10. package/dist/chunks/fields.mjs +2 -2
  11. package/dist/chunks/inventory.mjs +29 -27
  12. package/dist/chunks/migrations.mjs +218 -0
  13. package/dist/chunks/plan.mjs +36 -8
  14. package/dist/chunks/publication-lists.mjs +202 -0
  15. package/dist/chunks/schemas.mjs +2 -2
  16. package/dist/chunks/sections.mjs +3 -3
  17. package/dist/chunks/validate.mjs +25 -16
  18. package/dist/chunks/vue.mjs +89 -52
  19. package/dist/chunks/yaml.mjs +62 -0
  20. package/dist/cli.mjs +1 -1
  21. package/dist/index.d.mts +9 -9
  22. package/dist/index.mjs +12 -10
  23. package/dist/nuxt.mjs +19 -11
  24. package/dist/runtime/components/VitaPublications.vue +21 -22
  25. package/dist/runtime/composables/useVitakit.ts +14 -3
  26. package/dist/schemas/publications.ts +9 -7
  27. package/dist/shared/index.d.mts +2 -2
  28. package/dist/shared/{vitakit.BfpxDtz1.d.mts → vitakit.BfR_mUHm.d.mts} +17 -5
  29. package/dist/shared/{vitakit.BZZIsWlY.mjs → vitakit.CCTDg7pz.mjs} +21 -1
  30. package/dist/shared/{vitakit.DbSeENVS.mjs → vitakit.DCK90zq4.mjs} +10 -1
  31. package/dist/shared/vitakit.DteA9vLy.mjs +135 -0
  32. package/dist/shared/{vitakit.BerUaxtF.mjs → vitakit.DvABWuUc.mjs} +1 -1
  33. package/dist/shared/{vitakit.Do5HC_MD.mjs → vitakit.DvvUYUTS.mjs} +61 -3
  34. package/dist/shared/vitakit.UfoXdL7U.mjs +22 -0
  35. package/dist/shared/{vitakit.CoWX2Z4R.mjs → vitakit.zwr1ssO5.mjs} +353 -57
  36. package/dist/tex/templates/publications.eta +4 -2
  37. package/dist/tex/vitakit-cv.cls +15 -4
  38. package/dist/tex.d.mts +29 -8
  39. package/dist/tex.mjs +13 -10
  40. package/package.json +1 -1
package/dist/tex.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { Entry, PublicationGroup } from './index.mjs';
2
+ import { Entry, PublicationList } from './index.mjs';
3
3
 
4
4
  interface BuildOptions {
5
5
  rootDir: string;
@@ -34,6 +34,25 @@ declare function buildCv(options: BuildOptions): Promise<string[]>;
34
34
  /** Read a generated file, for tests and diagnostics. */
35
35
  declare function readGenerated(rootDir: string, document: string, section: string): Promise<string>;
36
36
 
37
+ interface PdfPlacement {
38
+ section: string;
39
+ document: string;
40
+ /** `cv-tex/cv.tex`. */
41
+ file: string;
42
+ line: number;
43
+ macro: 'vitasection' | 'vitainput';
44
+ /** The optional heading of `\vitasection[Heading]{id}`. */
45
+ heading?: string;
46
+ }
47
+ /** A `\vitapublications[Heading]{list}` line. */
48
+ interface PdfPublicationPlacement {
49
+ list: string;
50
+ document: string;
51
+ file: string;
52
+ line: number;
53
+ heading?: string;
54
+ }
55
+
37
56
  declare const documentSchema: z.ZodObject<{
38
57
  visibility: z.ZodDefault<z.ZodEnum<{
39
58
  public: "public";
@@ -47,9 +66,6 @@ declare const documentSchema: z.ZodObject<{
47
66
  until: z.ZodOptional<z.ZodNumber>;
48
67
  title: z.ZodOptional<z.ZodString>;
49
68
  }, z.core.$strict>>>;
50
- publications: z.ZodDefault<z.ZodObject<{
51
- groups: z.ZodOptional<z.ZodArray<z.ZodString>>;
52
- }, z.core.$strict>>;
53
69
  }, z.core.$strict>;
54
70
  type DocumentOptions = z.infer<typeof documentSchema>;
55
71
  interface DocumentSource {
@@ -57,6 +73,10 @@ interface DocumentSource {
57
73
  name: string;
58
74
  texFile: string;
59
75
  options: DocumentOptions;
76
+ /** Its `\vitasection` and `\vitainput` lines. */
77
+ placements: PdfPlacement[];
78
+ /** Its `\vitapublications` lines. */
79
+ publications: PdfPublicationPlacement[];
60
80
  }
61
81
  /** Read every `cv-tex/*.tex` and its options. Strict: the first problem throws. */
62
82
  declare function discoverDocuments(cvDir: string): Promise<DocumentSource[]>;
@@ -85,7 +105,8 @@ declare function resolveTemplate(id: string, userDir: string, { exclude }?: {
85
105
  }): Promise<ResolvedTemplate>;
86
106
  interface EmitOptions {
87
107
  sections: Record<string, Entry[]>;
88
- publications: PublicationGroup[];
108
+ /** The publication lists the document shows, by name. */
109
+ publications: Record<string, PublicationList>;
89
110
  options: DocumentOptions;
90
111
  /** `cv-tex/templates/`, where user overrides live. */
91
112
  templateDir: string;
@@ -101,9 +122,9 @@ interface EmitOptions {
101
122
  * `entries` are all loaded entries; the document's selection is applied here.
102
123
  */
103
124
  declare function renderSection(id: string, entries: Entry[], options: DocumentOptions, templateDir: string): Promise<string>;
104
- /** Render the publications of one document, without writing anything. */
105
- declare function renderPublications(publications: PublicationGroup[], options: DocumentOptions, templateDir: string, siteUrl?: string): Promise<string>;
106
- /** Write one `.tex` file per section, plus `publications.tex`. */
125
+ /** Render one publication list, without writing anything. */
126
+ declare function renderPublications(list: PublicationList, templateDir: string, siteUrl?: string): Promise<string>;
127
+ /** Write one `.tex` file per section, and one per publication list in `publications/`. */
107
128
  declare function emitDocument(emit: EmitOptions): Promise<string[]>;
108
129
 
109
130
  /**
package/dist/tex.mjs CHANGED
@@ -7,30 +7,33 @@ import 'node:fs/promises';
7
7
  import 'node:fs';
8
8
  import 'node:process';
9
9
  import 'node:path';
10
- import './shared/vitakit.By5VWQ1n.mjs';
10
+ import './shared/vitakit.DteA9vLy.mjs';
11
11
  import 'gray-matter';
12
12
  import 'yaml';
13
+ import './chunks/bibliography.mjs';
14
+ import './shared/vitakit.DQ6PmGoL.mjs';
15
+ import 'node:url';
16
+ import '@behackl/citation-js-extras';
13
17
  import 'unified';
18
+ import 'rehype-parse';
19
+ import 'rehype-sanitize';
20
+ import 'rehype-stringify';
14
21
  import 'remark-parse';
15
22
  import 'remark-gfm';
16
23
  import 'remark-math';
17
24
  import 'remark-rehype';
18
25
  import 'rehype-katex';
19
26
  import 'rehype-raw';
20
- import 'rehype-stringify';
21
27
  import 'unist-util-visit';
22
- import './shared/vitakit.D10HyDhF.mjs';
23
- import './shared/vitakit.DQ6PmGoL.mjs';
24
- import 'node:url';
25
- import '@behackl/citation-js-extras';
26
- import 'rehype-parse';
27
- import 'rehype-sanitize';
28
- import './shared/vitakit.DbSeENVS.mjs';
28
+ import './shared/vitakit.DCK90zq4.mjs';
29
29
  import 'zod';
30
+ import './chunks/publication-lists.mjs';
31
+ import './shared/vitakit.D10HyDhF.mjs';
30
32
  import './chunks/sections.mjs';
31
33
  import './chunks/schemas.mjs';
32
- import './shared/vitakit.BerUaxtF.mjs';
34
+ import './shared/vitakit.DvABWuUc.mjs';
33
35
  import './shared/vitakit.TSMTC5Jl.mjs';
36
+ import './shared/vitakit.DvvUYUTS.mjs';
34
37
  import 'eta';
35
38
  import './shared/vitakit.CfB3hMHl.mjs';
36
39
  import './shared/vitakit.D-DdJaDZ.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anja.codes/vitakit",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Structured CV data in, academic website and LaTeX CV out.",
5
5
  "license": "MIT",
6
6
  "keywords": [