-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: refactor code project folder.
- Loading branch information
1 parent
dbbb2be
commit 8c05715
Showing
28 changed files
with
418 additions
and
507 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"*.{js,jsx,tsx,ts,less,md,json}": [ | ||
"prettier --write" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
**/*.md | ||
**/*.svg | ||
**/*.ejs | ||
**/*.html | ||
**/*.yml | ||
package.json | ||
node_modules | ||
dist | ||
build | ||
coverage | ||
lib | ||
esm | ||
test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"singleQuote": true, | ||
"trailingComma": "all", | ||
"printWidth": 120, | ||
"overrides": [ | ||
{ | ||
"files": ".prettierrc", | ||
"options": { "parser": "json" } | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
./core/README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
@uiw/react-prismjs | ||
=== | ||
<!--dividing--> | ||
|
||
[![Build & Deploy](https://github.com/uiwjs/react-prismjs/actions/workflows/ci.yml/badge.svg)](https://github.com/uiwjs/react-prismjs/actions/workflows/ci.yml) | ||
[![NPM Downloads](https://img.shields.io/npm/dm/@uiw/react-prismjs.svg?style=flat)](https://www.npmjs.com/package/@uiw/react-prismjs) | ||
[![npm version](https://img.shields.io/npm/v/@uiw/react-prismjs.svg)](https://www.npmjs.com/package/@uiw/react-prismjs) | ||
[![npm bundle size](https://img.shields.io/bundlephobia/minzip/@uiw/react-prismjs.svg)](https://bundlephobia.com/result?p=@uiw/react-prismjs) | ||
|
||
React Component for [prismjs](https://github.com/PrismJS/prism). The current [document website](https://uiwjs.github.io/react-prismjs/). | ||
|
||
## Install | ||
|
||
```bash | ||
npm i @uiw/react-prismjs | ||
``` | ||
|
||
## Basic Usage | ||
|
||
[![Open in CodeSandbox](https://img.shields.io/badge/Open%20in-CodeSandbox-blue?logo=codesandbox)](https://codesandbox.io/embed/example-uiw-react-prismjs-uj67m?fontsize=14&hidenavigation=1&theme=dark) | ||
|
||
```jsx mdx:preview?background=#fff | ||
import React from 'react'; | ||
import ReactPrismjs from '@uiw/react-prismjs'; | ||
import 'prismjs/components/prism-java'; | ||
|
||
const JAVAString =`import com.demo.util.MyType; | ||
import com.demo.util.MyInterface; | ||
public enum Enum { | ||
VAL1, VAL2, VAL3 | ||
} | ||
public class Class<T, V> implements MyInterface { | ||
public static final MyType<T, V> member; | ||
@Override | ||
public MyType method() { | ||
return member; | ||
} | ||
public void method2(MyType<T, V> value) { | ||
method(); | ||
value.method3(); | ||
member = value; | ||
} | ||
} | ||
`; | ||
|
||
export default function Demo() { | ||
return ( | ||
<ReactPrismjs language="java" source={JAVAString} style={{ backgroundColor: '#f6f8fa', fontSize: 16 }} /> | ||
) | ||
} | ||
``` | ||
|
||
### Theme | ||
|
||
Support [`prismjs`](https://github.com/PrismJS/prism/tree/master/themes) theme setting | ||
|
||
```js | ||
import ReactPrismjs from '@uiw/react-prismjs'; | ||
import 'prismjs/themes/prism-coy.css'; | ||
``` | ||
|
||
### Options Props | ||
|
||
```typescript | ||
interface ReactPrismjsProps { | ||
prefixCls?: string; | ||
language?: string; | ||
source?: string; | ||
className?: string; | ||
} | ||
``` | ||
|
||
- `source` - _string_ The code string source to parse (**required**) | ||
- `language` - _string_ A language id in [`Prism.languages`](https://github.com/PrismJS/prism/blob/388ad996c4b576205de4d4feda69202bd26c1345/components.json). | ||
- `className` - _string_ Class name of the container element. | ||
|
||
## Development | ||
|
||
**development** | ||
|
||
Runs the project in development mode. | ||
|
||
```bash | ||
# listen to the component compile and output the .js file and listen for compilation output type .d.ts file | ||
npm run watch | ||
# development mode, listen to compile preview website instance | ||
npm run doc:dev | ||
``` | ||
|
||
## Contributors | ||
|
||
As always, thanks to our amazing contributors! | ||
|
||
<a href="https://github.com/uiwjs/react-prismjs/graphs/contributors"> | ||
<img src="https://uiwjs.github.io/react-prismjs/CONTRIBUTORS.svg" /> | ||
</a> | ||
|
||
Made with [contributors](https://github.com/jaywcjlove/github-action-contributors). | ||
|
||
## License | ||
|
||
Licensed under the MIT License. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"name": "@uiw/react-prismjs", | ||
"version": "1.3.6", | ||
"description": "React Component for prismjs.", | ||
"homepage": "https://uiwjs.github.io/react-prismjs/", | ||
"main": "cjs/index.js", | ||
"module": "esm/index.js", | ||
"scripts": { | ||
"css:build": "compile-less -d src -o esm", | ||
"css:watch": "compile-less -d src -o esm --watch", | ||
"css:build:dist": "compile-less -d src --combine dist.css --rm-global", | ||
"watch": "tsbb watch src/*.tsx --use-babel & npm run css:watch", | ||
"build": "tsbb build src/*.tsx --use-babel && npm run css:build && npm run css:build:dist" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/uiwjs/react-prismjs.git" | ||
}, | ||
"author": "kenny wang <[email protected]>", | ||
"license": "MIT", | ||
"files": [ | ||
"dist.css", | ||
"src", | ||
"cjs", | ||
"esm" | ||
], | ||
"peerDependencies": { | ||
"react": ">=16.8.0", | ||
"react-dom": ">=16.8.0" | ||
}, | ||
"dependencies": { | ||
"@types/prismjs": "~1.26.0", | ||
"prismjs": "~1.29.0" | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"extends": "../tsconfig", | ||
"include": ["src"], | ||
"compilerOptions": { | ||
"baseUrl": "./", | ||
"noEmit": false, | ||
"outDir": "./cjs" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"version": "1.3.6", | ||
"packages": ["core", "www"] | ||
} |
Oops, something went wrong.