Permalink
Browse files

Merge branch 'master' into bem-www

  • Loading branch information...
2 parents e661144 + a9df6d4 commit 96ad1722a09ab5cb1a95118cd21ea947f22479f8 @arikon arikon committed Oct 9, 2012
Showing with 12,644 additions and 4,218 deletions.
  1. +1 −1 .travis.yml
  2. +8 −8 README.md
  3. +9 −9 README.ru.md
  4. +5 −0 docs/.bem/level.js
  5. +19 −0 docs/.bem/techs/md.js
  6. +288 −0 docs/api/api.en.md
  7. +288 −0 docs/api/api.ru.md
  8. +50 −0 docs/bem-build/bem-build.en.md
  9. +51 −0 docs/bem-build/bem-build.ru.md
  10. +123 −0 docs/bem-create/bem-create.en.md
  11. +126 −0 docs/bem-create/bem-create.ru.md
  12. +36 −0 docs/bem-decl/bem-decl.en.md
  13. +37 −0 docs/bem-decl/bem-decl.ru.md
  14. +15 −0 docs/bem-make/bem-make.en.md
  15. +15 −0 docs/bem-make/bem-make.ru.md
  16. +16 −0 docs/bem-server/bem-server.en.md
  17. +12 −0 docs/bem-server/bem-server.ru.md
  18. +15 −0 docs/contribute/contribute.en.md
  19. +15 −0 docs/contribute/contribute.ru.md
  20. +409 −0 docs/customization/customization.en.md
  21. +440 −0 docs/customization/customization.ru.md
  22. +62 −0 docs/installation/installation.en.md
  23. +59 −0 docs/installation/installation.ru.md
  24. +105 −0 docs/levels/levels.en.md
  25. +109 −0 docs/levels/levels.ru.md
  26. +102 −0 docs/tech-modules/tech-modules.en.md
  27. +103 −0 docs/tech-modules/tech-modules.ru.md
  28. +1 −0 package.json
  29. +6 −0 scripts/postinst.js
  30. +1 −1 test/data/make/project/bem-bl
  31. +1 −0 test/data/make/project/pages/.bem/level.js
  32. +1,305 −0 test/data/make/reference-result/pages/client/__profile/_client__profile.bemhtml.js
  33. +529 −459 test/data/make/reference-result/pages/client/__profile/_client__profile.en.js
  34. +529 −459 test/data/make/reference-result/pages/client/__profile/_client__profile.js
  35. +529 −459 test/data/make/reference-result/pages/client/__profile/_client__profile.ru.js
  36. +10 −6 test/data/make/reference-result/pages/client/__profile/client__profile.bemhtml.js
  37. +1 −0 test/data/make/reference-result/pages/client/__profile/client__profile.js
  38. +1,980 −0 test/data/make/reference-result/pages/client/_client.bemhtml.js
  39. +529 −459 test/data/make/reference-result/pages/client/_client.en.js
  40. +529 −459 test/data/make/reference-result/pages/client/_client.js
  41. +529 −459 test/data/make/reference-result/pages/client/_client.ru.js
  42. +39 −31 test/data/make/reference-result/pages/client/client.bemhtml.js
  43. +1 −0 test/data/make/reference-result/pages/client/client.js
  44. +1,980 −0 test/data/make/reference-result/pages/example/_example.bemhtml.js
  45. +529 −459 test/data/make/reference-result/pages/example/_example.en.js
  46. +529 −459 test/data/make/reference-result/pages/example/_example.js
  47. +529 −459 test/data/make/reference-result/pages/example/_example.ru.js
  48. +39 −31 test/data/make/reference-result/pages/example/example.bemhtml.js
  49. +1 −0 test/data/make/reference-result/pages/example/example.js
