react-markdown-table-ts 1.4.5 → 1.4.7
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 +12 -27
- package/dist/LineNumbers.d.ts +851 -0
- package/dist/LineNumbers.d.ts.map +1 -0
- package/dist/MarkdownTable.d.ts +7 -0
- package/dist/MarkdownTable.d.ts.map +1 -0
- package/dist/index.cjs +27 -47
- package/dist/index.d.ts +3 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +555 -2090
- package/dist/types.d.ts +2 -2
- package/dist/utils.d.ts.map +1 -1
- package/package.json +5 -8
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
| `'light'` theme | `'dark'` theme |
|
|
13
13
|
|
|
14
14
|
## Overview
|
|
15
|
-
A React component for generating and displaying formatted Markdown tables
|
|
15
|
+
A React component for generating and displaying formatted Markdown tables. The core component is `MarkdownTable` which converts 2D array data into properly formatted Markdown table syntax. Columns of variable width maintain consistent spacing across all rows, ensuring vertical alignment of delimiters. The output is displayed in a styled `<pre>` element with optional line numbering and supports both light and dark themes.
|
|
16
16
|
|
|
17
17
|
## Installation
|
|
18
18
|
|
|
@@ -20,7 +20,7 @@ A React component for generating and displaying formatted Markdown tables with s
|
|
|
20
20
|
npm install react-markdown-table-ts
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
The component includes all necessary
|
|
23
|
+
The component includes all necessary dependencies and CSS is embedded inline, so no additional setup is required.
|
|
24
24
|
|
|
25
25
|
## API
|
|
26
26
|
```typescript
|
|
@@ -55,7 +55,7 @@ interface MarkdownTableProps {
|
|
|
55
55
|
| `className` | `string` | `undefined` | Class will be applied to the \<pre\> element display. |
|
|
56
56
|
| `preStyle` | `React.CSSProperties` | `undefined` | Allows direct styling of the display with CSS properties. |
|
|
57
57
|
| `minWidth` | `number` | `undefined` | Optional minimum width in pixels for the table container. |
|
|
58
|
-
| `showLineNumbers` | `boolean` | `true` | Show or hide line numbers in the
|
|
58
|
+
| `showLineNumbers` | `boolean` | `true` | Show or hide line numbers in the code block. |
|
|
59
59
|
| `onGenerate` | `(markdownTableString: string) => void` | `undefined` | Callback to receive the generated Markdown table string. |
|
|
60
60
|
## Usage Patterns
|
|
61
61
|
|
|
@@ -116,9 +116,9 @@ interface MarkdownTableProps {
|
|
|
116
116
|
- Preserves stack traces for debugging
|
|
117
117
|
|
|
118
118
|
4. **Styling**:
|
|
119
|
-
-
|
|
120
|
-
- Supports light/dark themes
|
|
119
|
+
- Includes built-in light and dark themes
|
|
121
120
|
- Custom styles via `className` and `preStyle` props
|
|
121
|
+
- Optional line numbers for better readability
|
|
122
122
|
|
|
123
123
|
## Common Transformations
|
|
124
124
|
|
|
@@ -133,31 +133,16 @@ interface MarkdownTableProps {
|
|
|
133
133
|
|
|
134
134
|
## Troubleshooting
|
|
135
135
|
|
|
136
|
-
### Styling Issues
|
|
136
|
+
### Styling Issues
|
|
137
137
|
|
|
138
|
-
If you experience styling issues when importing this component into your project (e.g., missing line numbers, incorrect
|
|
138
|
+
If you experience styling issues when importing this component into your project (e.g., missing line numbers, incorrect colors), this may be due to CSS conflicts with other libraries or global styles in your application.
|
|
139
139
|
|
|
140
|
-
**
|
|
140
|
+
**Common Solutions:**
|
|
141
141
|
|
|
142
|
-
|
|
142
|
+
1. **Check for CSS conflicts**: Ensure no other libraries or global styles are overriding the component's built-in CSS.
|
|
143
143
|
|
|
144
|
-
|
|
145
|
-
module.exports = {
|
|
146
|
-
// ... other config
|
|
147
|
-
optimization: {
|
|
148
|
-
sideEffects: true,
|
|
149
|
-
},
|
|
150
|
-
};
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
**Solution 2 - Force Import**
|
|
144
|
+
2. **Verify theme prop**: Make sure you're using the correct `theme` prop value (`'light'` or `'dark'`) for your application.
|
|
154
145
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
```javascript
|
|
158
|
-
import 'prismjs/components/prism-markdown';
|
|
159
|
-
import 'prismjs/plugins/line-numbers/prism-line-numbers';
|
|
160
|
-
import 'prismjs/plugins/line-numbers/prism-line-numbers.css';
|
|
161
|
-
```
|
|
146
|
+
3. **Custom styling**: Use the `className` and `preStyle` props to add custom styles or override defaults as needed.
|
|
162
147
|
|
|
163
|
-
|
|
148
|
+
4. **Line numbers**: If line numbers aren't displaying, verify that `showLineNumbers` is set to `true` (default).
|