@lincyaw/presmium 1.0.0-rc.13 → 1.0.0-rc.131
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.md +60 -0
- package/bin/presmium.mjs +8 -22
- package/package.json +33 -26
- package/src/site.ts +2 -0
package/README.md
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# @lincyaw/presmium
|
|
2
|
+
|
|
3
|
+
Presmium turns one document, `index.pmd`, into a website, slides, a Jupyter notebook and a narrated video. This package is the `presmium` command with Presmium Studio (the browser workbench), the renderers and the official plugins.
|
|
4
|
+
|
|
5
|
+
Requires Node.js 22.19 or later and pnpm.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
pnpm setup # once, before your first global installation; then open a new terminal
|
|
11
|
+
pnpm add -g @lincyaw/presmium
|
|
12
|
+
presmium --version
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## First steps
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
presmium new my-course --type workspace # or --type document, site, plugin
|
|
19
|
+
presmium studio my-course # prints one address: open it in the browser
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Editing and previewing in Studio need no language model; the AI assistant uses the key entered under *Settings → Model*. `presmium new --help` and `presmium --help` list the options and the other commands (`dev`, `check`, `build`, `serve`, `mcp`).
|
|
23
|
+
|
|
24
|
+
## In a project
|
|
25
|
+
|
|
26
|
+
To pin a version per project, let `pnpm create presmium` make the project: its `pnpm-workspace.yaml` already says which dependencies may run install scripts, so pnpm installs it without asking.
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
pnpm create presmium my-course --type workspace
|
|
30
|
+
cd my-course
|
|
31
|
+
pnpm install
|
|
32
|
+
pnpm exec presmium studio
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
To add Presmium to a project of your own, first put this in its `pnpm-workspace.yaml` (pnpm refuses dependencies whose install scripts it has not been told about), then run `pnpm add -D @lincyaw/presmium` and use `pnpm exec presmium`:
|
|
36
|
+
|
|
37
|
+
```yaml
|
|
38
|
+
allowBuilds:
|
|
39
|
+
'@ast-grep/lang-python': false
|
|
40
|
+
'@deepseek-ai/dsh-subprocess-local': false
|
|
41
|
+
'@google/genai': false
|
|
42
|
+
'@vscode/vsce-sign': false
|
|
43
|
+
esbuild: true
|
|
44
|
+
koffi: false
|
|
45
|
+
msedge-tts: false
|
|
46
|
+
node-pty: false
|
|
47
|
+
playwright-chromium: true
|
|
48
|
+
protobufjs: false
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
`playwright-chromium: true` downloads the browser that exports PDF, PowerPoint and video.
|
|
52
|
+
|
|
53
|
+
## Links
|
|
54
|
+
|
|
55
|
+
- [Presmium on GitHub](https://github.com/Lincyaw/presmium): the guide, examples and issues
|
|
56
|
+
- [Live examples](https://profile.aoyangfang.top/presmium/)
|
|
57
|
+
|
|
58
|
+
## License
|
|
59
|
+
|
|
60
|
+
Apache-2.0
|
package/bin/presmium.mjs
CHANGED
|
@@ -1,28 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { fileURLToPath, pathToFileURL } from 'node:url'
|
|
2
|
+
import { realpathSync } from 'node:fs'
|
|
3
|
+
import { fileURLToPath } from 'node:url'
|
|
5
4
|
import { createJiti } from 'jiti'
|
|
6
5
|
|
|
7
6
|
const own = realpathSync(fileURLToPath(new URL('..', import.meta.url)))
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
if (dirname(dir) === dir) return undefined
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const local = projectPresmium(process.cwd())
|
|
18
|
-
if (local && realpathSync(join(dirname(local), '..')) !== own) {
|
|
19
|
-
await import(pathToFileURL(local).href)
|
|
20
|
-
} else {
|
|
21
|
-
const emitWarning = process.emitWarning
|
|
22
|
-
process.emitWarning = (warning, ...args) => {
|
|
23
|
-
const code = typeof args[0] === 'object' ? args[0]?.code : args[1]
|
|
24
|
-
if (code !== 'DEP0040') emitWarning.call(process, warning, ...args)
|
|
25
|
-
}
|
|
26
|
-
const { main } = await createJiti(import.meta.url).import('@lincyaw/cli')
|
|
27
|
-
process.exitCode = await main(process.argv.slice(2), { bundled: own, bin: fileURLToPath(import.meta.url) })
|
|
8
|
+
const emitWarning = process.emitWarning
|
|
9
|
+
process.emitWarning = (warning, ...args) => {
|
|
10
|
+
const code = typeof args[0] === 'object' ? args[0]?.code : args[1]
|
|
11
|
+
if (code !== 'DEP0040') emitWarning.call(process, warning, ...args)
|
|
28
12
|
}
|
|
13
|
+
const { main } = await createJiti(import.meta.url).import('@lincyaw/cli')
|
|
14
|
+
process.exitCode = await main(process.argv.slice(2), { bundled: own, bin: fileURLToPath(import.meta.url) })
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lincyaw/presmium",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.131",
|
|
4
4
|
"description": "The presmium command with the renderers and the official plugins: pnpm add -g @lincyaw/presmium",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -27,34 +27,41 @@
|
|
|
27
27
|
"bin": {
|
|
28
28
|
"presmium": "./bin/presmium.mjs"
|
|
29
29
|
},
|
|
30
|
+
"exports": {
|
|
31
|
+
"./site": "./src/site.ts",
|
|
32
|
+
"./package.json": "./package.json"
|
|
33
|
+
},
|
|
30
34
|
"files": [
|
|
31
|
-
"bin"
|
|
35
|
+
"bin",
|
|
36
|
+
"src"
|
|
32
37
|
],
|
|
33
38
|
"dependencies": {
|
|
34
39
|
"jiti": "^2.7.0",
|
|
35
|
-
"@lincyaw/cli": "1.0.0-rc.
|
|
36
|
-
"@lincyaw/
|
|
37
|
-
"@lincyaw/
|
|
38
|
-
"@lincyaw/
|
|
39
|
-
"@lincyaw/
|
|
40
|
-
"@lincyaw/
|
|
41
|
-
"@lincyaw/
|
|
42
|
-
"@lincyaw/addon-classroom": "1.0.0-rc.
|
|
43
|
-
"@lincyaw/addon-content": "1.0.0-rc.
|
|
44
|
-
"@lincyaw/addon-
|
|
45
|
-
"@lincyaw/addon-exec
|
|
46
|
-
"@lincyaw/addon-exec-
|
|
47
|
-
"@lincyaw/addon-exec-
|
|
48
|
-
"@lincyaw/addon-exec-webgpu": "1.0.0-rc.
|
|
49
|
-
"@lincyaw/addon-
|
|
50
|
-
"@lincyaw/addon-
|
|
51
|
-
"@lincyaw/addon-
|
|
52
|
-
"@lincyaw/addon-
|
|
53
|
-
"@lincyaw/addon-
|
|
54
|
-
"@lincyaw/addon-
|
|
55
|
-
"@lincyaw/addon-stage": "1.0.0-rc.
|
|
56
|
-
"@lincyaw/
|
|
57
|
-
"@lincyaw/
|
|
58
|
-
"
|
|
40
|
+
"@lincyaw/cli": "1.0.0-rc.131",
|
|
41
|
+
"@lincyaw/host": "1.0.0-rc.131",
|
|
42
|
+
"@lincyaw/kernel": "1.0.0-rc.131",
|
|
43
|
+
"@lincyaw/studio": "0.2.0-rc.130",
|
|
44
|
+
"@lincyaw/mcp": "1.0.0-rc.131",
|
|
45
|
+
"@lincyaw/render-notebook": "1.0.0-rc.131",
|
|
46
|
+
"@lincyaw/render-slides": "1.0.0-rc.131",
|
|
47
|
+
"@lincyaw/addon-classroom": "1.0.0-rc.131",
|
|
48
|
+
"@lincyaw/addon-content": "1.0.0-rc.131",
|
|
49
|
+
"@lincyaw/addon-code": "1.0.0-rc.131",
|
|
50
|
+
"@lincyaw/addon-exec": "1.0.0-rc.131",
|
|
51
|
+
"@lincyaw/addon-exec-wasi": "1.0.0-rc.131",
|
|
52
|
+
"@lincyaw/addon-exec-local": "1.0.0-rc.131",
|
|
53
|
+
"@lincyaw/addon-exec-webgpu": "1.0.0-rc.131",
|
|
54
|
+
"@lincyaw/addon-exec-jupyter": "1.0.0-rc.131",
|
|
55
|
+
"@lincyaw/addon-guide": "1.0.0-rc.131",
|
|
56
|
+
"@lincyaw/addon-motion": "1.0.0-rc.131",
|
|
57
|
+
"@lincyaw/addon-lecture": "1.0.0-rc.131",
|
|
58
|
+
"@lincyaw/addon-session": "1.0.0-rc.131",
|
|
59
|
+
"@lincyaw/addon-publish": "1.0.0-rc.131",
|
|
60
|
+
"@lincyaw/addon-stage": "1.0.0-rc.131",
|
|
61
|
+
"@lincyaw/viewer": "1.0.0-rc.131",
|
|
62
|
+
"@lincyaw/addon-speech": "1.0.0-rc.131",
|
|
63
|
+
"@lincyaw/web": "1.0.0-rc.131",
|
|
64
|
+
"create-presmium": "1.0.0-rc.131",
|
|
65
|
+
"@lincyaw/addon-assistant": "1.0.0-rc.131"
|
|
59
66
|
}
|
|
60
67
|
}
|
package/src/site.ts
ADDED