-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add documentation about notation #10
Conversation
resolves: #4
README.md
Outdated
Parse your `import 'b:button2'`, yo! | ||
Extract [bem-entities](https://en.bem.info/methodology/key-concepts/#bem-entity) from bem-import strings. | ||
|
||
Install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Installation
README.md
Outdated
// { block : 'button', mod : { name: 'theme', val : 'action' } } ] | ||
``` | ||
|
||
ToC: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Может быть лучше унести это в начало?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
И как отдельный раздел
README.md
Outdated
|
||
parse('b:button e:text') // [ { block : 'button', elem : 'text' } ] | ||
|
||
parse('b:button m:theme=normal|action') // [ { block : 'button' }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Я бы скинул на следующую строку и добавил →
после //
README.md
Outdated
This section describes all possible syntax of bem-import strings. | ||
Examples are provided in es6 syntax. Note that [parse](#api) function only works with strings. | ||
|
||
Order of fields is important: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but why? Need to explain that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because of implementation ¯_(ツ)_/¯
README.md
Outdated
|
||
```js | ||
import 'b:button'; | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd add a list of paths. Something like:
// → .../button/button.*
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
оно не раскрывается в пути, не думаю что нужно здесь это писать
README.md
Outdated
``` | ||
|
||
#### block with several modifiers | ||
```js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
То есть пробел после заголовка, то нет
README.md
Outdated
|
||
#### block with several modifiers | ||
```js | ||
import 'b:button e:text m:theme=active m:size=m'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Это раскрывается в:
// → .../button/button.*
// → .../button/__text/button__text.*
// → .../button/__text/_theme/button__text_theme.*
// → .../button/__text/_theme/button__text_theme_active.*
// → .../button/__text/_size/button__text_size.*
// → .../button/__text/_size/button__text_size_m.*
?
Если нет, то
- почему важен порядок?
- как подключить элемент другого блока с модификаторами?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Порядок важен из-за реализации
b:button e:text
вернет тебе только элемент
не понял насчет элемента другого блока
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Например, в select2__item
мы зовем 'b:menu e:item'
(или около того).
Я забыл, что b:button e:text
это не про блок. Вопрос снимается, невалидный.
Про реализацию всё еще не понятно как это может зависеть. Можно в первых проход найти все b:, потом e:, потом остальное.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
но мы делаем не так =) можешь посмотреть в код, там есть зависимость от того что пришло первое и если напишешь
t:css m:val b:button
всё взорвётся, думаешь есть смысл это поддерживать?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
У нас же декларативное все, а здесь нет, это странно. Лучше явно проверять, что блок/элемент должен быть и только один. Там и ошибка пади непонятная сейчас
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Пофиксим вот здесь: #12
ты предлагаешь сейчас не писать про важность последовательности?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Да, потому что оно ничем не обусловлено (кроме странной реализации)
README.md
Outdated
|
||
Technology is abstraction for extension on file system. | ||
|
||
To extract bem-entities with special technology specify field `t:`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specify field... to extract...
README.md
Outdated
|
||
### technology | ||
|
||
Technology is abstraction for extension on file system. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is an abstraction
Здесь лучше дать ссылку на key-concepts, там всё уже расписано.
README.md
Outdated
License | ||
------- | ||
|
||
Code and documentation copyright 2014 YANDEX LLC. Code released under the [Mozilla Public License 2.0](LICENSE.txt). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2014?
наверное, 2016–2017
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Скопируй из bem-react-core
resolves: #4