vue-prism-editor
Advanced tools
Comparing version 1.0.1-beta.2 to 1.0.1-beta.3
# vue-prism-editor | ||
## 1.0.1-beta.3 | ||
### Patch Changes | ||
- Fix css specificity | ||
## 1.0.1-beta.2 | ||
@@ -4,0 +10,0 @@ |
{ | ||
"name": "vue-prism-editor", | ||
"version": "1.0.1-beta.2", | ||
"version": "1.0.1-beta.3", | ||
"description": "A dead simple code editor with syntax highlighting and line numbers.", | ||
@@ -5,0 +5,0 @@ "author": { |
# Vue Prism Editor | ||
<p align="center"> | ||
[![Bundle size (minified + gzip)][bundle-size-badge]][bundle-size] | ||
[![NPM Downloads][downloads-badge]][downloads] | ||
[![Build Status][build-badge]][build] | ||
![Codecov][covarage-badge] | ||
[![Version][version-badge]][package] | ||
[![MIT License][license-badge]][license] | ||
![version](https://img.shields.io/npm/v/vue-prism-editor.svg) | ||
![npm bundle size (minified + gzip)](https://img.shields.io/bundlephobia/minzip/vue-prism-editor.svg) | ||
[![GitHub](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/koca/vue-prism-editor) | ||
[![CircleCI branch](https://circleci.com/gh/koca/vue-prism-editor/tree/master.svg?style=shield)](https://circleci.com/gh/koca/vue-prism-editor/tree/master) | ||
<!-- ![Codecov](https://img.shields.io/codecov/c/github/koca/vue-prism-editor.svg) --> | ||
</p> | ||
> A dead simple code editor with syntax highlighting and line numbers. 3kb/z | ||
@@ -63,3 +59,3 @@ | ||
<template> | ||
<prism-editor v-model="code" :highlight="highlighter" line-numbers></prism-editor> | ||
<prism-editor class="my-editor" v-model="code" :highlight="highlighter" line-numbers></prism-editor> | ||
</template> | ||
@@ -76,3 +72,3 @@ | ||
import 'prismjs/components/prism-javascript'; | ||
import "prismjs/themes/prism-tomorrow.css" // import syntax highlighting styles | ||
import 'prismjs/themes/prism-tomorrow.css'; // import syntax highlighting styles | ||
@@ -93,19 +89,19 @@ export default { | ||
<style> | ||
// required class | ||
.my-editor { | ||
// we dont use `language-` classes anymore so thats why we need to add background and text color manually | ||
background: #2d2d2d; | ||
color: #ccc; | ||
// required class | ||
.my-editor { | ||
// we dont use `language-` classes anymore so thats why we need to add background and text color manually | ||
background: #2d2d2d; | ||
color: #ccc; | ||
// you must provide font-family font-size line-height. Example: | ||
font-family: Fira code, Fira Mono, Consolas, Menlo, Courier, monospace; | ||
font-size: 14px; | ||
line-height: 1.5; | ||
padding: 5px; | ||
} | ||
// you must provide font-family font-size line-height. Example: | ||
font-family: Fira code, Fira Mono, Consolas, Menlo, Courier, monospace; | ||
font-size: 14px; | ||
line-height: 1.5; | ||
padding: 5px; | ||
} | ||
// optional class for removing the outline | ||
.prism-editor__textarea:focus { | ||
outline: none; | ||
} | ||
// optional class for removing the outline | ||
.prism-editor__textarea:focus { | ||
outline: none; | ||
} | ||
</style> | ||
@@ -144,9 +140,12 @@ ``` | ||
| Name | Type | Default | Options | Description | | ||
| -------------------- | ------------------ | ------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| v-model `value` | `string` | `""` | - | Current value of the editor i.e. the code to display | | ||
| highlight | `string => string` | - | - | Callback which will receive text to highlight. You'll need to return an HTML string with syntax highlighting using a library such as prismjs. | | ||
| lineNumbers | `Boolean` | `false` | - | Whether to show line numbers | | ||
| readonly | `Boolean` | `false` | - | Readonly | | ||
| autoStyleLineNumbers | `Boolean` | `true` | - | Match line numbers text color to the theme | | ||
| Name | Type | Default | Options | Description | | ||
| -------------------- | ------------------ | ------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | | ||
| v-model `value` | `string` | `""` | - | Current value of the editor i.e. the code to display | | ||
| highlight | `string => string` | - | - | Callback which will receive text to highlight. You'll need to return an HTML string with syntax highlighting using a library such as prismjs. | | ||
| readonly | `Boolean` | `false` | - | Readonly | | ||
| lineNumbers | `Boolean` | `false` | - | Whether to show line numbers. Default `false` | | ||
| autoStyleLineNumbers | `Boolean` | `true` | - | Match line numbers text color to the theme. Default `true` | | ||
| tabSize | `number` | `2` | - | The number of characters to insert when pressing tab key. For example, for 4 space indentation, `tabSize` will be `4` and `insertSpaces` will be `true`. Default: `2` | | ||
| insertSpaces | `boolean` | `true` | - | Whether to use spaces for indentation. Default: `true`. If you set it to `false`, you might also want to set `tabSize` to `1` | | ||
| ignoreTabKey | `boolean` | `false` | - | Whether the editor should ignore tab key presses so that keyboard users can tab past the editor. Users can toggle this behaviour using `Ctrl+Shift+M` (Mac) / `Ctrl+M` manually when this is `false`. Default: `false` | | ||
@@ -164,3 +163,2 @@ ## Events | ||
## How it works | ||
@@ -185,3 +183,2 @@ | ||
## Thanks | ||
@@ -194,1 +191,14 @@ | ||
MIT | ||
[build-badge]: https://img.shields.io/circleci/project/github/koca/vue-prism-editor/master.svg?style=flat-square | ||
[build]: https://circleci.com/gh/koca/vue-prism-editor | ||
[downloads-badge]: https://img.shields.io/npm/dt/vue-prism-editor.svg?style=flat-square | ||
[downloads]: https://npmjs.com/package/vue-prism-editor | ||
[build-badge]: https://img.shields.io/npm/dm/vue-client-only.svg?style=flat | ||
[license-badge]: https://img.shields.io/npm/l/vue-prism-editor.svg?style=flat-square | ||
[license]: https://opensource.org/licenses/MIT | ||
[version-badge]: https://img.shields.io/npm/v/vue-prism-editor.svg?style=flat-square | ||
[package]: https://www.npmjs.com/package/vue-prism-editor | ||
[bundle-size-badge]: https://img.shields.io/bundlephobia/minzip/vue-prism-editor.svg?style=flat-square | ||
[bundle-size]: https://bundlephobia.com/result?p=vue-prism-editor | ||
[covarage-badge]: https://img.shields.io/codecov/c/github/koca/vue-prism-editor?style=flat-square |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
2
198
125807
15
1216