# gulp-cedr

> Gulp plugin for a cedr

Latest version **0.1.7** (published 2016-11-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install gulp-cedr
pnpm add gulp-cedr
yarn add gulp-cedr
bun add gulp-cedr
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.7 |
| Published | 2016-11-14 |
| First published | 2016-11-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | antitim |
| Maintainers | antitim |
| Keywords | cedr, html, bem, gulp |

## Links

- npm: https://www.npmjs.com/package/gulp-cedr
- Repository: https://github.com/antitim/gulp-cedr
- Homepage: https://github.com/antitim/gulp-cedr#readme
- Issues: https://github.com/antitim/gulp-cedr/issues
- npm.io page: https://npm.io/package/gulp-cedr

## Dependencies (3)

- [cedr](https://npm.io/package/cedr.md) ^0.1.3
- [through2](https://npm.io/package/through2.md) ^2.0.1
- [gulp-util](https://npm.io/package/gulp-util.md) ^3.0.7

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 0.1.7 (latest) — 2016-11-14
- 0.1.6 — 2016-11-11
- 0.1.5 — 2016-11-10
- 0.1.4 — 2016-11-09
- 0.1.3 — 2016-11-09
- 0.1.2 — 2016-11-08
- 0.1.1 — 2016-11-08
- 0.1.0 — 2016-11-08

## README

# gulp-cedr [![NPM version][npm-image]][npm-url] [![Dependency Status][daviddm-image]][daviddm-url]

> gulp-cedr - Gulp plugin for a cedr.


## Installation

```sh
$ npm install --save gulp-cedr
```

## Usage

More about [cedr](https://github.com/antitim/cedr).

More about [cedr-library](https://github.com/antitim/cedr-library).

More about [cedr-deps](https://github.com/antitim/cedr-deps).

```js
'use strict'

const cedrlibrary	= require('cedr-library');
const cedrDeps		= require('cedr-deps');
const cedr			= require('gulp-cedr');
const gulp 			= require('gulp');

let library = {},
	scripts = {},
	styles = {};

gulp.task('library', (callback) => {
	cedrlibrary(['libraries/antitim-lib/'], function(mergedLibrary) {
		library = mergedLibrary;
		let deps = cedrDeps(true, mergedLibrary);
		styles 	= deps.style;
		scripts = deps.script;

		callback(null);
	});
});

gulp.task('pages', ['library'], function() {
	return gulp.src('pages/*.js')
		.pipe(сedr({
			library: library
		}))
		.pipe(gulp.dest('./result/'));
});

gulp.task('css', ['library'], function() {
	return gulp.src(styles)
		.pipe(gulp.dest('./result/css/'))
});

gulp.task('js', ['library'], function() {
	return gulp.src(scripts)
		.pipe(gulp.dest('./result/js/'))
});

gulp.task('default', ['css', 'js', 'pages'], function() {
	console.log('Complete')
});

```

### include and extend

JS files containing pages run in one context while forming the html. 
On this basis, to use include or extend, you can use the following construction:

#### _helpers.js
```js
function layout(content_1) {
	return {
		block: 'page',
		content: [
			{ block: 'header' },
			content_1,
			{ block: 'footer' }
		]
	}
}

function menu() {
	return {
		block: 'menu',
		content: [
			{ 
				block: 'menu',
				element: 'item'
			}
		]
	}
}

```

#### page.js
```js
layout([
	{
		block: 'breadcrumbs'
	},
	menu()
	...
])
```

## Options

### library
Type: `Object`

The object of library.



## License

MIT © [antitim](http://vk.com/antitim)


[npm-image]: https://badge.fury.io/js/gulp-cedr.svg
[npm-url]: https://npmjs.org/package/gulp-cedr
[travis-image]: https://travis-ci.org/antitim/gulp-cedr.svg?branch=master
[travis-url]: https://travis-ci.org/antitim/gulp-cedr
[daviddm-image]: https://david-dm.org/antitim/gulp-cedr.svg?theme=shields.io
[daviddm-url]: https://david-dm.org/antitim/gulp-cedr

---
_Source: https://npm.io/package/gulp-cedr · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
