@riebeckite/plugin-marp 0.0.32 → 0.0.33
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 +24 -3
- package/README_ja.md +34 -12
- package/dist/client.d.ts +1 -0
- package/dist/client.js +87 -0
- package/dist/index.d.ts +0 -2
- package/dist/index.js +71 -9
- package/dist/src/page.d.ts +5 -0
- package/dist/src/render.d.ts +2 -1
- package/dist/src/types.d.ts +2 -1
- package/dist/src/viewer.d.ts +7 -0
- package/package.json +8 -2
- package/style.css +83 -11
package/README.md
CHANGED
|
@@ -25,6 +25,18 @@ export default defineConfig({
|
|
|
25
25
|
});
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
+
## Live example
|
|
29
|
+
|
|
30
|
+
~~~marp title="Intro deck"
|
|
31
|
+
# First slide
|
|
32
|
+
|
|
33
|
+
- a bullet
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
# Second slide
|
|
38
|
+
~~~
|
|
39
|
+
|
|
28
40
|
## Obsidian vault compatibility
|
|
29
41
|
|
|
30
42
|
The Obsidian plugins [Marp](https://github.com/jichoup/obsidian-marp-plugin) and [Marp Slides](https://github.com/samuele-cozzi/obsidian-marp-slides) treat the entire note as a Marp deck and never store `marp` code fences. In Obsidian, activation is plugin-level: opening the slide preview or exporting renders the whole file of the active note, and neither plugin reads a per-note marker. Riebeckite instead activates per document using the canonical `marp: true` frontmatter flag — the same signal Marp CLI and the VS Code extension use — so notes written for those plugins are detected as:
|
|
@@ -94,10 +106,18 @@ When several decks on one page use the same theme their generated CSS is identic
|
|
|
94
106
|
|
|
95
107
|
### Build-time rendering
|
|
96
108
|
|
|
97
|
-
- Rendering uses `script: false`, so
|
|
109
|
+
- Rendering uses `script: false`, so Marp Core adds no client script of its own. SVG slide sizing is handled by `style.css`;
|
|
98
110
|
- captions come from the code block `title`;
|
|
99
111
|
- `data-marp-slides` carries the slide count and `data-marp` marks the deck.
|
|
100
112
|
|
|
113
|
+
### Viewer
|
|
114
|
+
|
|
115
|
+
A small client entry (`initMarpDecks`) turns decks with two or more slides into a one-slide-at-a-time viewer: previous/next buttons, a slide counter, and a fullscreen toggle. Arrow keys, Page Up/Page Down, Home, and End move between slides while the deck has focus. Without JavaScript every slide stays in the vertical stack.
|
|
116
|
+
|
|
117
|
+
### Standalone slide pages
|
|
118
|
+
|
|
119
|
+
Every published whole-document Marp note also gets a deck-only page at `/slides` followed by its permalink. A note published at `/notes/talk/` is available at `/slides/notes/talk/`. The page renders the same deck without the Marp source fallback, and the note's normal page is unchanged. Inline `marp` fences keep their permalink only.
|
|
120
|
+
|
|
101
121
|
## Options
|
|
102
122
|
|
|
103
123
|
| Option | Default | Description |
|
|
@@ -113,15 +133,16 @@ An unknown theme falls back to the default theme and emits a diagnostic with `so
|
|
|
113
133
|
|
|
114
134
|
## Limitations
|
|
115
135
|
|
|
116
|
-
- No client-side slide editing
|
|
136
|
+
- No client-side slide editing. Paging is limited to the built-in viewer, which needs JavaScript; without it the deck renders as a vertical stack of slides.
|
|
117
137
|
- Only themes registered in Marp Core are available; loading arbitrary theme CSS is not supported.
|
|
118
138
|
- `inlineSVG: false` emits bare `<section>` elements without the SVG wrapper, and the generated CSS changes to match that structure.
|
|
119
139
|
- Whole-document decks bypass the normal Markdown pipeline, so Obsidian `` image embeds are not resolved inside slides. Use regular Markdown image syntax with paths that exist on the published site, mirroring how Marp Slides itself does not support wiki links.
|
|
120
140
|
|
|
121
141
|
## Exports
|
|
122
142
|
|
|
123
|
-
- `marp(options?)` / `
|
|
143
|
+
- `marp(options?)` / `marp(options?)` — plugin factory
|
|
124
144
|
- `isMarpDocument(matter?)` — frontmatter `marp: true` detection helper
|
|
145
|
+
- `initMarpDecks()` — viewer initializer, exported from `@riebeckite/plugin-marp/client`
|
|
125
146
|
- Types: `MarpOptions`, `MarpDeck`, `MarpBuildRenderResult`
|
|
126
147
|
|
|
127
148
|
## See also
|
package/README_ja.md
CHANGED
|
@@ -6,7 +6,7 @@ Marp のスライドデッキをビルド時に描画するプラグインです
|
|
|
6
6
|
|
|
7
7
|
[English](./README.md)
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## 使い方
|
|
10
10
|
|
|
11
11
|
```ts
|
|
12
12
|
import { defineConfig } from "@riebeckite/core";
|
|
@@ -25,9 +25,21 @@ export default defineConfig({
|
|
|
25
25
|
});
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
+
## 実行例
|
|
29
|
+
|
|
30
|
+
~~~marp title="Intro deck"
|
|
31
|
+
# First slide
|
|
32
|
+
|
|
33
|
+
- a bullet
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
# Second slide
|
|
38
|
+
~~~
|
|
39
|
+
|
|
28
40
|
## Obsidian Vault との互換性
|
|
29
41
|
|
|
30
|
-
Obsidian プラグインの [Marp](https://github.com/jichoup/obsidian-marp-plugin) と [Marp Slides](https://github.com/samuele-cozzi/obsidian-marp-slides) はノート全体を Marp デッキとして扱い、`marp` コードフェンスを保存しません。Obsidian
|
|
42
|
+
Obsidian プラグインの [Marp](https://github.com/jichoup/obsidian-marp-plugin) と [Marp Slides](https://github.com/samuele-cozzi/obsidian-marp-slides) はノート全体を Marp デッキとして扱い、`marp` コードフェンスを保存しません。Obsidian ではプラグイン単位で有効になります。スライドプレビューを開いたり、エクスポートしたりすると、アクティブなノートのファイル全体をデッキとして描画し、ノート単位のマーカーは読みません。Riebeckite では代わりに、Marp CLI や VS Code 拡張と同じ標準的なフラグ(frontmatter の `marp: true`)を使い、文書単位でデッキとして描画します。これらのプラグインで書いたノートは次のように検出されます。
|
|
31
43
|
|
|
32
44
|
````markdown
|
|
33
45
|
---
|
|
@@ -43,9 +55,9 @@ paginate: true
|
|
|
43
55
|
# 2 枚目のスライド
|
|
44
56
|
````
|
|
45
57
|
|
|
46
|
-
|
|
58
|
+
文書全体(ディレクティブとして `theme` や `paginate` を効かせるため frontmatter を含む)を、ページ本文を置き換える 1 つの `<figure class="rb-marp">` デッキとして描画します。スライドの区切りは Marp と同じく `---` / `===` です。フラグも `marp` コードブロックもないノートは変更しません。
|
|
47
59
|
|
|
48
|
-
>
|
|
60
|
+
> **有効化の条件.** Riebeckite は Obsidian プラグインと同じ方法では有効になりません。Obsidian でスライドプレビューを開いてスライドとして表示していたノートも、frontmatter に `marp: true` がなければここではデッキとして描画されません。そのような Vault に必要な変更はこの 1 行の追加だけです。デッキの本体(セパレータ、`theme` / `paginate` などのディレクティブ、標準 Marp 構文)は保存された内容をそのまま使います。つまり、出力は Marp のセマンティクスに従いますが、設定なしでプラグイン単位に有効になる Obsidian 側の挙動は再現しません。完全なドロップイン互換ではなく「コンテンツ互換」として扱ってください。
|
|
49
61
|
|
|
50
62
|
## インラインデッキ
|
|
51
63
|
|
|
@@ -63,7 +75,7 @@ paginate: true
|
|
|
63
75
|
```
|
|
64
76
|
````
|
|
65
77
|
|
|
66
|
-
##
|
|
78
|
+
## 描画の仕組み
|
|
67
79
|
|
|
68
80
|
`@marp-team/marp-core` をビルド時に動的 import して `Marp#render` を呼び出します。Marp Core はクライアントバンドルには含まれません。1 つのコードブロックは次の HTML に置き換わります。
|
|
69
81
|
|
|
@@ -82,22 +94,30 @@ paginate: true
|
|
|
82
94
|
</figure>
|
|
83
95
|
```
|
|
84
96
|
|
|
85
|
-
###
|
|
97
|
+
### 生成される CSS のスコープとインライン化
|
|
86
98
|
|
|
87
|
-
プラグインは `<head>` へ注入できないため、Marp が生成した CSS は `<figure class="rb-marp">` の中へ `<style>`
|
|
99
|
+
プラグインは `<head>` へ注入できないため、Marp が生成した CSS は `<figure class="rb-marp">` の中へ `<style>` 要素としてインライン化します。ほかの要素に漏れないよう、次の処理を行います。
|
|
88
100
|
|
|
89
101
|
- Marp の `container` オプションでデッキのコンテナクラスを `rb-marp__deck` に固定し、生成 CSS の全セレクタがそのコンテナ配下に来るようにする
|
|
90
102
|
- コンテナセレクタを `.rb-marp` の子孫に限定する(例: `.rb-marp div.rb-marp__deck > svg > foreignObject > section`)
|
|
91
103
|
- グローバルに漏れる `@page` ルールを削除し、`@media print` 内の `html, body` を `.rb-marp` に置き換える
|
|
92
104
|
|
|
93
|
-
同じテーマのデッキが 1
|
|
105
|
+
同じテーマのデッキが 1 ページに複数ある場合、生成される CSS が同一になるため `<style>` は 1 回だけ出力されます。
|
|
94
106
|
|
|
95
107
|
### ビルド時のレンダリング
|
|
96
108
|
|
|
97
|
-
- `script: false`
|
|
109
|
+
- `script: false` でレンダリングするため、Marp Core 由来のクライアントスクリプトは含まれません。SVG スライドのサイズは `style.css` 側で調整します
|
|
98
110
|
- キャプションはコードブロックの `title` から取得します
|
|
99
111
|
- `data-marp-slides` にスライド枚数、`data-marp` にデッキであることを示す属性を付けます
|
|
100
112
|
|
|
113
|
+
### ビューア
|
|
114
|
+
|
|
115
|
+
小さなクライアントエントリ(`initMarpDecks`)が、2 枚以上のスライドを持つデッキを 1 枚ずつ表示するビューアに変えます。前後ボタン、スライド枚数、全画面ボタンを備え、デッキにフォーカスがある間は矢印キー、Page Up / Page Down、Home、End でも移動できます。JavaScript がない場合は全スライドが縦に積まれたまま表示されます。
|
|
116
|
+
|
|
117
|
+
### スライド単体ページ
|
|
118
|
+
|
|
119
|
+
公開された全文 Marp ノートには、パーマリンクの前に `/slides` を付けたデッキ専用ページも生成されます。`/notes/talk/` で公開されるノートは `/slides/notes/talk/` でも開けます。Marp ソースの折りたたみを除いて同じデッキを表示し、ノート本来のページは変わりません。インラインの `marp` フェンスには単体ページは生成されません。
|
|
120
|
+
|
|
101
121
|
## オプション
|
|
102
122
|
|
|
103
123
|
| 項目 | 既定値 | 説明 |
|
|
@@ -113,14 +133,16 @@ paginate: true
|
|
|
113
133
|
|
|
114
134
|
## 制約
|
|
115
135
|
|
|
116
|
-
-
|
|
136
|
+
- クライアント側でのスライド編集は提供しません。ページ送りは組み込みビューアのみで、JavaScript が必要です。JavaScript がない場合は全スライドが縦に積まれて表示されます
|
|
117
137
|
- 利用できるテーマは Marp Core に登録済みのものに限られます。任意のテーマ CSS の読み込みには対応していません
|
|
118
|
-
- `inlineSVG: false` を指定すると SVG ラッパーなしの `<section>`
|
|
138
|
+
- `inlineSVG: false` を指定すると SVG ラッパーなしの `<section>` を出力します。生成される CSS もその構造に合わせて変わります
|
|
139
|
+
- 文書全体のデッキは通常の Markdown パイプラインを通らないため、スライド内の Obsidian の `` 埋め込みは解決されません。公開サイトに存在するパスを指定した通常の Markdown 画像記法を使ってください(Marp Slides 自体もウィキリンクには対応していません)
|
|
119
140
|
|
|
120
141
|
## 主なエクスポート
|
|
121
142
|
|
|
122
|
-
- `marp(options?)` / `
|
|
143
|
+
- `marp(options?)` / `marp(options?)`: プラグインを作成する
|
|
123
144
|
- `isMarpDocument(matter?)`: frontmatter の `marp: true` を判定するヘルパー
|
|
145
|
+
- `initMarpDecks()`: ビューアの初期化関数。`@riebeckite/plugin-marp/client` から公開
|
|
124
146
|
- 型: `MarpOptions`、`MarpDeck`、`MarpBuildRenderResult`
|
|
125
147
|
|
|
126
148
|
## 関連資料
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { initMarpDecks } from "./src/viewer.js";
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
// src/viewer.ts
|
|
2
|
+
var FIGURE_SELECTOR = "figure[data-marp]";
|
|
3
|
+
var DECK_SELECTOR = ":scope > div";
|
|
4
|
+
var COUNTER_SEPARATOR = " / ";
|
|
5
|
+
function initMarpDecks() {
|
|
6
|
+
if (typeof document === "undefined") return;
|
|
7
|
+
for (const figure of document.querySelectorAll(
|
|
8
|
+
FIGURE_SELECTOR
|
|
9
|
+
)) {
|
|
10
|
+
if (figure.dataset.marpViewer !== void 0) continue;
|
|
11
|
+
const deck = figure.querySelector(DECK_SELECTOR);
|
|
12
|
+
if (!deck) continue;
|
|
13
|
+
const slides = Array.from(deck.children);
|
|
14
|
+
if (slides.length < 2) continue;
|
|
15
|
+
mountViewer(figure, deck, slides);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function mountViewer(figure, deck, slides) {
|
|
19
|
+
figure.dataset.marpViewer = "";
|
|
20
|
+
figure.tabIndex = 0;
|
|
21
|
+
const controls = document.createElement("div");
|
|
22
|
+
controls.className = "rb-marp__controls";
|
|
23
|
+
const previous = createButton("Previous slide", "←");
|
|
24
|
+
const next = createButton("Next slide", "→");
|
|
25
|
+
const counter = document.createElement("span");
|
|
26
|
+
counter.className = "rb-marp__counter";
|
|
27
|
+
counter.setAttribute("aria-live", "polite");
|
|
28
|
+
controls.append(previous, next, counter);
|
|
29
|
+
if (typeof figure.requestFullscreen === "function") {
|
|
30
|
+
const fullscreen = createButton("Fullscreen", "⛶");
|
|
31
|
+
fullscreen.addEventListener("click", () => {
|
|
32
|
+
if (document.fullscreenElement === figure) {
|
|
33
|
+
void document.exitFullscreen();
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
void figure.requestFullscreen();
|
|
37
|
+
});
|
|
38
|
+
figure.addEventListener("fullscreenchange", () => {
|
|
39
|
+
fullscreen.setAttribute(
|
|
40
|
+
"aria-label",
|
|
41
|
+
document.fullscreenElement === figure ? "Exit fullscreen" : "Fullscreen"
|
|
42
|
+
);
|
|
43
|
+
});
|
|
44
|
+
controls.append(fullscreen);
|
|
45
|
+
}
|
|
46
|
+
deck.after(controls);
|
|
47
|
+
let index = 0;
|
|
48
|
+
const show = (target) => {
|
|
49
|
+
index = Math.min(Math.max(target, 0), slides.length - 1);
|
|
50
|
+
slides.forEach((slide, slideIndex) => {
|
|
51
|
+
if (slideIndex === index) slide.removeAttribute("hidden");
|
|
52
|
+
else slide.setAttribute("hidden", "");
|
|
53
|
+
});
|
|
54
|
+
counter.textContent = `${index + 1}${COUNTER_SEPARATOR}${slides.length}`;
|
|
55
|
+
previous.disabled = index === 0;
|
|
56
|
+
next.disabled = index === slides.length - 1;
|
|
57
|
+
};
|
|
58
|
+
previous.addEventListener("click", () => show(index - 1));
|
|
59
|
+
next.addEventListener("click", () => show(index + 1));
|
|
60
|
+
figure.addEventListener("keydown", (event) => {
|
|
61
|
+
if (event.key === "ArrowLeft" || event.key === "PageUp") {
|
|
62
|
+
event.preventDefault();
|
|
63
|
+
show(index - 1);
|
|
64
|
+
} else if (event.key === "ArrowRight" || event.key === "PageDown") {
|
|
65
|
+
event.preventDefault();
|
|
66
|
+
show(index + 1);
|
|
67
|
+
} else if (event.key === "Home") {
|
|
68
|
+
event.preventDefault();
|
|
69
|
+
show(0);
|
|
70
|
+
} else if (event.key === "End") {
|
|
71
|
+
event.preventDefault();
|
|
72
|
+
show(slides.length - 1);
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
show(0);
|
|
76
|
+
}
|
|
77
|
+
function createButton(label, glyph) {
|
|
78
|
+
const button = document.createElement("button");
|
|
79
|
+
button.type = "button";
|
|
80
|
+
button.className = "rb-marp__control";
|
|
81
|
+
button.setAttribute("aria-label", label);
|
|
82
|
+
button.textContent = glyph;
|
|
83
|
+
return button;
|
|
84
|
+
}
|
|
85
|
+
export {
|
|
86
|
+
initMarpDecks
|
|
87
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -8,5 +8,3 @@ export type { MarpBuildRenderResult, MarpDeck, MarpOptions, } from "./src/types.
|
|
|
8
8
|
* never becomes part of the client bundle.
|
|
9
9
|
*/
|
|
10
10
|
export declare function marp(options?: MarpOptions): import("@riebeckite/core").RiebeckitePlugin<MarpOptions>;
|
|
11
|
-
/** Alias matching the `*Plugin` naming used by other Riebeckite plugins. */
|
|
12
|
-
export declare const marpPlugin: typeof marp;
|
package/dist/index.js
CHANGED
|
@@ -293,10 +293,14 @@ function buildFigure(input) {
|
|
|
293
293
|
}
|
|
294
294
|
children.push(raw(input.deckHtml));
|
|
295
295
|
children.push(
|
|
296
|
-
element(
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
296
|
+
element(
|
|
297
|
+
"details",
|
|
298
|
+
{ className: `${input.className}__fallback rb-source-fallback` },
|
|
299
|
+
[
|
|
300
|
+
element("summary", {}, [text("Marp source")]),
|
|
301
|
+
element("pre", {}, [element("code", {}, [text(input.source)])])
|
|
302
|
+
]
|
|
303
|
+
)
|
|
300
304
|
);
|
|
301
305
|
return element(
|
|
302
306
|
"figure",
|
|
@@ -350,11 +354,52 @@ var init_rehype = __esm({
|
|
|
350
354
|
});
|
|
351
355
|
|
|
352
356
|
// index.ts
|
|
353
|
-
init_rehype();
|
|
354
357
|
import {
|
|
358
|
+
createClientEntry,
|
|
355
359
|
createStyleAsset,
|
|
356
360
|
definePlugin
|
|
357
361
|
} from "@riebeckite/core";
|
|
362
|
+
|
|
363
|
+
// src/page.ts
|
|
364
|
+
init_rehype();
|
|
365
|
+
var MARP_SLIDES_BASE_PATH = "/slides";
|
|
366
|
+
function marpSlidesPath(permalink) {
|
|
367
|
+
return `${MARP_SLIDES_BASE_PATH}${permalink}`.replace(/\/+$/, "");
|
|
368
|
+
}
|
|
369
|
+
function listMarpDeckEntries(manifest) {
|
|
370
|
+
return manifest.publicEntries.filter(
|
|
371
|
+
(entry) => isMarpDocument(entry.frontmatter)
|
|
372
|
+
);
|
|
373
|
+
}
|
|
374
|
+
function listMarpSlidesPaths(manifest) {
|
|
375
|
+
return [
|
|
376
|
+
...new Set(
|
|
377
|
+
listMarpDeckEntries(manifest).map(
|
|
378
|
+
(entry) => marpSlidesPath(entry.permalink)
|
|
379
|
+
)
|
|
380
|
+
)
|
|
381
|
+
];
|
|
382
|
+
}
|
|
383
|
+
function findMarpDeckEntry(manifest, pathname) {
|
|
384
|
+
const normalized = pathname.replace(/\/+$/, "");
|
|
385
|
+
return listMarpDeckEntries(manifest).find(
|
|
386
|
+
(entry) => marpSlidesPath(entry.permalink).replace(/\/+$/, "") === normalized
|
|
387
|
+
) ?? null;
|
|
388
|
+
}
|
|
389
|
+
function resolveMarpSlidesPage(context) {
|
|
390
|
+
const entry = findMarpDeckEntry(context.manifest, context.pathname);
|
|
391
|
+
if (!entry) return null;
|
|
392
|
+
return {
|
|
393
|
+
type: "marp-slides",
|
|
394
|
+
pathname: context.pathname,
|
|
395
|
+
title: entry.title,
|
|
396
|
+
body: `<div class="rb-marp-slides">${entry.html}</div>`,
|
|
397
|
+
...entry.publicLocation.language === void 0 ? {} : { language: entry.publicLocation.language }
|
|
398
|
+
};
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
// index.ts
|
|
402
|
+
init_rehype();
|
|
358
403
|
var CLASS_NAME_PATTERN = /^[A-Za-z][A-Za-z0-9_-]*$/;
|
|
359
404
|
function marp(options = {}) {
|
|
360
405
|
return definePlugin({
|
|
@@ -369,10 +414,28 @@ function marp(options = {}) {
|
|
|
369
414
|
extendHtmlPipeline: (pipeline) => {
|
|
370
415
|
pipeline.use(rehypeMarpLazy, options);
|
|
371
416
|
},
|
|
372
|
-
|
|
417
|
+
pageTypes: [
|
|
418
|
+
{
|
|
419
|
+
id: "marp-slides",
|
|
420
|
+
directoryIndex: true,
|
|
421
|
+
paths: ({ manifest }) => listMarpSlidesPaths(manifest),
|
|
422
|
+
outputDependencies: ({ manifest, pathname }) => {
|
|
423
|
+
const entry = findMarpDeckEntry(manifest, pathname);
|
|
424
|
+
return entry ? [{ type: "content", slug: entry.slug }] : [{ type: "unknown" }];
|
|
425
|
+
},
|
|
426
|
+
resolve: (context) => resolveMarpSlidesPage(context)
|
|
427
|
+
}
|
|
428
|
+
],
|
|
429
|
+
assets: [createStyleAsset("marp", "@riebeckite/plugin-marp/style.css")],
|
|
430
|
+
clientEntries: [
|
|
431
|
+
createClientEntry(
|
|
432
|
+
"marp",
|
|
433
|
+
"@riebeckite/plugin-marp/client",
|
|
434
|
+
"initMarpDecks"
|
|
435
|
+
)
|
|
436
|
+
]
|
|
373
437
|
});
|
|
374
438
|
}
|
|
375
|
-
var marpPlugin = marp;
|
|
376
439
|
function validateMarpOptions(options) {
|
|
377
440
|
if (!options) return [];
|
|
378
441
|
const issues = [];
|
|
@@ -408,6 +471,5 @@ function rehypeMarpLazy(options = {}) {
|
|
|
408
471
|
}
|
|
409
472
|
export {
|
|
410
473
|
isMarpDocument,
|
|
411
|
-
marp
|
|
412
|
-
marpPlugin
|
|
474
|
+
marp
|
|
413
475
|
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ContentManifest, ContentManifestEntry, PluginPage, PluginPageContext } from "@riebeckite/core";
|
|
2
|
+
export declare function marpSlidesPath(permalink: string): string;
|
|
3
|
+
export declare function listMarpSlidesPaths(manifest: ContentManifest): readonly string[];
|
|
4
|
+
export declare function findMarpDeckEntry(manifest: ContentManifest, pathname: string): ContentManifestEntry | null;
|
|
5
|
+
export declare function resolveMarpSlidesPage(context: PluginPageContext): PluginPage | null;
|
package/dist/src/render.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { MarpBuildRenderResult } from "./types.js";
|
|
2
|
-
|
|
2
|
+
type MarpRenderRequest = {
|
|
3
3
|
theme: string;
|
|
4
4
|
allowHtml: boolean;
|
|
5
5
|
math: boolean;
|
|
@@ -12,3 +12,4 @@ export type MarpRenderRequest = {
|
|
|
12
12
|
* code depends only on this contract, never on `@marp-team/marp-core` types.
|
|
13
13
|
*/
|
|
14
14
|
export declare function renderMarpDeck(markdown: string, request: MarpRenderRequest): Promise<MarpBuildRenderResult>;
|
|
15
|
+
export {};
|
package/dist/src/types.d.ts
CHANGED
|
@@ -42,7 +42,7 @@ export type TextNode = {
|
|
|
42
42
|
type: "text";
|
|
43
43
|
value: string;
|
|
44
44
|
};
|
|
45
|
-
|
|
45
|
+
type RawNode = {
|
|
46
46
|
type: "raw";
|
|
47
47
|
value: string;
|
|
48
48
|
};
|
|
@@ -50,3 +50,4 @@ export type HastNode = ElementNode | TextNode | RawNode | {
|
|
|
50
50
|
type: string;
|
|
51
51
|
[key: string]: unknown;
|
|
52
52
|
};
|
|
53
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riebeckite/plugin-marp",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.33",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -12,11 +12,17 @@
|
|
|
12
12
|
"source": "./index.ts",
|
|
13
13
|
"default": "./dist/index.js"
|
|
14
14
|
},
|
|
15
|
+
"./client": {
|
|
16
|
+
"types": "./dist/client.d.ts",
|
|
17
|
+
"import": "./dist/client.js",
|
|
18
|
+
"source": "./client.ts",
|
|
19
|
+
"default": "./dist/client.js"
|
|
20
|
+
},
|
|
15
21
|
"./style.css": "./style.css"
|
|
16
22
|
},
|
|
17
23
|
"dependencies": {
|
|
18
24
|
"@marp-team/marp-core": "^4.4.0",
|
|
19
|
-
"@riebeckite/core": "0.0.
|
|
25
|
+
"@riebeckite/core": "0.0.33"
|
|
20
26
|
},
|
|
21
27
|
"devDependencies": {
|
|
22
28
|
"tsx": "^4.22.4"
|
package/style.css
CHANGED
|
@@ -38,24 +38,96 @@
|
|
|
38
38
|
margin-bottom: 0;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
figure[data-marp][data-marp-viewer] > div:first-of-type > [hidden] {
|
|
42
|
+
display: none;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
figure[data-marp][data-marp-viewer] > div:first-of-type > svg[data-marpit-svg] {
|
|
46
|
+
margin-bottom: 0;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
figure[data-marp][data-marp-viewer]:focus-visible {
|
|
50
|
+
outline: 2px solid var(--rb-color-accent, currentColor);
|
|
51
|
+
outline-offset: 2px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.rb-marp__controls {
|
|
55
|
+
display: flex;
|
|
56
|
+
align-items: center;
|
|
57
|
+
gap: 0.5rem;
|
|
58
|
+
padding: 0.5rem 0.75rem;
|
|
42
59
|
border-top: 1px solid var(--rr-marp-rule);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.rb-marp__control {
|
|
63
|
+
min-width: 2rem;
|
|
64
|
+
padding: 0.25rem 0.5rem;
|
|
65
|
+
border: 1px solid var(--rr-marp-rule);
|
|
66
|
+
border-radius: 0;
|
|
67
|
+
background: transparent;
|
|
68
|
+
color: inherit;
|
|
69
|
+
font: inherit;
|
|
70
|
+
line-height: 1.2;
|
|
71
|
+
cursor: pointer;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.rb-marp__control:disabled {
|
|
75
|
+
opacity: 0.4;
|
|
76
|
+
cursor: default;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.rb-marp__counter {
|
|
80
|
+
margin-left: auto;
|
|
43
81
|
color: var(--rr-marp-muted);
|
|
44
82
|
font-size: 0.8125rem;
|
|
83
|
+
font-variant-numeric: tabular-nums;
|
|
45
84
|
}
|
|
46
85
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
86
|
+
figure[data-marp]:fullscreen {
|
|
87
|
+
display: flex;
|
|
88
|
+
flex-direction: column;
|
|
89
|
+
width: 100%;
|
|
90
|
+
height: 100%;
|
|
91
|
+
margin: 0;
|
|
92
|
+
border: 0;
|
|
93
|
+
background: var(--rr-marp-paper);
|
|
50
94
|
}
|
|
51
95
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
96
|
+
figure[data-marp]:fullscreen > figcaption {
|
|
97
|
+
display: none;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
figure[data-marp]:fullscreen > div:first-of-type {
|
|
101
|
+
display: flex;
|
|
102
|
+
flex: 1;
|
|
103
|
+
align-items: center;
|
|
104
|
+
justify-content: center;
|
|
105
|
+
overflow: hidden;
|
|
106
|
+
padding: 1rem;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
figure[data-marp]:fullscreen > div:first-of-type > svg[data-marpit-svg] {
|
|
110
|
+
width: 100%;
|
|
111
|
+
height: 100%;
|
|
112
|
+
max-width: 100%;
|
|
113
|
+
max-height: 100%;
|
|
114
|
+
margin: 0;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
figure[data-marp]:fullscreen > details {
|
|
118
|
+
display: none;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.rb-marp-slides {
|
|
122
|
+
margin: 2rem 0;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.rb-marp-slides > figure[data-marp] {
|
|
126
|
+
margin: 0;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.rb-marp-slides > figure[data-marp] > details {
|
|
130
|
+
display: none;
|
|
59
131
|
}
|
|
60
132
|
|
|
61
133
|
:is(:root, .rb-theme-root)[data-theme="dark"] .rb-marp {
|