A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/assemble/assemble-core below:

assemble/assemble-core: The core assemble application with no presets or defaults. All configuration is left to the implementor.

Built on top of base and templates, assemble-core is used in assemble to provide the baseline features and API necessary for rendering templates, working with the file system, and running tasks.

Implementors and hackers can use assemble-core to create rich and powerful build tooling, project scaffolding systems, documentation generators, or even your completely custom static site generators.

Table of contents - [What can I do with assemble-core?](#what-can-i-do-with-assemble-core) - [Install](#install) - [Install](#install-1) - [Usage](#usage) - [Examples](#examples) - [API](#api) * [File System API](#file-system-api) + [.src](#src) + [.dest](#dest) + [.copy](#copy) + [.symlink](#symlink) * [Task API](#task-api) + [.task](#task) + [.build](#build) + [.watch](#watch) - [FAQ](#faq) - [Toolkit suite](#toolkit-suite) - [About](#about) * [Related projects](#related-projects) * [Tests](#tests) * [Contributing](#contributing) * [Release History](#release-history) * [Authors](#authors) * [License](#license)

(TOC generated by verb using markdown-toc)

What can I do with assemble-core?

Create your own:

NPM

Install with npm:

$ npm install --save assemble-core

yarn

Install with yarn:

$ yarn add assemble-core && yarn upgrade
var assemble = require('assemble-core');
var app = assemble();

view collections

Create a custom view collection:

var app = assemble();
app.create('pages');

Now you can add pages with app.page() or app.pages():

app.page('home.hbs', {content: 'this is the home page!'});

render

Render a view:

var app = assemble();

var view = app.view('foo', {content: 'Hi, my name is <%= name %>'});

app.render(view, { name: 'Brian' }, function(err, res) {
  console.log(res.content);
  //=> 'Hi, my name is Brian'
});

Render a view from a collection:

var app = assemble();
app.create('pages');

app.page('foo', {content: 'Hi, my name is <%= name %>'})
  .set('data.name', 'Brian')
  .render(function (err, res) {
    console.log(res.content);
    //=> 'Hi, my name is Brian'
  });

Create an assemble application. This is the main function exported by the assemble module.

Params

Example

var assemble = require('assemble');
var app = assemble();

Assemble has the following methods for working with the file system:

Assemble v0.6.0 has full vinyl-fs support, so any gulp plugin should work with assemble.

Use one or more glob patterns or filepaths to specify source files.

Params

Example

app.src('src/*.hbs', {layout: 'default'});

Specify the destination to use for processed files.

Params

Example

Copy files from A to B, where A is any pattern that would be valid in app.src and B is the destination directory.

Params

Example

app.copy('assets/**', 'dist/');

Glob patterns or paths for symlinks.

Params

Example

Assemble has the following methods for running tasks and controlling workflows:

Define a task. Tasks are functions that are stored on a tasks object, allowing them to be called later by the build method. (the CLI calls build to run tasks)

Params

Example

app.task('default', function() {
  return app.src('templates/*.hbs')
    .pipe(app.dest('dist/'));
});

Run one or more tasks.

Params

Example

app.build(['foo', 'bar'], function(err) {
  if (err) console.error('ERROR:', err);
});

Watch files, run one or more tasks when a watched file changes.

Params

Example

app.task('watch', function() {
  app.watch('docs/*.md', ['docs']);
});

How does assemble-core differ from assemble?

feature assemble-core assemble notes front-matter parsing No Yes use assemble or use parser-front-matter as an .onLoad middleware. CLI No Yes Create your own CLI experience, or use assemble Built-in template collections No Yes Use .create() to add collections Built-in template engine No Yes assemble ships with engine-handlebars. Use .engine() to register any consolidate-compatible template engine.

assemble-core is a standalone application that was created using applications and plugins from the toolkit suite:

Building blocks

Plugins

Assemble is built on top of these great projects:

Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:

$ npm install && npm test

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Please read the contributing guide for advice on opening issues, pull requests, and coding standards.

If Assemble doesn't do what you need, please let us know.

Changelog entries are classified using the following labels from keep-a-changelog:

Custom labels used in this changelog:

Heads up!

Please let us know if any of the following heading links are broken. Thanks!

dependencies

dependencies

dependencies

dependencies

dependencies

dependencies

changed

dependencies

removed

fixed

dependencies

fixed

changed

dependencies

removed

dependencies

changed

dependencies

housekeeping

dependencies

dependencies

dependencies

dependencies

dependencies

deprecated

changed

added

(Changelog generated by helper-changelog)

Jon Schlinkert

Brian Woodward

Copyright © 2017, Jon Schlinkert. MIT

This file was generated by verb-generate-readme, v0.4.2, on February 11, 2017.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4