Skip to content
This repository was archived by the owner on Feb 4, 2018. It is now read-only.

Commit 6734ab3

Browse files
authored
Merge pull request #96 from bem-sdk/docs/constructor
Update docs
2 parents 33bed0f + 1003be1 commit 6734ab3

File tree

1 file changed

+34
-30
lines changed

1 file changed

+34
-30
lines changed

README.md

Lines changed: 34 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ BemEntityName
2020
[david]: https://david-dm.org/bem-sdk/bem-entity-name
2121
[dependency-img]: http://img.shields.io/david/bem-sdk/bem-entity-name.svg
2222

23+
Contents
24+
--------
25+
26+
* [Install](#install)
27+
* [Usage](#usage)
28+
* [API](#api)
29+
* [Debuggability](#debuggability)
30+
2331
Install
2432
-------
2533

@@ -46,8 +54,32 @@ entityName.isEqual(new BemEntityName({ block: 'button' })); // fal
4654
entityName.isEqual(new BemEntityName({ block: 'button', elem: 'text' })); // true
4755
```
4856

49-
BEM Entity Name
50-
---------------
57+
API
58+
---
59+
60+
* [constructor({ block, elem, mod })](#constructor-block-elem-mod-)
61+
* [block](#block)
62+
* [elem](#elem)
63+
* [mod](#mod)
64+
* [id](#id)
65+
* [type](#type)
66+
* [isSimpleMod()](#issimplemod)
67+
* [isEqual(entityName)](#isequalentityname)
68+
* [toString()](#tostring)
69+
* [valueOf()](#valueof)
70+
* [toJSON()](#tojson)
71+
* [#isBemEntityName(entityName)](#isbementitynameentityname)
72+
* [#create(object)](#createobject)
73+
74+
### constructor({ block, elem, mod })
75+
76+
Parameter | Type | Description
77+
----------|----------|------------------------------
78+
`block` | `string` | The block name of entity.
79+
`elem` | `string` | The element name of entity.
80+
`mod` | `string`, `object` | The modifier of entity.<br><br> If specified value is `string` then it will be equivalent to `{ name: string, val: true }`. Optional.
81+
`mod.name`| `string` | The modifier name of entity.
82+
`mod.val` | `string`, `true` | The modifier value of entity. Optional.
5183

5284
BEM entities can be defined with a help of JS object with the following fields:
5385

@@ -87,33 +119,6 @@ new BemEntityName({
87119
});
88120
```
89121

90-
API
91-
---
92-
93-
* [constructor({ block, elem, mod })](#constructor-block-elem-mod-)
94-
* [block](#block)
95-
* [elem](#elem)
96-
* [mod](#mod)
97-
* [id](#id)
98-
* [type](#type)
99-
* [isSimpleMod()](#issimplemod)
100-
* [isEqual(entityName)](#isequalentityname)
101-
* [toString()](#tostring)
102-
* [valueOf()](#valueof)
103-
* [toJSON()](#tojson)
104-
* [#isBemEntityName(entityName)](#isbementitynameentityname)
105-
* [#create(object)](#createobject)
106-
107-
### constructor({ block, elem, mod })
108-
109-
Parameter | Type | Description
110-
----------|----------|------------------------------
111-
`block` | `string` | The block name of entity.
112-
`elem` | `string` | The element name of entity.
113-
`mod` | `string`, `object` | The modifier of entity.<br><br> If specified value is `string` then it will be equivalent to `{ name: string, val: true }`. Optional.
114-
`mod.name`| `string` | The modifier name of entity.
115-
`mod.val` | `string`, `true` | The modifier value of entity. Optional.
116-
117122
### block
118123

119124
The name of block to which this entity belongs.
@@ -347,7 +352,6 @@ console.log(JSON.stringify(name));
347352
// ➜ {"block":"input","mod":{"name":"available","val":true}}
348353
```
349354

350-
351355
License
352356
-------
353357

0 commit comments

Comments
 (0)