yapp 3.0.8 → 4.0.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/README.md +7 -7
- package/example.js +1414 -1684
- package/lib/defaults.js +4 -4
- package/lib/example/div/sizeable/left.js +1 -1
- package/lib/example/div/sizeable/middle.js +1 -1
- package/lib/example/div/sizeable/right.js +1 -1
- package/lib/example/div/sizeable/top.js +1 -1
- package/lib/example/textarea/bnf.js +1 -1
- package/lib/example/textarea/lexicalEntries.js +1 -1
- package/lib/example/textarea/parseTree.js +1 -1
- package/lib/example/textarea/tokens.js +1 -1
- package/lib/example/view/javascript.js +1 -1
- package/lib/example/view/json.js +1 -1
- package/lib/example/view/xml.js +1 -1
- package/lib/example/view.js +23 -42
- package/lib/example/yapp.js +5 -3
- package/lib/gutter.js +7 -40
- package/lib/highlights.js +248 -0
- package/lib/lexer/javascript.js +1 -1
- package/lib/lexer/json.js +1 -1
- package/lib/lexer/plainText.js +1 -1
- package/lib/lexer/xml.js +1 -1
- package/lib/lineNumbers.js +13 -3
- package/lib/mixins/style.js +1 -1
- package/lib/parser/javascript.js +1 -1
- package/lib/parser/json.js +1 -1
- package/lib/parser/plainText.js +1 -1
- package/lib/parser/xml.js +1 -1
- package/lib/plugin/javascript.js +1 -1
- package/lib/plugin/json.js +1 -1
- package/lib/plugin/plainText.js +1 -1
- package/lib/plugin/xml.js +1 -1
- package/lib/plugin.js +1 -1
- package/lib/prettyPrinter.js +29 -145
- package/lib/processor/javascript.js +1 -1
- package/lib/processor/json.js +1 -1
- package/lib/processor/plainText.js +1 -1
- package/lib/processor/xml.js +1 -1
- package/lib/processor.js +1 -1
- package/lib/renderYappStyles.js +1 -1
- package/lib/richTextarea.js +5 -26
- package/lib/styles.js +1 -5
- package/lib/syntax.js +77 -19
- package/lib/token/significant/argument.js +1 -1
- package/lib/token/significant/attribute.js +1 -1
- package/lib/token/significant/comment.js +1 -1
- package/lib/token/significant/error.js +1 -1
- package/lib/token/significant/jsx/attributeName.js +1 -1
- package/lib/token/significant/jsx/tagName.js +1 -1
- package/lib/token/significant/name.js +1 -1
- package/lib/token/significant/string.js +1 -1
- package/lib/token/significant/variable.js +1 -1
- package/lib/utilities/content.js +1 -1
- package/lib/utilities/css.js +1 -1
- package/lib/utilities/plugin.js +1 -1
- package/lib/utilities/properties.js +1 -1
- package/lib/utilities/rules.js +1 -1
- package/lib/utilities/scrollbarThickness.js +1 -1
- package/lib/utilities/tokens.js +1 -1
- package/lib/yapp.js +34 -96
- package/package.json +1 -1
- package/src/defaults.js +1 -1
- package/src/example/view.js +8 -28
- package/src/example/yapp.js +3 -2
- package/src/gutter.js +9 -41
- package/src/highlights.js +70 -0
- package/src/lineNumbers.js +13 -2
- package/src/prettyPrinter.js +24 -134
- package/src/richTextarea.js +4 -28
- package/src/styles.js +0 -1
- package/src/syntax.js +20 -22
- package/src/yapp.js +49 -130
- package/lib/element/scrollable.js +0 -338
- package/src/element/scrollable.js +0 -166
package/README.md
CHANGED
|
@@ -22,7 +22,9 @@ Yet Another Pretty Printer.
|
|
|
22
22
|
|
|
23
23
|
*If you are interested in contributing to Yapp, in particular in contributing to its grammars*, then see the contributions section below.
|
|
24
24
|
|
|
25
|
-
Yapp is an advanced pretty printer and text editor. It has a powerful lexer and parser under the hood, and can process content after parsing in order to refine its appearance still further. The result is an experience that rivals the best open source and commercial editors. Yapp is also fully configurable. You can style it overall or target specific syntaxes. Its plugin architecture additionally makes it easy to support any language.
|
|
25
|
+
Yapp is an advanced pretty printer and text editor. It has a powerful lexer and parser under the hood, and can process content after parsing in order to refine its appearance still further. The result is an experience that rivals the best open source and commercial editors. Yapp is also fully configurable. You can style it overall or target specific syntaxes. Its plugin architecture additionally makes it easy to support any language.
|
|
26
|
+
|
|
27
|
+
Yapp also supports [Fira Code](https://github.com/tonsky/FiraCode).
|
|
26
28
|
|
|
27
29
|
## Installation
|
|
28
30
|
|
|
@@ -161,9 +163,7 @@ When using JSX, the properties of the `options` parameter are in fact passed ind
|
|
|
161
163
|
If Yapp is made editable, the `contentChangeHandler(...)` callback should take the following form:
|
|
162
164
|
|
|
163
165
|
```
|
|
164
|
-
function contentChangeHandler(
|
|
165
|
-
const yapp = element, ///
|
|
166
|
-
content = yapp.getContent();
|
|
166
|
+
function contentChangeHandler(content) {
|
|
167
167
|
|
|
168
168
|
...
|
|
169
169
|
|
|
@@ -196,7 +196,7 @@ If you choose to enable Fira Code then you need to provide the necessary web fon
|
|
|
196
196
|
font-style: normal;
|
|
197
197
|
}
|
|
198
198
|
```
|
|
199
|
-
You do not have to provide this, rendering Yapp's styles will do so, but it is recommended that you check the network tab in your browser's developer tools to ensure that these files are being
|
|
199
|
+
You do not have to provide this, rendering Yapp's styles will do so, but it is recommended that you check the network tab in your browser's developer tools to ensure that these files are being served.
|
|
200
200
|
|
|
201
201
|
## Styling Yapp
|
|
202
202
|
|
|
@@ -214,7 +214,7 @@ Rendering the styles in this manner should always be done before any instance of
|
|
|
214
214
|
|
|
215
215
|
### Overall styles
|
|
216
216
|
|
|
217
|
-
A handful of overall CSS properties, mainly relating to
|
|
217
|
+
A handful of overall CSS properties, mainly relating to font colours, can be overridden directly. The most elegant way to do this is with programmatic styles. You can take the following approach, for example:
|
|
218
218
|
|
|
219
219
|
```
|
|
220
220
|
"use strict";
|
|
@@ -264,7 +264,7 @@ renderStyle(`
|
|
|
264
264
|
|
|
265
265
|
`);
|
|
266
266
|
```
|
|
267
|
-
All the HTML elements of which Yapp is comprised have placeholder classes
|
|
267
|
+
All the HTML elements of which Yapp is comprised have placeholder classes and can therefore be targeted in this way. To see these placeholder classes, simply have a look at an instance of Yapp in your browser's developer tools.
|
|
268
268
|
|
|
269
269
|
### Syntax styles
|
|
270
270
|
|