View
@@ -9,4 +9,4 @@ matrix:
allow_failures:
- node_js: 0.9
-before_script: "ln -s .. node_modules/bem && ls -la node_modules && git submodule init && git submodule update"
+before_script: "git submodule init && git submodule update"
View
@@ -324,7 +324,7 @@ exports.getTechs = function() {
return {
'bemjson.js': '',
'js': 'js-i',
- 'bemhtml.js': '../../bem-bl/blocks-common/i-bem/bem/techs/bemhtml.js',
+ 'bemhtml': '../../bem-bl/blocks-common/i-bem/bem/techs/bemhtml.js',
'priv.js': '../../.bem/techs/priv.js',
'html': '../../bem-bl/blocks-common/i-bem/bem/techs/html'
};
@@ -345,7 +345,7 @@ exports.getConfig = function() {
};
```
-`getTechs()` returns an object with used techs. Object properties (for example `'bemjson.js'`, `'js'`, `'bemhtml.js'`) define the
+`getTechs()` returns an object with used techs. Object properties (for example `'bemjson.js'`, `'js'`, `'bemhtml'`) define the
tech names, object values specify the paths to the appropriate tech files (`''`, `'js-i'`, `'../../bem-bl/blocks-common/i-bem/bem/techs/bemhtml.js'`).
A path can be relative or absolute, it can be empty, or it can specify just a file name. When the latter case is used the
tech will be considered being standard (bundled with bem-tools) and the file will be looked up in the `[bem]/lib/techs` folder.
@@ -398,7 +398,7 @@ exports.getTechs = function() {
'deps.js': 'deps.js',
'js': 'js-i',
'css': 'css',
- 'bemhtml.js': '../../bem-bl/blocks-common/i-bem/bem/techs/bemhtml.js',
+ 'bemhtml': '../../bem-bl/blocks-common/i-bem/bem/techs/bemhtml.js',
'html': '../../bem-bl/blocks-common/i-bem/bem/techs/html.js'
};
@@ -444,7 +444,7 @@ MAKE.decl('BundleNode', {
'bemjson.js',
'bemdecl.js',
'deps.js',
- 'bemhtml.js',
+ 'bemhtml',
'css',
'js',
'html'
@@ -468,7 +468,7 @@ exports.getTechs = function() {
'deps.js': 'deps.js',
'js': 'js-i',
'css': 'css',
- 'bemhtml.js': '../../bem-bl/blocks-common/i-bem/bem/techs/bemhtml.js'
+ 'bemhtml': '../../bem-bl/blocks-common/i-bem/bem/techs/bemhtml.js'
};
};
@@ -512,7 +512,7 @@ MAKE.decl('BundleNode', {
return [
'bemdecl.js',
'deps.js',
- 'bemhtml.js',
+ 'bemhtml',
'css',
'js'
];
@@ -653,7 +653,7 @@ MAKE.decl('BundleNode', {
return [
'bemdecl.js',
'deps.js',
- 'bemhtml.js',
+ 'bemhtml',
'css',
'js',
'priv.js'
@@ -731,7 +731,7 @@ A level should have `.bem/level.js` configuration file which contains the meta i
When the `bem create level` command is used to create a level the empty `.bem/level.js` file will be also created.
Which means that this level is «standard» one. The logic for standard level is defined in the `Level` class within
-(lib/level.js)[https://github.com/bem/bem-tools/blob/master/lib/level.js].
+[lib/level.js](https://github.com/bem/bem-tools/blob/master/lib/level.js).
As the `.bem/level.js` file is a CommonJS module it's easy to override the level's behavior. `bem-tools` creates a new
class inherited from the standard `Level` class using export of this module as a class extention (under the hood the
View
@@ -64,7 +64,7 @@
### Консольные команды
#### bem create
помошью `bem create` можно создавать сущности:
помощью `bem create` можно создавать сущности:
* уровни переопределения
* блоки
@@ -321,7 +321,7 @@ exports.getTechs = function() {
return {
'bemjson.js': '',
'js': 'js-i',
- 'bemhtml.js': '../../bem-bl/blocks-common/i-bem/bem/techs/bemhtml.js',
+ 'bemhtml': '../../bem-bl/blocks-common/i-bem/bem/techs/bemhtml.js',
'priv.js': '../../.bem/techs/priv.js',
'html': '../../bem-bl/blocks-common/i-bem/bem/techs/html'
};
@@ -342,7 +342,7 @@ exports.getConfig = function() {
};
```
-`getTechs()` возвращает массив подключаемых технологий: ключ (например `'bemjson.js'`, `'js'`, `'bemhtml.js'`) указывает
+`getTechs()` возвращает массив подключаемых технологий: ключ (например `'bemjson.js'`, `'js'`, `'bemhtml'`) указывает
имя, под котором технологию можно будет использовать, значение (`''`, `'js-i'`, `'../../bem-bl/blocks-common/i-bem/bem/techs/bemhtml.js'`) -
где взять сам файл технологии. В качестве этого значения может быть указан абсолютный или относительный путь к файлу,
пустая строка или просто имя файла. В последнем случае подразумевается, что технология стандартная (входит в состав
@@ -394,7 +394,7 @@ exports.getTechs = function() {
'deps.js': 'deps.js',
'js': 'js-i',
'css': 'css',
- 'bemhtml.js': '../../bem-bl/blocks-common/i-bem/bem/techs/bemhtml.js',
+ 'bemhtml': '../../bem-bl/blocks-common/i-bem/bem/techs/bemhtml.js',
'html': '../../bem-bl/blocks-common/i-bem/bem/techs/html.js'
};
@@ -440,7 +440,7 @@ MAKE.decl('BundleNode', {
'bemjson.js',
'bemdecl.js',
'deps.js',
- 'bemhtml.js',
+ 'bemhtml',
'css',
'js',
'html'
@@ -464,7 +464,7 @@ exports.getTechs = function() {
'deps.js': 'deps.js',
'js': 'js-i',
'css': 'css',
- 'bemhtml.js': '../../bem-bl/blocks-common/i-bem/bem/techs/bemhtml.js'
+ 'bemhtml': '../../bem-bl/blocks-common/i-bem/bem/techs/bemhtml.js'
};
};
@@ -508,7 +508,7 @@ MAKE.decl('BundleNode', {
return [
'bemdecl.js',
'deps.js',
- 'bemhtml.js',
+ 'bemhtml',
'css',
'js'
];
@@ -657,7 +657,7 @@ MAKE.decl('BundleNode', {
return [
'bemdecl.js',
'deps.js',
- 'bemhtml.js',
+ 'bemhtml',
'css',
'js',
'priv.js'
@@ -762,7 +762,7 @@ process.env.YENV = 'production';
При создании уровня командой `bem create level` файл `.bem/level.js` создаётся пустым, что означает, что уровень —
«стандартный». Поведение стандартного уровня описано в классе `Level` в файле
-(lib/level.js)[https://github.com/bem/bem-tools/blob/master/lib/level.js].
+[lib/level.js](https://github.com/bem/bem-tools/blob/master/lib/level.js).
Перекрыть поведение уроня просто. Файл `.bem/level.js` (как и практически любой файл конфигурации) является CommonJS
модулем. `bem-tools` при обнаружении такого файла создаёт класс-наследник стандартного класса `Level`, используя экспорт
View
@@ -0,0 +1,5 @@
+exports.getTechs = function() {
+ return {
+ 'md': require.resolve('./techs/md.js')
+ };
+};
View
@@ -0,0 +1,19 @@
+var DEFAULT_LANGS = ['ru', 'en'];
+
+exports.techMixin = {
+
+ getLangs: function() {
+ var env = process.env.BEM_I18N_LANGS;
+ return env? env.split(' ') : [].concat(DEFAULT_LANGS);
+ },
+
+ getSuffixes: function() {
+
+ return this.getLangs()
+ .map(function(lang) {
+ return lang + '.md';
+ });
+
+ }
+
+};
Oops, something went wrong.

0 comments on commit 96ad172

Please sign in to comment.