@md-plugins/md-plugin-link 0.1.0-alpha.2 → 0.1.0-alpha.20
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 +11 -7
- package/dist/index.mjs +1 -1
- package/package.json +7 -4
package/README.md
CHANGED
|
@@ -35,7 +35,7 @@ const md = new MarkdownIt();
|
|
|
35
35
|
md.use(linkPlugin, {
|
|
36
36
|
linkTag: 'MarkdownLink', // Custom link tag (e.g., Vue Router component)
|
|
37
37
|
linkToKeyword: 'to', // Attribute to use for internal links
|
|
38
|
-
pageScript: 'import MarkdownLink from "src/components/
|
|
38
|
+
pageScript: 'import MarkdownLink from "src/.q-press/components/MarkdownLink.vue";',
|
|
39
39
|
});
|
|
40
40
|
|
|
41
41
|
const markdownContent = `
|
|
@@ -64,18 +64,18 @@ For the example above, the plugin produces the following output:
|
|
|
64
64
|
Additionally, the `pageScripts` property in the `env` object will contain:
|
|
65
65
|
|
|
66
66
|
```js
|
|
67
|
-
Set(['import MarkdownLink from "src/components/
|
|
67
|
+
Set(['import MarkdownLink from "src/.q-press/components/MarkdownLink.vue";'])
|
|
68
68
|
```
|
|
69
69
|
|
|
70
70
|
## Options
|
|
71
71
|
|
|
72
72
|
The `md-plugin-link` plugin supports the following options:
|
|
73
73
|
|
|
74
|
-
| Option | Type | Default
|
|
75
|
-
| ------------- | ------ |
|
|
76
|
-
| linkTag | string | 'MarkdownLink'
|
|
77
|
-
| linkToKeyword | string | 'to'
|
|
78
|
-
| pageScript | string | 'import MarkdownLink from "src/components/
|
|
74
|
+
| Option | Type | Default | Description |
|
|
75
|
+
| ------------- | ------ | ---------------------------------------------------------------------- | --------------------------------------------------------------- |
|
|
76
|
+
| linkTag | string | 'MarkdownLink' | Custom tag to use for internal links. |
|
|
77
|
+
| linkToKeyword | string | 'to' | Attribute to use for internal links (e.g., to for router-link). |
|
|
78
|
+
| pageScript | string | 'import MarkdownLink from "src/.q-press/components/MarkdownLink.vue";' | Import statement for required components. |
|
|
79
79
|
|
|
80
80
|
## Testing
|
|
81
81
|
|
|
@@ -85,6 +85,10 @@ Run the tests to ensure the plugin behaves as expected:
|
|
|
85
85
|
pnpm test
|
|
86
86
|
```
|
|
87
87
|
|
|
88
|
+
## Documentation
|
|
89
|
+
|
|
90
|
+
In case this README falls out of date, please refer to the [documentation](https://md-plugins.netlify.app/md-plugins/link/overview) for the latest information.
|
|
91
|
+
|
|
88
92
|
## License
|
|
89
93
|
|
|
90
94
|
This project is licensed under the MIT License. See the [LICENSE](LICENSE.md) file for details.
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const linkPlugin = (md, {
|
|
2
2
|
linkTag = "MarkdownLink",
|
|
3
3
|
linkToKeyword = "to",
|
|
4
|
-
pageScript = 'import MarkdownLink from "src/components/
|
|
4
|
+
pageScript = 'import MarkdownLink from "src/.q-press/components/MarkdownLink.vue"'
|
|
5
5
|
} = {}) => {
|
|
6
6
|
md.renderer.rules.link_open = (tokens, idx, options, env, self) => {
|
|
7
7
|
const token = tokens[idx];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@md-plugins/md-plugin-link",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.20",
|
|
4
4
|
"description": "A markdown-it plugin for handling links.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"markdown-it",
|
|
@@ -32,10 +32,13 @@
|
|
|
32
32
|
"files": [
|
|
33
33
|
"./dist"
|
|
34
34
|
],
|
|
35
|
-
"
|
|
36
|
-
"@types/markdown-it": "^14.1.2",
|
|
35
|
+
"devDependencies": {
|
|
37
36
|
"markdown-it": "^14.1.0",
|
|
38
|
-
"@
|
|
37
|
+
"@types/markdown-it": "^14.1.2",
|
|
38
|
+
"@md-plugins/shared": "0.1.0-alpha.20"
|
|
39
|
+
},
|
|
40
|
+
"peerDependencies": {
|
|
41
|
+
"markdown-it": "^14.1.0"
|
|
39
42
|
},
|
|
40
43
|
"publishConfig": {
|
|
41
44
|
"access": "public"
|