Skip to content

Commit 9b446d1

Browse files
committed
doctoc
1 parent b5d98db commit 9b446d1

File tree

2 files changed

+71
-43
lines changed

2 files changed

+71
-43
lines changed

README.md

Lines changed: 69 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,37 @@ Render-js keeps specificity extremely low by generating tachyons (single purpose
1010

1111
The programmer simply defines what css properties an HTML element should have. You can even define media queries for responsive styling.
1212

13+
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
14+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
15+
## Contents
16+
17+
- [Genesis](#genesis)
18+
- [Generation 1: HTML](#generation-1-html)
19+
- [Core concepts (syntax)](#core-concepts-syntax)
20+
- [HTML element functions](#html-element-functions)
21+
- [HTML attribute object](#html-attribute-object)
22+
- [Style attribute object](#style-attribute-object)
23+
- [HTML: Examples:](#html-examples)
24+
- [HTML: ECMAscript 2015 example](#html-ecmascript-2015-example)
25+
- [HTML: Javascript 1.6 example](#html-javascript-16-example)
26+
- [HTML: Result](#html-result)
27+
- [Generation 2: NCSS](#generation-2-ncss)
28+
- [Generation 3: DOM](#generation-3-dom)
29+
- [DOM: ECMAscript 2015 example](#dom-ecmascript-2015-example)
30+
- [Generation 4: OBJ](#generation-4-obj)
31+
- [Generation 5: CLASS (current generation)](#generation-5-class-current-generation)
32+
- [Examples](#examples)
33+
- [How to include in Enonic XP app (does not apply to Node.js)](#how-to-include-in-enonic-xp-app-does-not-apply-to-nodejs)
34+
- [HTML: How to use it in Javascript 1.6 (Enonic XP 6.12.2)](#html-how-to-use-it-in-javascript-16-enonic-xp-6122)
35+
- [HTML: How to use it in ECMAscript 2015 (Node.js, Enonic XP 7)](#html-how-to-use-it-in-ecmascript-2015-nodejs-enonic-xp-7)
36+
- [Vision / goal](#vision--goal)
37+
- [New IDEA: Non Cascading Scaleable Styling](#new-idea-non-cascading-scaleable-styling)
38+
- [Definition](#definition)
39+
- [Compatibility](#compatibility)
40+
- [Changelog](#changelog)
41+
42+
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
43+
1344
## Genesis
1445

1546
I started programming Render-js as an alternative to thymeleaf, but it quickly grew into much more. Everytime I got a major idea I developed it as a new variant without changing the previous one:
@@ -62,7 +93,7 @@ p({
6293
]);
6394
```
6495

65-
### HTML attribute object
96+
#### HTML attribute object
6697

6798
An html attribute looks like this (EBNF):
6899
```ebnf
@@ -90,7 +121,7 @@ data-prop="value"
90121

91122
I have found an exception: The SVG attribute named viewBox. It is case-sensitive. So I simply don't dasherize that one. Make an issue on github if you run into any other case-sensitive HTML/SVG attributes.
92123

93-
### Style attribute object
124+
#### Style attribute object
94125

95126
An html style attribute consists of is a semicolon seperated key value pair list. (EBNF):
96127

@@ -120,15 +151,16 @@ CSS property names contains dashes, which JS property names also can, but needs
120151
style="color:white;background-color:black"
121152
```
122153

154+
### HTML: Examples:
123155

124-
###### HTML: ECMAscript 2015 example
156+
#### HTML: ECMAscript 2015 example
125157

126158
```js
127159
import {p, render} from 'render-js/html.es';
128160
render(p({style: {backgroundColor: 'white'}}, 'Hello world'));
129161
```
130162

131-
###### HTML: Javascript 1.6 example
163+
#### HTML: Javascript 1.6 example
132164

133165
```js
134166
var R = require('render-js/dist/html.js');
@@ -137,7 +169,7 @@ var p = R.p;
137169
render(p({style: {backgroundColor: 'white'}}, 'Hello world'));
138170
```
139171

140-
###### HTML: Result
172+
#### HTML: Result
141173
```html
142174
<p style="background-color:white">Hello world</p>
143175
```
@@ -153,7 +185,7 @@ This is when I figured out accessing and modify the dom could be useful.
153185

154186
All the features of this generation should be present in the newest generation, so you should probably use that instead.
155187

156-
###### DOM: ECMAscript 2015 example
188+
#### DOM: ECMAscript 2015 example
157189

158190
```js
159191
import { Dom, doctype, html, head, title, style,
@@ -254,15 +286,14 @@ This is when I started thinking about keeping the Dom object as small as possibl
254286
## Examples
255287

256288

257-
258289
### How to include in Enonic XP app (does not apply to Node.js)
259290
```groovy
260291
dependencies {
261292
include 'com.enonic.lib:render-js:1.20.0'
262293
}
263294
```
264295

265-
###### HTML: How to use it in Javascript 1.6 (Enonic XP 6.12.2)
296+
### HTML: How to use it in Javascript 1.6 (Enonic XP 6.12.2)
266297

267298
```js
268299
var R = require('/lib/render-js/index.js');
@@ -285,7 +316,7 @@ exports.get = function(request) {
285316
} // exports.get
286317
```
287318

288-
###### HTML: How to use it in ECMAscript 2015 (Node.js, Enonic XP 7)
319+
### HTML: How to use it in ECMAscript 2015 (Node.js, Enonic XP 7)
289320

290321
```js
291322
import R, { render, doctype, html, head, title, body, main, h1, form } from 'render-js';
@@ -364,137 +395,132 @@ In terms of extendability, returning an object with named properties should be t
364395

365396
## Changelog
366397

367-
### 1.20.1-SNAPSHOT
398+
##### 1.20.1-SNAPSHOT
368399

369400
* Documentation improvements
370401

371-
### 1.20.0
402+
##### 1.20.0
372403

373404
* Class FEATURE: addClass()
374405
* Class FEATURE: Chainable setters
375406
* Class BUG: domPath() must be external since clone doesn't rebuild self-references.
376407
* Class BUG: setAttribute() failed when no previous attributes
377408

378-
### 1.19.1
409+
##### 1.19.1
379410

380411
* Deepmerge is a runtime dependancy.
381412

382-
### 1.19.0
413+
##### 1.19.0
383414

384415
* Class syntax (semantic, path, style, build, clone, content, render)
385416
* Remove useless space in html style attribute after property colon.
386417
* BUG: src/obj.es and src/svg.es wasn't transpiled in gradle.build.
387418

388-
### 1.18.0
419+
##### 1.18.0
389420

390421
* SVG elements
391422
* Handle SVG´s case sensitive viewBox attribute
392423

393-
### 1.17.1
424+
##### 1.17.1
394425

395426
* Recursive modifyStyleAndMediaToClassAndCss()
396427

397-
### 1.17.0
428+
##### 1.17.0
398429

399430
* modifyStyleAndMediaToClassAndCss()
400431

401-
### 1.16.0
432+
##### 1.16.0
402433

403434
* Function to object syntax.
404435

405-
### 1.15.0
436+
##### 1.15.0
406437

407438
* Obj
408439

409-
### 1.14.0
440+
##### 1.14.0
410441

411442
* cdata function (https://www.w3.org/TR/REC-xml/#dt-chardata)
412443

413-
### 1.13.0
444+
##### 1.13.0
414445

415446
* Default units in style attribute when using index.es
416447
* Deprecated objectToCssDeclarations in favour of objToStyleAttr
417448
* Profiling led to sortedUniqStr
418449

419-
### 1.12.1
450+
##### 1.12.1
420451

421452
* Fix #9 Css order
422453

423-
### 1.12.0
454+
##### 1.12.0
424455

425456
* Limited support for nested selectors (&:hover div)
426457
* Apply default units to css property values using jss-default-unit.
427458

428-
### 1.11.0
459+
##### 1.11.0
429460

430461
* You can now pass a function as content. Or an array of functions++.
431462

432-
### 1.10.0
463+
##### 1.10.0
433464

434465
* html, head and body accessible as property on any node
435466

436-
### 1.9.0
467+
##### 1.9.0
437468

438469
* Parent and root
439470

440-
### 1.8.0
471+
##### 1.8.0
441472

442473
* Path -- Makes it possible to access and manipulate the DOM.
443474
* Node.add() -- Makes it possible to manipulate the DOM.
444475

445-
### 1.7.0
476+
##### 1.7.0
446477

447478
* Nested pseudo styling
448479
* Comment out autoprefixer as it introduced many problems.
449480

450-
### 1.6.0
481+
##### 1.6.0
451482

452483
* Autoprefixer
453484

454-
### 1.5.0
485+
##### 1.5.0
455486

456487
* Generate CSS from style too, so !important can be avoided.
457488
* Some Dom fixes
458489

459-
### 1.4.0
490+
##### 1.4.0
460491

461492
* Dom
462493

463-
### 1.3.0
494+
##### 1.3.0
464495

465496
* Non Cascading Scaleable Styling
466497

467-
### 1.2.0
498+
##### 1.2.0
468499

469500
* Dasherize attribute names.
470501

471-
### 1.1.0
502+
##### 1.1.0
472503

473504
* Style attribute from object. Keep property order. Dasherize property keys.
474505

475-
### 1.0.0
506+
##### 1.0.0
476507

477508
* Javascript 1.6 Example
478509

479-
### 0.0.4
510+
##### 0.0.4
480511

481512
* Input types.
482513
* Icon.
483514
* Use as Enonic XP lib too.
484515

485-
### 0.0.3
516+
##### 0.0.3
486517

487518
* Void elements.
488519

489-
### 0.0.2
520+
##### 0.0.2
490521

491522
* Handle javascript types in attribute values.
492523

493-
### 0.0.1
524+
##### 0.0.1
494525

495526
* Basic functionality. KISS!
496-
497-
## Ideas
498-
499-
* Implement indentation?
500-
* Implement minifying?

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"babel-preset-es2015": "^6.24.1",
1919
"babel-preset-stage-0": "^6.24.1",
2020
"convert-hrtime": "^2.0.0",
21+
"doctoc": "^1.3.1",
2122
"eslint": "^4.13.1",
2223
"eslint-config-airbnb": "^16.1.0",
2324
"eslint-plugin-import": "^2.8.0",
@@ -44,6 +45,7 @@
4445
"url": "git+https://github.com/comlock/render-js"
4546
},
4647
"scripts": {
48+
"doctoc": "doctoc --github --maxlevel 4 README.md",
4749
"eslint": "node_modules/.bin/eslint",
4850
"mocha": "node_modules/.bin/mocha -c --require babel-core/register",
4951
"test": "npm run mocha -- test/*.es* test/*/*.es*"

0 commit comments

Comments
 (0)