Skip to content

Commit 494b903

Browse files
committed
docs(readme): update readme and add info about directive syntax
1 parent d3bf9c4 commit 494b903

File tree

1 file changed

+40
-13
lines changed

1 file changed

+40
-13
lines changed

README.md

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,13 @@ Options:
6363
Where target directore is `<transformer output option>/<plugin runtime option>`<br>
6464
Default: `true`<br>
6565

66+
- `extraAttrs` – array of additional attributes in format `[name, value]`, that will be added to file links\
67+
Default: `undefined`
68+
69+
- `directiveSyntax` – enables new [directive syntax](#directive-syntax). \
70+
Available values: `'disabled' | 'enabled' | 'only'`\
71+
Default: `'disabled'`
72+
6673
## File markup
6774

6875
```md
@@ -75,23 +82,43 @@ Options:
7582

7683
### Supported attributes:
7784

78-
| Name | Required | Description |
79-
| ---------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
80-
| `src` | yes | URL of the file. Will be mapped to [`href` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-href) |
81-
| `name` | yes | Name of the file. Will be mapped to [`download` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-download) |
82-
| `lang` | - | Language of the file content. Will be mapped to [`hreflang` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-hreflang) |
83-
| `referrerpolicy` | - | [`referrerpolicy` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-referrerpolicy) |
84-
| `rel` | - | [`rel` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-rel) |
85-
| `target` | - | [`target` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-target) |
86-
| `type` | - | [`type` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-type) |
85+
| Name | Required | Description |
86+
| ---------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
87+
| `src` | yes | URL of the file. Will be mapped to [`href` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#href) |
88+
| `name` | yes | Name of the file. Will be mapped to [`download` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#download) |
89+
| `lang` | - | Language of the file content. Will be mapped to [`hreflang` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#hreflang) |
90+
| `referrerpolicy` | - | [`referrerpolicy` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#referrerpolicy) |
91+
| `rel` | - | [`rel` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#rel) |
92+
| `target` | - | [`target` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target) |
93+
| `type` | - | [`type` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#type) |
8794

8895
> _Note: other attributes will be ignored_
8996
90-
### Plugin options
97+
## Directive syntax
98+
99+
Also you can use inline directive syntax for file links. For more information see here: [diplodoc-platform/directive](https://github.com/diplodoc-platform/directive/?tab=readme-ov-file#directive-syntax).
100+
101+
To enable directive syntax pass `directiveSyntax: 'enabled'` to options. Or you can disabled old syntax and use only directive syntax: `directiveSyntax: 'only'`.
102+
103+
```md
104+
:file[<file-name>](file-url)
105+
106+
<!-- Example: -->
91107

92-
| Name | Type | Description |
93-
| ---------------- | -------------------- | ------------------------------------------------ |
94-
| `fileExtraAttrs` | `[string, string][]` | Adds additional attributes to rendered hyperlink |
108+
:file[readme.md](path/to/readme/md){type=text/plain}
109+
```
110+
111+
### Supported attributes:
112+
113+
| Name | Description |
114+
| ---------------- | --------------------------------------------------------------------------------------------------------------- |
115+
| `hreflang` | [anchor `hreflang` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#hreflang) |
116+
| `referrerpolicy` | [anchor `referrerpolicy` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#referrerpolicy) |
117+
| `rel` | [anchor `rel` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#rel) |
118+
| `target` | [anchor `target` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target) |
119+
| `type` | [anchor `type` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#type) |
120+
121+
> _Note: other attributes will be ignored_
95122
96123
## CSS public variables
97124

0 commit comments

Comments
 (0)