@md-plugins/md-plugin-table 0.1.0-alpha.1 → 0.1.0-alpha.2
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/LICENSE.md +1 -1
- package/README.md +18 -20
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +3 -3
package/LICENSE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
The MIT License (MIT)
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2024-present,
|
|
3
|
+
Copyright (c) 2024-present, MD-PLUGINS
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.md
CHANGED
|
@@ -27,10 +27,10 @@ pnpm add @md-plugins/md-plugin-table
|
|
|
27
27
|
### Basic Setup
|
|
28
28
|
|
|
29
29
|
```js
|
|
30
|
-
import MarkdownIt from 'markdown-it'
|
|
31
|
-
import { tablePlugin } from '@md-plugins/md-plugin-table'
|
|
30
|
+
import MarkdownIt from 'markdown-it'
|
|
31
|
+
import { tablePlugin } from '@md-plugins/md-plugin-table'
|
|
32
32
|
|
|
33
|
-
const md = new MarkdownIt()
|
|
33
|
+
const md = new MarkdownIt()
|
|
34
34
|
md.use(tablePlugin, {
|
|
35
35
|
tableClass: 'custom-table-class',
|
|
36
36
|
tableToken: 'custom-table-tag',
|
|
@@ -38,18 +38,18 @@ md.use(tablePlugin, {
|
|
|
38
38
|
[':wrap-cells', 'true'],
|
|
39
39
|
[':flat', 'true'],
|
|
40
40
|
],
|
|
41
|
-
})
|
|
41
|
+
})
|
|
42
42
|
|
|
43
43
|
const markdownContent = `
|
|
44
44
|
| Header 1 | Header 2 |
|
|
45
45
|
|----------|----------|
|
|
46
46
|
| Cell 1 | Cell 2 |
|
|
47
47
|
| Cell 3 | Cell 4 |
|
|
48
|
-
|
|
48
|
+
`
|
|
49
49
|
|
|
50
|
-
const renderedOutput = md.render(markdownContent)
|
|
50
|
+
const renderedOutput = md.render(markdownContent)
|
|
51
51
|
|
|
52
|
-
console.log('Rendered Output:', renderedOutput)
|
|
52
|
+
console.log('Rendered Output:', renderedOutput)
|
|
53
53
|
```
|
|
54
54
|
|
|
55
55
|
### Example Output
|
|
@@ -81,14 +81,14 @@ For the example above, the plugin produces the following output:
|
|
|
81
81
|
|
|
82
82
|
The `md-plugin-table` plugin supports the following options:
|
|
83
83
|
|
|
84
|
-
| Option | Type | Default
|
|
85
|
-
| ---------------- | ------ |
|
|
86
|
-
| tableClass | string | 'markdown-
|
|
87
|
-
| tableToken | string | 'q-markup-table'
|
|
88
|
-
| tableAttributes | Array | []
|
|
89
|
-
| tableHeaderClass | string | 'text-left'
|
|
90
|
-
| tableRowClass | string | ''
|
|
91
|
-
| tableCellClass | string | ''
|
|
84
|
+
| Option | Type | Default | Description |
|
|
85
|
+
| ---------------- | ------ | ---------------- | -------------------------------------------------- |
|
|
86
|
+
| tableClass | string | 'markdown-table' | CSS class for the `<table>` or custom tag. |
|
|
87
|
+
| tableToken | string | 'q-markup-table' | Tag name to replace the default `<table>` tag. |
|
|
88
|
+
| tableAttributes | Array | [] | Array of attribute name-value pairs for the table. |
|
|
89
|
+
| tableHeaderClass | string | 'text-left' | CSS class for `<th>` elements. |
|
|
90
|
+
| tableRowClass | string | '' | CSS class for `<tr>` elements. |
|
|
91
|
+
| tableCellClass | string | '' | CSS class for `<td>` elements. |
|
|
92
92
|
|
|
93
93
|
## Advanced Usage
|
|
94
94
|
|
|
@@ -102,7 +102,7 @@ md.use(tablePlugin, {
|
|
|
102
102
|
tableHeaderClass: 'custom-header',
|
|
103
103
|
tableRowClass: 'custom-row',
|
|
104
104
|
tableCellClass: 'custom-cell',
|
|
105
|
-
})
|
|
105
|
+
})
|
|
106
106
|
```
|
|
107
107
|
|
|
108
108
|
Renered output:
|
|
@@ -134,15 +134,13 @@ md.use(tablePlugin, {
|
|
|
134
134
|
[':bordered', 'true'],
|
|
135
135
|
[':flat', 'true'],
|
|
136
136
|
],
|
|
137
|
-
})
|
|
137
|
+
})
|
|
138
138
|
```
|
|
139
139
|
|
|
140
140
|
Rendered output:
|
|
141
141
|
|
|
142
142
|
```html
|
|
143
|
-
<q-markup-table class="markdown-
|
|
144
|
-
...
|
|
145
|
-
</q-markup-table>
|
|
143
|
+
<q-markup-table class="markdown-table" :bordered="true" :flat="true"> ... </q-markup-table>
|
|
146
144
|
```
|
|
147
145
|
|
|
148
146
|
## Testing
|
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@md-plugins/md-plugin-table",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.2",
|
|
4
4
|
"description": "A markdown-it plugin for handling tables with custom tag and styles.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"markdown-it",
|
|
@@ -35,14 +35,14 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@types/markdown-it": "^14.1.2",
|
|
37
37
|
"markdown-it": "^14.1.0",
|
|
38
|
-
"@md-plugins/shared": "0.1.0-alpha.
|
|
38
|
+
"@md-plugins/shared": "0.1.0-alpha.2"
|
|
39
39
|
},
|
|
40
40
|
"publishConfig": {
|
|
41
41
|
"access": "public"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"build": "unbuild",
|
|
45
|
-
"clean": "rm -rf dist",
|
|
45
|
+
"clean": "rm -rf dist/ node_modules/",
|
|
46
46
|
"test": "vitest"
|
|
47
47
|
}
|
|
48
48
|
}
|