@riebeckite/plugin-attachment 0.0.21 → 0.0.22
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 +22 -23
- package/README_ja.md +27 -5
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# @riebeckite/plugin-attachment
|
|
2
2
|
|
|
3
|
+
<!-- Generated from docs/docs/plugins/attachment.md. Edit the canonical documentation in docs/docs/plugins and run `pnpm docs:sync`. -->
|
|
4
|
+
|
|
3
5
|
Attachment link and embed card rendering for Obsidian wikilinks.
|
|
4
6
|
|
|
5
7
|
[日本語](./README_ja.md)
|
|
@@ -25,32 +27,29 @@ export default defineConfig({
|
|
|
25
27
|
});
|
|
26
28
|
```
|
|
27
29
|
|
|
28
|
-
##
|
|
30
|
+
## Live example
|
|
29
31
|
|
|
30
|
-
|
|
32
|
+
The following source is rendered on this page. A plain wikilink becomes a download link, and an embedded wikilink becomes an attachment card.
|
|
31
33
|
|
|
32
|
-
|
|
33
|
-
<a class="wikilink wikilink-attachment" href="..." download>label</a>
|
|
34
|
-
```
|
|
34
|
+
#### Source
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
```
|
|
36
|
+
````md
|
|
37
|
+
[[attachment-example.txt]]
|
|
38
|
+
|
|
39
|
+
![[attachment-example.txt]]
|
|
40
|
+
````
|
|
41
|
+
|
|
42
|
+
#### Rendered
|
|
43
|
+
|
|
44
|
+
[[attachment-example.txt]]
|
|
45
|
+
|
|
46
|
+
![[attachment-example.txt]]
|
|
48
47
|
|
|
49
|
-
- Format is the uppercased file extension
|
|
50
|
-
- Size is read from disk under `config.content.directory` (path-traversal
|
|
51
|
-
|
|
52
|
-
- The embed card carries the stable `rr-attachment` root hook that themes
|
|
53
|
-
|
|
48
|
+
- Format is the uppercased file extension.
|
|
49
|
+
- Size is read from disk under `config.content.directory` (path-traversal safe)
|
|
50
|
+
and omitted when the file cannot be read.
|
|
51
|
+
- The embed card carries the stable `rr-attachment` root hook that themes may
|
|
52
|
+
target.
|
|
54
53
|
|
|
55
54
|
Styles ship in `style.css` (inline attachment links also get a `↓` suffix).
|
|
56
55
|
|
|
@@ -67,5 +66,5 @@ Styles ship in `style.css` (inline attachment links also get a `↓` suffix).
|
|
|
67
66
|
|
|
68
67
|
## See also
|
|
69
68
|
|
|
70
|
-
- [Plugin guide](
|
|
69
|
+
- [Plugin guide](https://github.com/Rerurate514/riebeckite/blob/main/docs/docs/reference/plugin-api.md)
|
|
71
70
|
- [`@riebeckite/plugin-obsidian-markdown`](../obsidian-markdown/README.md)
|
package/README_ja.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# @riebeckite/plugin-attachment
|
|
2
2
|
|
|
3
|
+
<!-- Generated from docs/docs/plugins/attachment.ja.md. Edit the canonical documentation in docs/docs/plugins and run `pnpm docs:sync`. -->
|
|
4
|
+
|
|
3
5
|
Obsidian 形式の添付ファイルリンクを、ダウンロードリンクや添付カードとして表示するプラグインです。
|
|
4
6
|
|
|
5
7
|
[English](./README.md)
|
|
@@ -25,10 +27,31 @@ export default defineConfig({
|
|
|
25
27
|
|
|
26
28
|
## リンクと埋め込みで表示を分ける
|
|
27
29
|
|
|
28
|
-
- `[[
|
|
29
|
-
- `![[
|
|
30
|
+
- `[[attachment-example.txt]]` は、`download` 属性を持つ通常のリンクになります。
|
|
31
|
+
- `![[attachment-example.txt]]` は、拡張子、ファイル名、ダウンロードリンクを含む添付カードになります。
|
|
32
|
+
|
|
33
|
+
以下のソースは、このページ上で実際に描画されます。
|
|
34
|
+
|
|
35
|
+
#### ソース
|
|
36
|
+
|
|
37
|
+
````md
|
|
38
|
+
[[attachment-example.txt]]
|
|
39
|
+
|
|
40
|
+
![[attachment-example.txt]]
|
|
41
|
+
````
|
|
30
42
|
|
|
31
|
-
|
|
43
|
+
#### 実行例
|
|
44
|
+
|
|
45
|
+
[[attachment-example.txt]]
|
|
46
|
+
|
|
47
|
+
![[attachment-example.txt]]
|
|
48
|
+
|
|
49
|
+
- 形式は大文字にした拡張子です。
|
|
50
|
+
- カードのファイルサイズは `config.content.directory` 配下から読み取ります。パスは
|
|
51
|
+
コンテンツディレクトリの外へ出られないよう検査され、読めないファイルのサイズは表示しません。
|
|
52
|
+
- 埋め込みカードには、Theme が対象にできる安定した `rr-attachment` ルートフックが付きます。
|
|
53
|
+
|
|
54
|
+
スタイルは `style.css` に同梱されます(インラインの添付リンクには `↓` 接尾辞も付きます)。
|
|
32
55
|
|
|
33
56
|
## オプション
|
|
34
57
|
|
|
@@ -43,6 +66,5 @@ export default defineConfig({
|
|
|
43
66
|
|
|
44
67
|
## 関連資料
|
|
45
68
|
|
|
46
|
-
- [プラグインシステム](
|
|
69
|
+
- [プラグインシステム](https://github.com/Rerurate514/riebeckite/blob/main/docs/docs/reference/plugin-api.ja.md)
|
|
47
70
|
- [`@riebeckite/plugin-obsidian-markdown`](../obsidian-markdown/README_ja.md)
|
|
48
|
-
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riebeckite/plugin-attachment",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.22",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"./style.css": "./style.css"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@riebeckite/core": "0.0.
|
|
18
|
+
"@riebeckite/core": "0.0.22"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"tsx": "^4.22.4"
|