svelte-preprocess-org 0.3.2 → 0.3.3
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/index.d.ts +140 -0
- package/dist/index.js +329 -0
- package/dist/index.js.map +1 -0
- package/package.json +1 -1
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { PreprocessorGroup } from "svelte/compiler";
|
|
2
|
+
|
|
3
|
+
//#region src/emacs.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* An S-expression.
|
|
6
|
+
*/
|
|
7
|
+
type Sexp = Value | Cell;
|
|
8
|
+
/**
|
|
9
|
+
* A value in an S-expression.
|
|
10
|
+
*/
|
|
11
|
+
type Value = Atom | Keyword | Quote | string | number | boolean | null;
|
|
12
|
+
/**
|
|
13
|
+
* A cons cell.
|
|
14
|
+
*/
|
|
15
|
+
type Cell = {
|
|
16
|
+
car: Sexp;
|
|
17
|
+
cdr: Sexp;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* An atom in an S-expression.
|
|
21
|
+
*/
|
|
22
|
+
type Atom = {
|
|
23
|
+
atom: string;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* A keyword in an S-expression.
|
|
27
|
+
*/
|
|
28
|
+
type Keyword = {
|
|
29
|
+
keyword: string;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* A quoted S-expression.
|
|
33
|
+
*/
|
|
34
|
+
type Quote = {
|
|
35
|
+
quote: Sexp;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Check if a value is a cons cell.
|
|
39
|
+
*/
|
|
40
|
+
//#endregion
|
|
41
|
+
//#region src/org-export.d.ts
|
|
42
|
+
/**
|
|
43
|
+
* Customization options for Org export engine.
|
|
44
|
+
*
|
|
45
|
+
* See the documentation for `ox` for more details.
|
|
46
|
+
*/
|
|
47
|
+
type OrgExportCustomization = Partial<{
|
|
48
|
+
withSmartQuotes: boolean;
|
|
49
|
+
withEmphasize: boolean;
|
|
50
|
+
withSpecialStrings: boolean;
|
|
51
|
+
withFixedWidth: boolean;
|
|
52
|
+
withTimestamps: boolean;
|
|
53
|
+
preserveBreaks: boolean;
|
|
54
|
+
withSubSuperscripts: boolean | Atom;
|
|
55
|
+
withArchivedTrees: boolean | Atom;
|
|
56
|
+
expandLinks: boolean;
|
|
57
|
+
withBrokenLinks: boolean | Atom;
|
|
58
|
+
withClocks: boolean;
|
|
59
|
+
withCreator: boolean;
|
|
60
|
+
withDrawers: boolean;
|
|
61
|
+
withDate: boolean;
|
|
62
|
+
withEntities: boolean;
|
|
63
|
+
withEmail: boolean;
|
|
64
|
+
withFootnotes: boolean;
|
|
65
|
+
headlineLevels: number;
|
|
66
|
+
withInlinetasks: boolean;
|
|
67
|
+
withSectionNumbers: boolean | number;
|
|
68
|
+
withPlanning: boolean;
|
|
69
|
+
withPriority: boolean;
|
|
70
|
+
withProperties: boolean | Atom[];
|
|
71
|
+
withStatisticsCookies: boolean;
|
|
72
|
+
withTags: boolean | Atom;
|
|
73
|
+
withTasks: boolean | Atom;
|
|
74
|
+
withLatex: boolean | Atom;
|
|
75
|
+
timestampFile: boolean;
|
|
76
|
+
withTitle: boolean;
|
|
77
|
+
withToc: boolean;
|
|
78
|
+
todoKeywords: boolean;
|
|
79
|
+
withTables: boolean;
|
|
80
|
+
}>;
|
|
81
|
+
/**
|
|
82
|
+
* Generate Emacs Lisp code to customize the Org export engine.
|
|
83
|
+
*/
|
|
84
|
+
//#endregion
|
|
85
|
+
//#region src/org-svelte.d.ts
|
|
86
|
+
/**
|
|
87
|
+
* Customization options for exporting Org documents as Svelte components.
|
|
88
|
+
*
|
|
89
|
+
* See the documentation for `ox-svelte` for more details.
|
|
90
|
+
*/
|
|
91
|
+
type OrgSvelteCustomization = Partial<{
|
|
92
|
+
anchorFormat: `${string}%s${string}%s${string}`;
|
|
93
|
+
brokenLinkFormat: string;
|
|
94
|
+
componentImportAlist: Record<string, string | string[] | null>;
|
|
95
|
+
metadataExportList: string[];
|
|
96
|
+
imageFormat: `${string}%s${string}%s${string}`;
|
|
97
|
+
latexEnvironmentFormat: `${string}%s${string}`;
|
|
98
|
+
latexDisplayFragmentFormat: `${string}%s${string}`;
|
|
99
|
+
latexInlineFragmentFormat: `${string}%s${string}`;
|
|
100
|
+
linkOrgFileAsSvelte: boolean;
|
|
101
|
+
rawScriptContent: string;
|
|
102
|
+
srcBlockFormat: `${string}%s${string}%s${string}`;
|
|
103
|
+
textMarkupAlist: Record<"bold" | "code" | "italic" | "strike-through" | "underline" | "verbatim", `${string}%s${string}`>;
|
|
104
|
+
verbose: boolean;
|
|
105
|
+
}>;
|
|
106
|
+
/**
|
|
107
|
+
* Generate Emacs Lisp code to customize the Org to Svelte export engine.
|
|
108
|
+
*/
|
|
109
|
+
//#endregion
|
|
110
|
+
//#region src/index.d.ts
|
|
111
|
+
/**
|
|
112
|
+
* Options for preprocessing Org documents to Svelte components.
|
|
113
|
+
*
|
|
114
|
+
* See the documentation for `ox` and `ox-svelte` for more details.
|
|
115
|
+
*/
|
|
116
|
+
type OrgPreprocessOptions = Partial<{
|
|
117
|
+
/**
|
|
118
|
+
* List of file extensions to process as Org documents.
|
|
119
|
+
*/
|
|
120
|
+
extensions: string[];
|
|
121
|
+
/**
|
|
122
|
+
* List of glob patterns to locate Org files for updating ID locations.
|
|
123
|
+
*/
|
|
124
|
+
idLocations: string[];
|
|
125
|
+
/**
|
|
126
|
+
* Directory to use as Emacs `user-emacs-directory`.
|
|
127
|
+
*/
|
|
128
|
+
initDirectory: string;
|
|
129
|
+
/**
|
|
130
|
+
* List of extra S-expressions to evaluate during initialization.
|
|
131
|
+
*/
|
|
132
|
+
initSexps: Sexp[];
|
|
133
|
+
}> & OrgExportCustomization & OrgSvelteCustomization;
|
|
134
|
+
/**
|
|
135
|
+
* Preprocess Org documents to Svelte components.
|
|
136
|
+
*/
|
|
137
|
+
declare function orgPreprocess(options?: OrgPreprocessOptions): PreprocessorGroup;
|
|
138
|
+
//#endregion
|
|
139
|
+
export { OrgPreprocessOptions, orgPreprocess as default, orgPreprocess };
|
|
140
|
+
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
import { mkdtempSync } from "node:fs";
|
|
2
|
+
import { tmpdir } from "node:os";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import fullpath from "ox-svelte";
|
|
5
|
+
import { globSync } from "tinyglobby";
|
|
6
|
+
import { spawnSync } from "node:child_process";
|
|
7
|
+
|
|
8
|
+
//#region src/emacs.ts
|
|
9
|
+
/**
|
|
10
|
+
* Check if a value is a cons cell.
|
|
11
|
+
*/
|
|
12
|
+
function isCell(x) {
|
|
13
|
+
return x instanceof Object && "car" in x && "cdr" in x;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Check if a value is an atom.
|
|
17
|
+
*/
|
|
18
|
+
function isAtom(x) {
|
|
19
|
+
return x instanceof Object && "atom" in x;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Check if a value is a keyword.
|
|
23
|
+
*/
|
|
24
|
+
function isKeyword(x) {
|
|
25
|
+
return x instanceof Object && "keyword" in x;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Check if a value is a quoted S-expression.
|
|
29
|
+
*/
|
|
30
|
+
function isQuote(x) {
|
|
31
|
+
return x instanceof Object && "quote" in x;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Check if a value is a nil value
|
|
35
|
+
*/
|
|
36
|
+
function isNil(x) {
|
|
37
|
+
return x === null;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Check if a value is a string.
|
|
41
|
+
*/
|
|
42
|
+
function isString(x) {
|
|
43
|
+
return typeof x === "string";
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Check if a value is a number.
|
|
47
|
+
*/
|
|
48
|
+
function isNumber(x) {
|
|
49
|
+
return typeof x === "number";
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Check if a value is a boolean.
|
|
53
|
+
*/
|
|
54
|
+
function isBoolean(x) {
|
|
55
|
+
return typeof x === "boolean";
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Create a cons cell.
|
|
59
|
+
*/
|
|
60
|
+
function cons(car, cdr) {
|
|
61
|
+
return {
|
|
62
|
+
car,
|
|
63
|
+
cdr
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Create a quoted S-expression.
|
|
68
|
+
*/
|
|
69
|
+
function quote(sexp) {
|
|
70
|
+
if (isKeyword(sexp)) return k`${sexp.keyword}`;
|
|
71
|
+
else return { quote: sexp };
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Create a list from a sequence of S-expressions.
|
|
75
|
+
*/
|
|
76
|
+
function list(...args) {
|
|
77
|
+
if (args.length === 0) return null;
|
|
78
|
+
const [car, ...rest] = args;
|
|
79
|
+
return cons(car, list(...rest));
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Create an atom from a tagged template string.
|
|
83
|
+
*/
|
|
84
|
+
function a(raw, ...substitutions) {
|
|
85
|
+
return { atom: String.raw({ raw }, ...substitutions) };
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Create a keyword from a tagged template string.
|
|
89
|
+
*/
|
|
90
|
+
function k(raw, ...substitutions) {
|
|
91
|
+
return { keyword: String.raw({ raw }, ...substitutions) };
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Convert an S-expression to a string.
|
|
95
|
+
*/
|
|
96
|
+
function stringify(sexp) {
|
|
97
|
+
switch (true) {
|
|
98
|
+
case isCell(sexp): return `(${stringifyList(sexp)})`;
|
|
99
|
+
case isNil(sexp): return "nil";
|
|
100
|
+
case isString(sexp): return `"${sexp}"`;
|
|
101
|
+
case isNumber(sexp): return sexp.toString();
|
|
102
|
+
case isBoolean(sexp): return sexp ? "t" : "nil";
|
|
103
|
+
case isAtom(sexp): return sexp.atom;
|
|
104
|
+
case isKeyword(sexp): return `:${sexp.keyword}`;
|
|
105
|
+
case isQuote(sexp): return `'${stringify(sexp.quote)}`;
|
|
106
|
+
default: throw new TypeError(`Unknown type of S-expression: ${typeof sexp}`);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Convert a list to a string.
|
|
111
|
+
*/
|
|
112
|
+
function stringifyList(list$1) {
|
|
113
|
+
let result = "";
|
|
114
|
+
if (isCell(list$1.car)) result += `(${stringifyList(list$1.car)})`;
|
|
115
|
+
else result += stringify(list$1.car);
|
|
116
|
+
if (isCell(list$1.cdr)) result += ` ${stringifyList(list$1.cdr)}`;
|
|
117
|
+
else if (isNil(list$1.cdr)) return result;
|
|
118
|
+
else result += ` . ${stringify(list$1.cdr)}`;
|
|
119
|
+
return result;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* An Emacs instance for evaluating S-expressions.
|
|
123
|
+
*
|
|
124
|
+
* Since each Emacs instance constructetd from this class is assigned their own
|
|
125
|
+
* temporary directory as their init directory, any persistent state that needs
|
|
126
|
+
* to be preserved between evaluations can be stored in that directory (e.g. in
|
|
127
|
+
* the .eld files).
|
|
128
|
+
*/
|
|
129
|
+
var Emacs = class {
|
|
130
|
+
/**
|
|
131
|
+
* S-expression to evaluate when `run` method is called.
|
|
132
|
+
*/
|
|
133
|
+
sexps = [];
|
|
134
|
+
/**
|
|
135
|
+
* String value to be piped into the standard input.
|
|
136
|
+
*/
|
|
137
|
+
stdin;
|
|
138
|
+
/**
|
|
139
|
+
* Initialize a new Emacs instance.
|
|
140
|
+
*
|
|
141
|
+
* Internally, this will request a temporary directory to be created, which
|
|
142
|
+
* will be used as the Emacs init directory when `Emacs.run` is called.
|
|
143
|
+
*
|
|
144
|
+
* @param initDirectory - Directory that will be used as the `user-emacs-directory`.
|
|
145
|
+
*/
|
|
146
|
+
constructor(initDirectory) {
|
|
147
|
+
this.initDirectory = initDirectory;
|
|
148
|
+
this.stdin = "";
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Register the features/packages to require.
|
|
152
|
+
*
|
|
153
|
+
* This function will append to the previous value.
|
|
154
|
+
* The `run` call will not reset this value.
|
|
155
|
+
*/
|
|
156
|
+
require(feature, filename) {
|
|
157
|
+
this.sexps.push(filename ? list(a`require`, quote(a`${feature}`), filename) : list(a`require`, quote(a`${feature}`)));
|
|
158
|
+
return this;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Register S-expressions to evaluate.
|
|
162
|
+
*
|
|
163
|
+
* This function will append to the previous value.
|
|
164
|
+
* The `run` call will reset this value.
|
|
165
|
+
*/
|
|
166
|
+
progn(...sexps) {
|
|
167
|
+
this.sexps.push(...sexps);
|
|
168
|
+
return this;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Register the string to be fed into the standard input.
|
|
172
|
+
*
|
|
173
|
+
* This function will replace the previous value.
|
|
174
|
+
* The `run` call will reset this value.
|
|
175
|
+
*/
|
|
176
|
+
minibuffer(content) {
|
|
177
|
+
this.stdin = content;
|
|
178
|
+
return this;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Run the registered S-expressions in Emacs.
|
|
182
|
+
*
|
|
183
|
+
* @rehturns The standard output of the Emacs process.
|
|
184
|
+
*/
|
|
185
|
+
run() {
|
|
186
|
+
const { stdout, stderr, error } = spawnSync("emacs", [
|
|
187
|
+
`--init-directory=${this.initDirectory}`,
|
|
188
|
+
"--batch",
|
|
189
|
+
"--eval",
|
|
190
|
+
stringify(list(a`progn`, ...this.sexps))
|
|
191
|
+
], { input: this.stdin });
|
|
192
|
+
if (error) throw new Error(`Error running Emacs: ${stderr}`, { cause: error });
|
|
193
|
+
this.sexps = [];
|
|
194
|
+
this.stdin = "";
|
|
195
|
+
return stdout.toString();
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
//#endregion
|
|
200
|
+
//#region src/utilities.ts
|
|
201
|
+
/**
|
|
202
|
+
* Convert a lowerCamelCase string to kebab case.
|
|
203
|
+
*
|
|
204
|
+
* @param s The string to convert.
|
|
205
|
+
* @returns The kebab-cased string.
|
|
206
|
+
*/
|
|
207
|
+
function toKebabCase(s) {
|
|
208
|
+
return s.replace(/[A-Z]+(?!a-z)|[A-Z]/g, (match, offset) => (offset > 0 ? "-" : "") + match.toLowerCase());
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
//#endregion
|
|
212
|
+
//#region src/org-export.ts
|
|
213
|
+
/**
|
|
214
|
+
* Generate Emacs Lisp code to customize the Org export engine.
|
|
215
|
+
*/
|
|
216
|
+
function customize(options = {}) {
|
|
217
|
+
const transformed = Object.entries(options).flatMap(([key, val]) => {
|
|
218
|
+
switch (key) {
|
|
219
|
+
case "withProperties": return [a`org-export-with-properties`, Array.isArray(val) ? quote(list(...val)) : val];
|
|
220
|
+
case "withSmartQuotes":
|
|
221
|
+
case "withEmphasize":
|
|
222
|
+
case "withSpecialStrings":
|
|
223
|
+
case "withFixedWidth":
|
|
224
|
+
case "withTimestamps":
|
|
225
|
+
case "preserveBreaks":
|
|
226
|
+
case "withSubSuperscripts":
|
|
227
|
+
case "withArchivedTrees":
|
|
228
|
+
case "expandLinks":
|
|
229
|
+
case "withBrokenLinks":
|
|
230
|
+
case "withClocks":
|
|
231
|
+
case "withCreator":
|
|
232
|
+
case "withDrawers":
|
|
233
|
+
case "withDate":
|
|
234
|
+
case "withEntities":
|
|
235
|
+
case "withEmail":
|
|
236
|
+
case "withFootnotes":
|
|
237
|
+
case "headlineLevels":
|
|
238
|
+
case "withInlinetasks":
|
|
239
|
+
case "withSectionNumbers":
|
|
240
|
+
case "withPlanning":
|
|
241
|
+
case "withPriority":
|
|
242
|
+
case "withStatisticsCookies":
|
|
243
|
+
case "withTags":
|
|
244
|
+
case "withTasks":
|
|
245
|
+
case "withLatex":
|
|
246
|
+
case "timestampFile":
|
|
247
|
+
case "withTitle":
|
|
248
|
+
case "withToc":
|
|
249
|
+
case "todoKeywords":
|
|
250
|
+
case "withTables": return [a`org-export-${toKebabCase(key)}`, val];
|
|
251
|
+
default: return [];
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
return list(a`setq`, ...transformed);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
//#endregion
|
|
258
|
+
//#region src/org-svelte.ts
|
|
259
|
+
/**
|
|
260
|
+
* Generate Emacs Lisp code to customize the Org to Svelte export engine.
|
|
261
|
+
*/
|
|
262
|
+
function customize$1(options = {}) {
|
|
263
|
+
const transformed = Object.entries(options).flatMap(([key, val]) => {
|
|
264
|
+
switch (key) {
|
|
265
|
+
case "componentImportAlist": {
|
|
266
|
+
const cia = val;
|
|
267
|
+
return [a`org-svelte-component-import-alist`, quote(list(...Object.entries(cia).map(([k$1, v]) => {
|
|
268
|
+
if (Array.isArray(v)) return cons(k$1, list(...v));
|
|
269
|
+
else return cons(k$1, v);
|
|
270
|
+
})))];
|
|
271
|
+
}
|
|
272
|
+
case "metadataExportList": {
|
|
273
|
+
const mel = val;
|
|
274
|
+
return [a`org-svelte-metadata-export-list`, quote(list(...mel.map((v) => k`${v}`)))];
|
|
275
|
+
}
|
|
276
|
+
case "textMarkupAlist": {
|
|
277
|
+
const tma = val;
|
|
278
|
+
return [a`org-svelte-text-markup-alist`, quote(list(...Object.entries(tma).map(([key$1, val$1]) => cons(key$1, val$1))))];
|
|
279
|
+
}
|
|
280
|
+
case "anchorFormat":
|
|
281
|
+
case "brokenLinkFormat":
|
|
282
|
+
case "imageFormat":
|
|
283
|
+
case "latexEnvironmentFormat":
|
|
284
|
+
case "latexDisplayFragmentFormat":
|
|
285
|
+
case "latexInlineFragmentFormat":
|
|
286
|
+
case "linkOrgFileAsSvelte":
|
|
287
|
+
case "rawScriptContent":
|
|
288
|
+
case "srcBlockFormat":
|
|
289
|
+
case "verbose": return [a`org-svelte-${toKebabCase(key)}`, val];
|
|
290
|
+
default: return [];
|
|
291
|
+
}
|
|
292
|
+
});
|
|
293
|
+
return list(a`setq`, ...transformed);
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Export an Org document as Svelte code.
|
|
297
|
+
*
|
|
298
|
+
* Note: This function expects the content of the Org document to be provided
|
|
299
|
+
* via minibuffer input (i.e., stdin).
|
|
300
|
+
*
|
|
301
|
+
* @param options Customization options for the export.
|
|
302
|
+
* @returns The generated Svelte component as a string.
|
|
303
|
+
*/
|
|
304
|
+
const exportMinibufferAsSvelte = list(a`let`, list(list(a`content`, ``)), list(a`while`, list(a`setq`, a`line`, list(a`ignore-errors`, list(a`read-string`, ``))), list(a`setq`, a`content`, list(a`concat`, a`content`, `\\n`, a`line`))), list(a`with-temp-buffer`, list(a`org-mode`), list(a`insert`, a`content`), list(a`org-svelte-export-as-svelte`), list(a`princ`, list(a`buffer-string`))));
|
|
305
|
+
|
|
306
|
+
//#endregion
|
|
307
|
+
//#region src/index.ts
|
|
308
|
+
/**
|
|
309
|
+
* Preprocess Org documents to Svelte components.
|
|
310
|
+
*/
|
|
311
|
+
function orgPreprocess(options) {
|
|
312
|
+
const { extensions = [".org"], idLocations = [], initDirectory = mkdtempSync(join(tmpdir(), "svelte-preprocess-org-")), initSexps = [],...rest } = options || {};
|
|
313
|
+
const emacs = new Emacs(initDirectory);
|
|
314
|
+
if (initSexps.length > 0) emacs.progn(...initSexps).run();
|
|
315
|
+
if (idLocations.length > 0) {
|
|
316
|
+
const files = globSync(idLocations);
|
|
317
|
+
if (files.length > 0) emacs.require("org").progn(list(a`org-id-update-id-locations`, quote(list(...files)))).run();
|
|
318
|
+
}
|
|
319
|
+
return { markup({ content, filename }) {
|
|
320
|
+
if (filename && !extensions.some((ext) => filename.endsWith(ext))) return { code: content };
|
|
321
|
+
const code = emacs.require("ox-svelte", fullpath).progn(customize(rest)).progn(customize$1(rest)).progn(exportMinibufferAsSvelte).minibuffer(content).run();
|
|
322
|
+
return { code };
|
|
323
|
+
} };
|
|
324
|
+
}
|
|
325
|
+
var src_default = orgPreprocess;
|
|
326
|
+
|
|
327
|
+
//#endregion
|
|
328
|
+
export { src_default as default, orgPreprocess };
|
|
329
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["list","initDirectory: string","customize","k","key","val","customizeOx","customizeOxSvelte"],"sources":["../src/emacs.ts","../src/utilities.ts","../src/org-export.ts","../src/org-svelte.ts","../src/index.ts"],"sourcesContent":["import { spawnSync } from \"node:child_process\";\n\n/**\n * An S-expression.\n */\nexport type Sexp = Value | Cell;\n\n/**\n * A value in an S-expression.\n */\nexport type Value = Atom | Keyword | Quote | string | number | boolean | null;\n\n/**\n * A cons cell.\n */\nexport type Cell = {\n car: Sexp;\n cdr: Sexp;\n};\n\n/**\n * An atom in an S-expression.\n */\nexport type Atom = {\n atom: string;\n};\n\n/**\n * A keyword in an S-expression.\n */\nexport type Keyword = {\n keyword: string;\n};\n\n/**\n * A quoted S-expression.\n */\nexport type Quote = {\n quote: Sexp;\n};\n\n/**\n * Check if a value is a cons cell.\n */\nexport function isCell(x: unknown): x is Cell {\n return x instanceof Object && \"car\" in x && \"cdr\" in x;\n}\n\n/**\n * Check if a value is an atom.\n */\nexport function isAtom(x: unknown): x is Atom {\n return x instanceof Object && \"atom\" in x;\n}\n\n/**\n * Check if a value is a keyword.\n */\nexport function isKeyword(x: unknown): x is Keyword {\n return x instanceof Object && \"keyword\" in x;\n}\n\n/**\n * Check if a value is a quoted S-expression.\n */\nexport function isQuote(x: unknown): x is Quote {\n return x instanceof Object && \"quote\" in x;\n}\n\n/**\n * Check if a value is a valid value in an S-expression.\n */\nexport function isValue(x: unknown): x is Value {\n return (\n isAtom(x) ||\n isKeyword(x) ||\n isQuote(x) ||\n isString(x) ||\n isNumber(x) ||\n isBoolean(x) ||\n isNil(x)\n );\n}\n\n/**\n * Check if a value is a nil value\n */\nexport function isNil(x: unknown): x is null {\n return x === null;\n}\n\n/**\n * Check if a value is a list.\n *\n * Note that improper lists are also considered lists.\n */\nexport function isList(x: unknown): x is Cell {\n return isCell(x) || isNil(x);\n}\n\n/**\n * Check if a value is a string.\n */\nexport function isString(x: unknown): x is string {\n return typeof x === \"string\";\n}\n\n/**\n * Check if a value is a number.\n */\nexport function isNumber(x: unknown): x is number {\n return typeof x === \"number\";\n}\n\n/**\n * Check if a value is a boolean.\n */\nexport function isBoolean(x: unknown): x is boolean {\n return typeof x === \"boolean\";\n}\n\n/**\n * Create a cons cell.\n */\nexport function cons(car: Sexp, cdr: Sexp): Cell {\n return { car, cdr };\n}\n\n/**\n * Create a quoted S-expression.\n */\nexport function quote(sexp: Sexp): Quote | Keyword {\n if (isKeyword(sexp)) {\n // A quoted keyword is still a keyword.\n return k`${sexp.keyword}`;\n } else {\n // For the rest, just quote the S-expression.\n return { quote: sexp };\n }\n}\n\n/**\n * Create a list from a sequence of S-expressions.\n */\nexport function list(...args: Sexp[]): Sexp {\n if (args.length === 0) {\n return null;\n }\n\n const [car, ...rest] = args;\n return cons(car, list(...rest));\n}\n\n/**\n * Create an atom from a tagged template string.\n */\nexport function a(\n raw: TemplateStringsArray,\n ...substitutions: unknown[]\n): Atom {\n return { atom: String.raw({ raw }, ...substitutions) };\n}\n\n/**\n * Create a keyword from a tagged template string.\n */\nexport function k(\n raw: TemplateStringsArray,\n ...substitutions: unknown[]\n): Keyword {\n return { keyword: String.raw({ raw }, ...substitutions) };\n}\n\n/**\n * Convert an S-expression to a string.\n */\nexport function stringify(sexp: Sexp): string {\n // Dispatch based on the type of the expression.\n switch (true) {\n case isCell(sexp):\n return `(${stringifyList(sexp)})`;\n case isNil(sexp):\n return \"nil\";\n case isString(sexp):\n return `\"${sexp}\"`;\n case isNumber(sexp):\n return sexp.toString();\n case isBoolean(sexp):\n return sexp ? \"t\" : \"nil\";\n case isAtom(sexp):\n return sexp.atom;\n case isKeyword(sexp):\n return `:${sexp.keyword}`;\n case isQuote(sexp):\n return `'${stringify(sexp.quote)}`;\n default:\n throw new TypeError(`Unknown type of S-expression: ${typeof sexp}`);\n }\n}\n\n/**\n * Convert a list to a string.\n */\nfunction stringifyList(list: Cell): string {\n // Stringify the car of the list.\n let result = \"\";\n if (isCell(list.car)) {\n result += `(${stringifyList(list.car)})`;\n } else {\n result += stringify(list.car);\n }\n\n // There are three cases for a cdr:\n // 1. cdr is another cell -> recursively stringify the cdr\n // 2. cdr is nil -> end of the list, so just return the result\n // 3. cdr is something else -> add a dot and the stringified cdr\n if (isCell(list.cdr)) {\n result += ` ${stringifyList(list.cdr)}`;\n } else if (isNil(list.cdr)) {\n return result;\n } else {\n result += ` . ${stringify(list.cdr)}`;\n }\n\n return result;\n}\n\n/**\n * An Emacs instance for evaluating S-expressions.\n *\n * Since each Emacs instance constructetd from this class is assigned their own\n * temporary directory as their init directory, any persistent state that needs\n * to be preserved between evaluations can be stored in that directory (e.g. in\n * the .eld files).\n */\nexport class Emacs {\n /**\n * S-expression to evaluate when `run` method is called.\n */\n private sexps: Sexp[] = [];\n\n /**\n * String value to be piped into the standard input.\n */\n private stdin: string;\n\n /**\n * Initialize a new Emacs instance.\n *\n * Internally, this will request a temporary directory to be created, which\n * will be used as the Emacs init directory when `Emacs.run` is called.\n *\n * @param initDirectory - Directory that will be used as the `user-emacs-directory`.\n */\n constructor(private initDirectory: string) {\n this.stdin = \"\";\n }\n\n /**\n * Register the features/packages to require.\n *\n * This function will append to the previous value.\n * The `run` call will not reset this value.\n */\n require(feature: string, filename?: string) {\n this.sexps.push(\n filename\n ? list(a`require`, quote(a`${feature}`), filename)\n : list(a`require`, quote(a`${feature}`)),\n );\n\n return this;\n }\n\n /**\n * Register S-expressions to evaluate.\n *\n * This function will append to the previous value.\n * The `run` call will reset this value.\n */\n progn(...sexps: Sexp[]) {\n this.sexps.push(...sexps);\n\n return this;\n }\n\n /**\n * Register the string to be fed into the standard input.\n *\n * This function will replace the previous value.\n * The `run` call will reset this value.\n */\n minibuffer(content: string) {\n this.stdin = content;\n\n return this;\n }\n\n /**\n * Run the registered S-expressions in Emacs.\n *\n * @rehturns The standard output of the Emacs process.\n */\n run() {\n // Spawn Emacs in batch mode to evaluate the S-expressions.\n const { stdout, stderr, error } = spawnSync(\n \"emacs\",\n [\n `--init-directory=${this.initDirectory}`,\n \"--batch\",\n \"--eval\",\n stringify(list(a`progn`, ...this.sexps)),\n ],\n {\n input: this.stdin,\n },\n );\n if (error) {\n throw new Error(`Error running Emacs: ${stderr}`, { cause: error });\n }\n\n // Reset the S-expressions and stdin for the next run.\n this.sexps = [];\n this.stdin = \"\";\n\n // Return the standard output.\n return stdout.toString();\n }\n}\n","/**\n * Convert a lowerCamelCase string to kebab case.\n *\n * @param s The string to convert.\n * @returns The kebab-cased string.\n */\nexport function toKebabCase(s: string): string {\n return s.replace(\n /[A-Z]+(?!a-z)|[A-Z]/g,\n (match, offset) => (offset > 0 ? \"-\" : \"\") + match.toLowerCase(),\n );\n}\n","import { a, list, quote, type Atom, type Value } from \"./emacs\";\nimport { toKebabCase } from \"./utilities\";\n\n/**\n * Customization options for Org export engine.\n *\n * See the documentation for `ox` for more details.\n */\nexport type OrgExportCustomization = Partial<{\n withSmartQuotes: boolean;\n withEmphasize: boolean;\n withSpecialStrings: boolean;\n withFixedWidth: boolean;\n withTimestamps: boolean;\n preserveBreaks: boolean;\n withSubSuperscripts: boolean | Atom;\n withArchivedTrees: boolean | Atom;\n expandLinks: boolean;\n withBrokenLinks: boolean | Atom;\n withClocks: boolean;\n withCreator: boolean;\n withDrawers: boolean;\n withDate: boolean;\n withEntities: boolean;\n withEmail: boolean;\n withFootnotes: boolean;\n headlineLevels: number;\n withInlinetasks: boolean;\n withSectionNumbers: boolean | number;\n withPlanning: boolean;\n withPriority: boolean;\n withProperties: boolean | Atom[];\n withStatisticsCookies: boolean;\n withTags: boolean | Atom;\n withTasks: boolean | Atom;\n withLatex: boolean | Atom;\n timestampFile: boolean;\n withTitle: boolean;\n withToc: boolean;\n todoKeywords: boolean;\n withTables: boolean;\n}>;\n\n/**\n * Generate Emacs Lisp code to customize the Org export engine.\n */\nexport function customize(options: OrgExportCustomization = {}) {\n const transformed = Object.entries(options).flatMap(([key, val]) => {\n switch (key) {\n case \"withProperties\": {\n return [\n a`org-export-with-properties`,\n Array.isArray(val) ? quote(list(...val)) : val,\n ]\n }\n \n case \"withSmartQuotes\":\n case \"withEmphasize\":\n case \"withSpecialStrings\":\n case \"withFixedWidth\":\n case \"withTimestamps\":\n case \"preserveBreaks\":\n case \"withSubSuperscripts\":\n case \"withArchivedTrees\":\n case \"expandLinks\":\n case \"withBrokenLinks\":\n case \"withClocks\":\n case \"withCreator\":\n case \"withDrawers\":\n case \"withDate\":\n case \"withEntities\":\n case \"withEmail\":\n case \"withFootnotes\":\n case \"headlineLevels\":\n case \"withInlinetasks\":\n case \"withSectionNumbers\":\n case \"withPlanning\":\n case \"withPriority\":\n case \"withStatisticsCookies\":\n case \"withTags\":\n case \"withTasks\":\n case \"withLatex\":\n case \"timestampFile\":\n case \"withTitle\":\n case \"withToc\":\n case \"todoKeywords\":\n case \"withTables\":\n return [a`org-export-${toKebabCase(key)}`, val as Value];\n\n default:\n return [];\n }\n });\n\n return list(a`setq`, ...transformed);\n}\n","import { a, k, cons, list, quote, type Value } from \"./emacs\";\nimport { toKebabCase } from \"./utilities\";\n\n/**\n * Customization options for exporting Org documents as Svelte components.\n *\n * See the documentation for `ox-svelte` for more details.\n */\nexport type OrgSvelteCustomization = Partial<{\n anchorFormat: `${string}%s${string}%s${string}`;\n brokenLinkFormat: string;\n componentImportAlist: Record<string, string | string[] | null>;\n metadataExportList: string[];\n imageFormat: `${string}%s${string}%s${string}`;\n latexEnvironmentFormat: `${string}%s${string}`;\n latexDisplayFragmentFormat: `${string}%s${string}`;\n latexInlineFragmentFormat: `${string}%s${string}`;\n linkOrgFileAsSvelte: boolean;\n rawScriptContent: string;\n srcBlockFormat: `${string}%s${string}%s${string}`;\n textMarkupAlist: Record<\n \"bold\" | \"code\" | \"italic\" | \"strike-through\" | \"underline\" | \"verbatim\",\n `${string}%s${string}`\n >;\n verbose: boolean;\n}>;\n\n/**\n * Generate Emacs Lisp code to customize the Org to Svelte export engine.\n */\nexport function customize(options: OrgSvelteCustomization = {}) {\n const transformed = Object.entries(options).flatMap(([key, val]) => {\n switch (key) {\n case \"componentImportAlist\": {\n const cia = val as Record<string, string | string[] | null>;\n return [\n a`org-svelte-component-import-alist`,\n quote(\n list(\n ...Object.entries(cia).map(([k, v]) => {\n if (Array.isArray(v)) {\n return cons(k, list(...v));\n } else {\n return cons(k, v);\n }\n }),\n ),\n ),\n ];\n }\n\n case \"metadataExportList\": {\n const mel = val as string[];\n return [\n a`org-svelte-metadata-export-list`,\n quote(list(...mel.map((v) => k`${v}`))),\n ];\n }\n\n case \"textMarkupAlist\": {\n const tma = val as Record<\n | \"bold\"\n | \"code\"\n | \"italic\"\n | \"strike-through\"\n | \"underline\"\n | \"verbatim\",\n `${string}%s${string}`\n >;\n return [\n a`org-svelte-text-markup-alist`,\n quote(\n list(...Object.entries(tma).map(([key, val]) => cons(key, val))),\n ),\n ];\n }\n\n case \"anchorFormat\":\n case \"brokenLinkFormat\":\n case \"imageFormat\":\n case \"latexEnvironmentFormat\":\n case \"latexDisplayFragmentFormat\":\n case \"latexInlineFragmentFormat\":\n case \"linkOrgFileAsSvelte\":\n case \"rawScriptContent\":\n case \"srcBlockFormat\":\n case \"verbose\":\n return [a`org-svelte-${toKebabCase(key)}`, val as Value];\n\n default:\n return [];\n }\n });\n\n return list(a`setq`, ...transformed);\n}\n\n/**\n * Export an Org document as Svelte code.\n *\n * Note: This function expects the content of the Org document to be provided\n * via minibuffer input (i.e., stdin).\n *\n * @param options Customization options for the export.\n * @returns The generated Svelte component as a string.\n */\nexport const exportMinibufferAsSvelte = list(\n a`let`,\n // VARLIST\n list(list(a`content`, ``)),\n // BODY\n list(\n a`while`,\n // TEST\n list(a`setq`, a`line`, list(a`ignore-errors`, list(a`read-string`, ``))),\n // BODY\n list(a`setq`, a`content`, list(a`concat`, a`content`, `\\\\n`, a`line`)),\n ),\n // Create temporary buffer, insert, and export.\n list(\n a`with-temp-buffer`,\n list(a`org-mode`),\n list(a`insert`, a`content`),\n list(a`org-svelte-export-as-svelte`),\n list(a`princ`, list(a`buffer-string`)),\n ),\n);\n","import { mkdtempSync } from \"node:fs\";\nimport { tmpdir } from \"node:os\";\nimport { join } from \"node:path\";\n\nimport fullpath from \"ox-svelte\";\nimport type { PreprocessorGroup } from \"svelte/compiler\";\nimport { globSync } from \"tinyglobby\";\n\nimport { list, quote, a, Emacs, type Sexp } from \"./emacs\";\nimport {\n customize as customizeOx,\n type OrgExportCustomization,\n} from \"./org-export\";\nimport {\n customize as customizeOxSvelte,\n exportMinibufferAsSvelte,\n type OrgSvelteCustomization,\n} from \"./org-svelte\";\n\n/**\n * Options for preprocessing Org documents to Svelte components.\n *\n * See the documentation for `ox` and `ox-svelte` for more details.\n */\nexport type OrgPreprocessOptions = Partial<{\n /**\n * List of file extensions to process as Org documents.\n */\n extensions: string[];\n\n /**\n * List of glob patterns to locate Org files for updating ID locations.\n */\n idLocations: string[];\n\n /**\n * Directory to use as Emacs `user-emacs-directory`.\n */\n initDirectory: string;\n\n /**\n * List of extra S-expressions to evaluate during initialization.\n */\n initSexps: Sexp[];\n}> &\n OrgExportCustomization &\n OrgSvelteCustomization;\n\n/**\n * Preprocess Org documents to Svelte components.\n */\nexport function orgPreprocess(\n options?: OrgPreprocessOptions,\n): PreprocessorGroup {\n const {\n extensions = [\".org\"],\n idLocations = [],\n initDirectory = mkdtempSync(join(tmpdir(), \"svelte-preprocess-org-\")),\n initSexps = [],\n ...rest\n } = options || {};\n\n // Create a new Emacs instance for this preprocessor.\n const emacs = new Emacs(initDirectory);\n\n if (initSexps.length > 0) {\n emacs.progn(...initSexps).run();\n }\n\n // Update Org-mode ID locations if provided.\n if (idLocations.length > 0) {\n const files = globSync(idLocations);\n if (files.length > 0) {\n emacs\n .require(\"org\")\n .progn(list(a`org-id-update-id-locations`, quote(list(...files))))\n .run();\n }\n }\n\n return {\n markup({ content, filename }) {\n // If the file extension is not in the list of extensions, do nothing.\n if (filename && !extensions.some((ext) => filename.endsWith(ext))) {\n return { code: content };\n }\n\n // Make sure that ID location updates have been applied.\n const code = emacs\n .require(\"ox-svelte\", fullpath)\n .progn(customizeOx(rest))\n .progn(customizeOxSvelte(rest))\n .progn(exportMinibufferAsSvelte)\n .minibuffer(content)\n .run();\n return { code };\n },\n };\n}\n\nexport default orgPreprocess;\n"],"mappings":";;;;;;;;;;;AA4CA,SAAgB,OAAO,GAAuB;AAC5C,QAAO,aAAa,UAAU,SAAS,KAAK,SAAS;;;;;AAMvD,SAAgB,OAAO,GAAuB;AAC5C,QAAO,aAAa,UAAU,UAAU;;;;;AAM1C,SAAgB,UAAU,GAA0B;AAClD,QAAO,aAAa,UAAU,aAAa;;;;;AAM7C,SAAgB,QAAQ,GAAwB;AAC9C,QAAO,aAAa,UAAU,WAAW;;;;;AAqB3C,SAAgB,MAAM,GAAuB;AAC3C,QAAO,MAAM;;;;;AAef,SAAgB,SAAS,GAAyB;AAChD,QAAO,OAAO,MAAM;;;;;AAMtB,SAAgB,SAAS,GAAyB;AAChD,QAAO,OAAO,MAAM;;;;;AAMtB,SAAgB,UAAU,GAA0B;AAClD,QAAO,OAAO,MAAM;;;;;AAMtB,SAAgB,KAAK,KAAW,KAAiB;AAC/C,QAAO;EAAE;EAAK;;;;;;AAMhB,SAAgB,MAAM,MAA6B;AACjD,KAAI,UAAU,MAEZ,QAAO,CAAC,GAAG,KAAK;KAGhB,QAAO,EAAE,OAAO;;;;;AAOpB,SAAgB,KAAK,GAAG,MAAoB;AAC1C,KAAI,KAAK,WAAW,EAClB,QAAO;CAGT,MAAM,CAAC,KAAK,GAAG,QAAQ;AACvB,QAAO,KAAK,KAAK,KAAK,GAAG;;;;;AAM3B,SAAgB,EACd,KACA,GAAG,eACG;AACN,QAAO,EAAE,MAAM,OA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