Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ Major changes in v3.0.0 modernize the architecture and usage. Here’s how to up
- After (v3): `import CodeView from 'react-code-view'` or `import { CodeView } from '@react-code-view/react'`
- Styles: Use the new CSS entry points.
- Before (v2): Less files (e.g., `react-code-view/less/styles.less`)
- After (v3): `import 'react-code-view/styles'` and optional syntax theme `import 'react-code-view/styles/highlight'`
- After (v3): `import 'react-code-view/styles'`
- Build tool integration: Replace legacy Webpack markdown loader with the unified unplugin across tools.
- Before (v2): `webpack-md-loader` and custom loader config
- After (v3): `@react-code-view/unplugin` for Vite/Webpack/Rollup/esbuild/Rspack (see examples above)
Expand Down
84 changes: 0 additions & 84 deletions RELEASE_NOTES_v3.0.0.md

This file was deleted.

Empty file.
Empty file added examples/vite/src/test-parse.js
Empty file.
2 changes: 1 addition & 1 deletion packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
- `useCodeExecution` effect behavior stabilized; consumers relying on previous implicit re-execution may need to explicitly update `code` or pass `dependencies`
- Package structure reorganized across `packages/*`; import paths may need updates according to exports
- Imports: `CodeView` is now also a default export in `@react-code-view/react` and re-exported by `react-code-view`; prefer `import CodeView from 'react-code-view'` or adjust named imports accordingly
- Styles: Less entries were removed; switch to `import 'react-code-view/styles'` and optional `import 'react-code-view/styles/highlight'`
- Styles: Less entries were removed; switch to `import 'react-code-view/styles'`
- Build integration: Legacy `webpack-md-loader` is removed; migrate to unified `@react-code-view/unplugin` for Vite/Webpack/Rollup/esbuild/Rspack
- Tooling: Minimum requirements updated to Node >=18 and PNPM >=8 for the monorepo/dev workflow
17 changes: 11 additions & 6 deletions packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,12 @@ const result = await transformMarkdown(markdown, {
### Direct Highlighting

```js
import { highlight, registerLanguage } from '@react-code-view/core';
import { highlight, initHighlighter } from '@react-code-view/core';

await registerLanguage('python');
// Initialize highlighter (optional, will auto-initialize on first use)
await initHighlighter();

const highlighted = highlight('print("Hello")', { language: 'python' });
const highlighted = await highlight('print("Hello")', { language: 'python' });
```

## API
Expand All @@ -61,11 +62,15 @@ Transform markdown to an ES module string.

### `highlight(code, options?)`

Highlight code with syntax highlighting.
Highlight code with syntax highlighting using Shiki.

### `registerLanguage(name)`
**Options:**
- `language` - Programming language (e.g., 'javascript', 'python')
- `theme` - Shiki theme (default: 'github-light')

### `initHighlighter()`

Register a language for highlighting.
Initialize the Shiki highlighter. Called automatically on first use.

## License

Expand Down
2 changes: 1 addition & 1 deletion packages/react-code-view/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
- `useCodeExecution` effect behavior stabilized; consumers relying on previous implicit re-execution may need to explicitly update `code` or pass `dependencies`
- Package structure reorganized across `packages/*`; import paths may need updates according to exports
- Imports: `CodeView` is now also a default export in `@react-code-view/react` and re-exported by `react-code-view`; prefer `import CodeView from 'react-code-view'` or adjust named imports accordingly
- Styles: Less entries were removed; switch to `import 'react-code-view/styles'` and optional `import 'react-code-view/styles/highlight'`
- Styles: Less entries were removed; switch to `import 'react-code-view/styles'`
- Build integration: Legacy `webpack-md-loader` is removed; migrate to unified `@react-code-view/unplugin` for Vite/Webpack/Rollup/esbuild/Rspack
- Tooling: Minimum requirements updated to Node >=18 and PNPM >=8 for the monorepo/dev workflow

Expand Down
3 changes: 1 addition & 2 deletions packages/react-code-view/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,8 @@ Import the base styles:

```tsx
import 'react-code-view/styles';
// or specific files
// or
import 'react-code-view/styles/index.css';
import 'react-code-view/styles/highlight.css';
```

Use theme classes:
Expand Down
2 changes: 1 addition & 1 deletion packages/react/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
- `useCodeExecution` effect behavior stabilized; consumers relying on previous implicit re-execution may need to explicitly update `code` or pass `dependencies`
- Package structure reorganized across `packages/*`; import paths may need updates according to exports
- Imports: `CodeView` is now also a default export in `@react-code-view/react` and re-exported by `react-code-view`; prefer `import CodeView from 'react-code-view'` or adjust named imports accordingly
- Styles: Less entries were removed; switch to `import 'react-code-view/styles'` and optional `import 'react-code-view/styles/highlight'`
- Styles: Less entries were removed; switch to `import 'react-code-view/styles'`
- Build integration: Legacy `webpack-md-loader` is removed; migrate to unified `@react-code-view/unplugin` for Vite/Webpack/Rollup/esbuild/Rspack
- Tooling: Minimum requirements updated to Node >=18 and PNPM >=8 for the monorepo/dev workflow

Expand Down
2 changes: 1 addition & 1 deletion packages/unplugin/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
- `useCodeExecution` effect behavior stabilized; consumers relying on previous implicit re-execution may need to explicitly update `code` or pass `dependencies`
- Package structure reorganized across `packages/*`; import paths may need updates according to exports
- Imports: `CodeView` is now also a default export in `@react-code-view/react` and re-exported by `react-code-view`; prefer `import CodeView from 'react-code-view'` or adjust named imports accordingly
- Styles: Less entries were removed; switch to `import 'react-code-view/styles'` and optional `import 'react-code-view/styles/highlight'`
- Styles: Less entries were removed; switch to `import 'react-code-view/styles'`
- Build integration: Legacy `webpack-md-loader` is removed; migrate to unified `@react-code-view/unplugin` for Vite/Webpack/Rollup/esbuild/Rspack
- Tooling: Minimum requirements updated to Node >=18 and PNPM >=8 for the monorepo/dev workflow

Expand Down