Giter Club home page Giter Club logo

blacksmith's Introduction

Framework components for node.js and the browser

Example HTTP Server:

var flatiron = require('flatiron'),
    app = flatiron.app;

app.use(flatiron.plugins.http);

app.router.get('/', function () {
  this.res.writeHead(200, { 'Content-Type': 'text/plain' });
  this.res.end('Hello world!\n');
});

app.start(8080);

Example HTTPS Server:

var flatiron = require('flatiron'),
    app = flatiron.app;

app.use(flatiron.plugins.http, {
  https: {
    cert: 'path/to/cert.pem',
    key: 'path/to/key.pem',
    ca: 'path/to/ca.pem'
  }
});

app.router.get('/', function () {
  this.res.writeHead(200, { 'Content-Type': 'text/plain' });
  this.res.end('Hello world!\n');
});

app.start(8080);

Example CLI Application:

// example.js

var flatiron = require('flatiron'),
    app = flatiron.app;

app.use(flatiron.plugins.cli, {
  dir: __dirname,
  usage: [
    'This is a basic flatiron cli application example!',
    '',
    'hello - say hello to somebody.'
  ]
});

app.cmd('hello', function () {
  app.prompt.get('name', function (err, result) {
    app.log.info('hello '+result.name+'!');
  })
})

app.start();

Run It:

% node example.js hello
prompt: name: world
info:   hello world!

Installation

Installing NPM (Node Package Manager)

  curl http://npmjs.org/install.sh | sh

Installing Flatiron

  [sudo] npm install flatiron

Installing Union (Required for flatiron.plugins.http)

  npm install union

Usage:

Start With flatiron.app:

flatiron.app is a broadway injection container. To be brief, what it does is allow plugins to modify the app object directly:

var flatiron = require('flatiron'),
    app = flatiron.app;

var hello = {
  attach: function (options) {
    this.hello = options.message || 'Why hello!';
  }
};

app.use(hello, {
  message: "Hi! How are you?"
});

// Will print, "Hi! How are you?"
console.log(app.hello);

Virtually all additional functionality in flatiron comes from broadway plugins, such as flatiron.plugins.http and flatiron.plugins.cli.

app.config

flatiron.app comes with a config plugin pre-loaded, which adds configuration management courtesy nconf. app.config has the same api as the nconf object.

The literal store is configured by default. If you want to use different stores you can easily attach them to the app.config instance.

// add the `env` store to the config
app.config.use('env');

// add the `file` store the the config
app.config.use('file', { file: 'path/to/config.json' });

// or using an alternate syntax
app.config.env().file({ file: 'path/to/config.json' });

// and removing stores
app.config.remove('literal');

app.log

flatiron.app will also load a log plugin during the init phase, which attaches a winston container to app.log. This logger is configured by combining the app.options.log property with the configuration retrieved from app.config.get('log').

Create An HTTP Server with flatiron.plugins.http(options):

This plugin adds http serving functionality to your flatiron app by attaching the following properties and methods:

Define Routes with app.router:

This is a director router configured to route http requests after the middlewares in app.http.before are applied. Example routes include:

// GET /
app.router.get('/', function () {
  this.res.writeHead(200, { 'Content-Type': 'text/plain' });
  this.res.end('Hello world!\n');
});

// POST to /
app.router.post('/', function () {
  this.res.writeHead(200, { 'Content-Type': 'text/plain' });
  this.res.write('Hey, you posted some cool data!\n');
  this.res.end(util.inspect(this.req.body, true, 2, true) + '\n');
});

// Parameterized routes
app.router.get('/sandwich/:type', function (type) {
  if (~['bacon', 'burger'].indexOf(type)) {
    this.res.writeHead(200, { 'Content-Type': 'text/plain' });
    this.res.end('Serving ' + type + ' sandwich!\n');
  }
  else {
    this.res.writeHead(404, { 'Content-Type': 'text/plain' });
    this.res.end('No such sandwich, sorry!\n');
  }
});

app.router can also route against regular expressions and more! To learn more about director's advanced functionality, visit director's project page.

Access The Server with app.server:

This is a union middleware kernel.

Modify the Server Options with app.http:

This object contains options that are passed to the union server, including app.http.before, app.http.after and app.http.headers.

These properties may be set by passing them through as options:

app.use(flatiron.plugins.http, {
  before: [],
  after: []
});

You can read more about these options on the union project page.

Start The Server with app.start(port, <host>, <callback(err)>)

This method will both call app.init (which will call any asynchronous initialization steps on loaded plugins) and start the http server with the given arguments. For example, the following will start your flatiron http server on port 8080:

app.start(8080);

Create a CLI Application with flatiron.plugins.cli(options)

This plugin turns your app into a cli application framework. For example, [jitsu] (https://github.com/nodejitsu/jitsu) uses flatiron and the cli plugin.

Valid options include:

{
  "argvOptions": {}, // A configuration hash passed to the cli argv parser.
  "usage": [ "foo", "bar" ], // A message to show for cli usage. Joins arrays with `\n`.
  "dir": require('path').join(__dirname, 'lib', 'commands'), // A directory with commands to lazy-load
  "notFoundUsage": false // Disable help messages when command not found
}

Add lazy-loaded CLI commands with options.dir and app.commands:

Flatiron CLI will automatically lazy-load modules defining commands in the directory specified by options.dir. For example:

// example2.js
var path = require('path'),
    flatiron = require('./lib/flatiron'),
    app = flatiron.app;

app.use(flatiron.plugins.cli, {
  dir: path.join(__dirname, 'cmds')
});

app.start();
// cmd/highfive.js
var highfive = module.exports = function highfive (person, cb) {
  this.log.info('High five to ' + person + '!');
  cb(null);
};

In the command, you expose a function of arguments and a callback. this is set to app, and the routing is taken care of automatically.

Here it is in action:

% node example2.js highfive Flatiron 
info:   High five to Flatiron!

You can also define these commands by adding them directly to app.commands yourself:

// example2b.js
var flatiron = require('./lib/flatiron'),
    app = flatiron.app;

var path = require('path'),
    flatiron = require('./lib/flatiron'),
    app = flatiron.app;

app.use(flatiron.plugins.cli);

app.commands.highfive = function (person, cb) {
  this.log.info('High five to ' + person + '!');
  cb(null);
};

app.start();
% node example2b.js highfive Flatiron 
info:   High five to Flatiron!

Callback will always be the last argument provided to a function assigned to command

app.commands.highfive = function (person, cb) {
  this.log.info('High five to ' + person + '!');
  console.log(arguments);
}
% node example2b.js highfive Flatiron lol haha
info:    High five to Flatiron!
{
  '0': 'Flatiron',
  '1': 'lol',
  '2': 'haha',
  '3': [Function]
}

Define Ad-Hoc Commands With app.cmd(path, handler):

This adds the cli routing path path to the app's CLI router, using the director route handler handler, aliasing app.router.on. cmd routes are defined the same way as http routes, except that it uses (a space) for a delimiter instead of /.

For example:

// example.js
var flatiron = require('./lib/flatiron'),
    app = flatiron.app;

app.use(flatiron.plugins.cli, {
  usage: [
    'usage: node test.js hello <person>',
    '',
    '  This will print "hello <person>"'
  ]
});

app.cmd('hello :person', function (person) {
  app.log.info('hello ' + person + '!');
});

app.start()

When you run this program correctly, it will say hello:

% node example.js hello person
info:   hello person!

If not, you get a friendly usage message:

% node test.js hello
help:   usage: node test.js hello <person>
help:
help:     This will print "hello <person>"

Check CLI Arguments with app.argv:

Once your app is started, app.argv will contain the optimist-parsed argv options hash, ready to go!

Here's an example:

// example3.js
var flatiron = require('./lib/flatiron'),
    app = flatiron.app;

app.use(flatiron.plugins.cli);

app.start();

app.log.info(JSON.stringify(app.argv));

This prints:

% node example3.js
info:    {"_":[], "$0": "node ./example3.js"}

Awesome!

Add a Default Help Command with options.usage:

When attaching the CLI plugin, just specify options.usage to get a friendly default message for when there aren't any matching routes:

// example4.js
var flatiron = require('./lib/flatiron'),
    app = flatiron.app;

app.use(flatiron.plugins.cli, {
  usage: [
    'Welcome to my app!',
    'Your command didn\'t do anything.',
    'This is expected.'
  ]
});

app.start();
% node example4.js 
help:   Welcome to my app!
help:   Your command didn't do anything.
help:   This is expected.

Start The Application with app.start(callback):

As seen in these examples, starting your app is as easy as app.start! this method takes a callback, which is called when an app.command completes. Here's a complete example demonstrating this behavior and how it integrates with options.usage:

// example5.js
var path = require('path'),
    flatiron = require('./lib/flatiron'),
    app = flatiron.app;

app.use(flatiron.plugins.cli, {
  usage: [
    '`node example5.js error`: Throws an error.',
    '`node example5.js friendly`: Does not throw an error.'
  ]
});

app.commands.error = function (cb) {
  cb(new Error('I\'m an error!'));
};

app.commands.friendly = function (cb) {
  cb(null);
}

app.start(function (err) {
  if (err) {
    app.log.error(err.message || 'You didn\'t call any commands!');
    app.log.warn('NOT OK.');
    return process.exit(1);
  }
  app.log.info('OK.');
});

Here's how our app behaves:

% node example5.js friendly
info:   OK.

% node example5.js error
error:  I'm an error!
warn:   NOT OK.

% node example5.js
help:   `node example2b.js error`: Throws an error.
help:   `node example2b.js friendly`: Does not throw an error.
error:  You didn't call any commands!
warn:   NOT OK.

Read More About Flatiron!

Articles

Sub-Projects

Tests

Tests are written in vows:

  $ npm test

License: MIT

blacksmith's People

Contributors

ad-si avatar adammw avatar avianflu avatar bmeck avatar coderarity avatar creatovisguru avatar deanlandolt avatar dscape avatar fb55 avatar hamtie avatar indexzero avatar jfhbrook avatar jfromaniello avatar joeybaker avatar julianduque avatar learningjs avatar marak avatar max-giro avatar mmalecki avatar morganrallen avatar pksunkara avatar polotek avatar saadiq avatar thejh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blacksmith's Issues

lstat > stat

lstat is symlink-aware, and as such is a better fit than stat for most (if not all) cases of its use in blacksmith.

support http-server 0.4.x

Though using 'blacksmith preview works', however node./bin/server gives TypeError: undefined is not a function in ./bin/server:3. when using http-server >=0.3.0.

This causes a problem running 'jitsu deploy' with the dependency in package.json set for http-server as "*" which was until recently the default. I see it has been set to specifically 0.2.4 as of a few days ago.

The current version of http-server is 0.4.0 and dependency has to be set as "0.2.4" to deploy on nodejitsu or run locally using node./bin/server.

Simplifying ./bin/server to something like the following and using default port 8080 and public dir allows 'node ./bin/server to start the app locally with version 0.4.0 of http-server. Have not tested this with nodejitsu or am I sure this is a good way to do it.

var httpServer = require('http-server');

httpServer.start();

process.on('SIGINT', function() {
httpServer.log('http-server stopped.'.red);
return process.exit();
});

cannot deploy to nodejitsu

error:  Error running command deploy
error:  Nodejitsu Error (500): Internal Server Error
error:  
error:  There was an error while attempting to start your application.
error:  Error spawning drone
error:  Script prematurely exited
error:  
error:  This type of error is usually a user error.
error:  Error output from your application:
error:  
error:  node.js:201
error:          throw e; // process.nextTick error, or 'error' event on first tick
error:                ^
error:  TypeError: undefined is not a function
error:      at Object.<anonymous> (/usr/local/src/domino/blacksmith-blog/domino/bin/server:3:18)
error:      at Module._compile (module.js:432:26)
error:      at Object..js (module.js:450:10)
error:      at Module.load (module.js:351:31)
error:      at Function._load (module.js:310:12)
error:      at Function.runMain (module.js:470:10)
error:      at Array.1 (/root/haibu-orchestra/node_modules/haibu/node_modules/haibu-carapace/lib/carapace.js:190:30)
error:      at EventEmitter._tickCallback (node.js:192:40)
info:   Nodejitsu not ok

Invalid HTML generated

Blacksmith does not generate valid HTML. Main problems are as follow:

  • missing doctype declaration
  • nav missess <ul> tag
  • time is in wrong format (inside <time> tag)

On all other pages than index doctype and ul are present and in correct place.

To reproduce just:

  • blacksmith init
  • blackmith generate
  • open file public/index.html

Remove unnecessary reading and writing of files

Based on the logs and generation time, it seems that we are reading and writing files that have not been modified.

We should change the generation code to be more intelligent ( i.e., check mtimes on all files before read and write )

Add way to do includes

This would be something that coopts some div class (or other tag if there is a more appropriate one) to allow for text insertion of files relative to content's root.

blacksmith init -- TypeError: Object #<Object> has no method 'help'

jd:Desktop jmonster$ blacksmith init

info: Executing command init
{
  "process": {
    "pid": 17290,
    "uid": 501,
    "gid": 20,
    "cwd": "/Users/jmonster/Desktop",
    "execPath": "/usr/local/Cellar/node/0.6.9/bin/node",
    "version": "v0.6.9",
    "argv": [
      "node",
      "/usr/local/bin/blacksmith",
      "init"
    ],
    "memoryUsage": {
      "rss": 27594752,
      "heapTotal": 17694080,
      "heapUsed": 10891440
    }
  },
  "os": {
    "loadavg": [
      0.421875,
      0.60205078125,
      0.51025390625
    ],
    "uptime": 132447
  },
  "trace": [
    {
      "column": 15,
      "file": "/usr/local/lib/node_modules/blacksmith/lib/commands/init.js",
      "function": "getType",
      "line": 41,
      "method": null,
      "native": false
    },
    {
      "column": 5,
      "file": "/usr/local/lib/node_modules/blacksmith/lib/commands/init.js",
      "function": null,
      "line": 67,
      "method": null,
      "native": false
    },
    {
      "column": 5,
      "file": "/usr/local/lib/node_modules/blacksmith/node_modules/blacksmith-sites/index.js",
      "function": "Object.oncomplete",
      "line": 27,
      "method": "oncomplete",
      "native": false
    }
  ],
  "stack": [
    "TypeError: Object #<Object> has no method 'help'",
    "    at getType (/usr/local/lib/node_modules/blacksmith/lib/commands/init.js:41:15)",
    "    at /usr/local/lib/node_modules/blacksmith/lib/commands/init.js:67:5",
    "    at Object.oncomplete (/usr/local/lib/node_modules/blacksmith/node_modules/blacksmith-sites/index.js:27:5)"
  ],
  "level": "error",
  "message": "uncaughtException"
}

[feature] Exposed hooks for postprocessing

At least one user has an interest in running their blacksmith-generated site through tools like js and css minifiers. I think this will be relatively easy to do once the rendering refactor is done.

Move logic for file-system based resources to Resourceful project

Blacksmith currently has it's logic for reading and writing Article resources hard-coded into blacksmith itself.

This is wrong. We should have generic logic available for handling file-system based resources. This logic should be pulled out of blacksmith and added to the Resourceful project.

We also should re-think how the file-system resource logic currently works, it's not exactly ideal yet, particularly in regards to smart updates based on mtime and ctime.

See:

https://github.com/flatiron/blacksmith/blob/master/lib/fs2.js
https://github.com/flatiron/resourceful/

The "after the break" algorithm should be more clever.

Currently, the "after the break" algorithm simply looks for the first header smaller than or equal to an h2. However, if the author doesn't have this in mind the results can, well, be surprising.

A smarter algorithm could clip after a certain number of paragraphs and up to/including the last header. Alternately, an "after the break" tag (similar to the snippets tag) could be used.

Blacksmith should not assume index.html completion

Quote from Bradley:

Currently we assume index.html completion for servers, which while using Apache, node-http-server, etc. is viable, pushing content to a CDN for static sites is a common solution that may not support directory forwarding to index.html.

I'm not actually sure what needs to change in blacksmith to allow for this use case.

Are "page.json" and "content.md" the best names?

Originally, it was something like article.md and metadata.json, but they were changed to the current state of affairs in order to be more general and descriptive. However, maybe index.json and index.md are better choices?

Requesting feedback.

Incorrect markup generated on front page

Using both the master and refactored branches, the initial "blacksmith init" creates a post entitled "First post".

Upon "blacksmith generate", the rendered HTML lists the post title as "My awesome blog" on the front page.
On the article page itself, the post title is correct.

Posts created using "blacksmith post" also generates an incorrect front page. Again, the post title is corrected on the article page.

Any idea what could be causing this?

./post1/post1 static hosting on s3

I am hosting my blog in static files on s3, when I am on index.html, clicking on the title of a blog post works properly by resolving to mysite.com/post1 . If I am on the specific post page and click the title again, it tries to resolve to mysite.com/post1/post1

This only happens when I upload to s3, not from

blacksmith preview

Bug in page titles

For example:

:: Mad Science at Nodejitsu

Something before the join is 0 characters long.

Read all data only once

Right now, aside from the "content" loader, fs reads also occur in the toc loader and the snippets loader. Really, all of this should take place in the content loading step.

[feature] Categories and tags

Many bloggers want categories and/or tags. There is a sense of tags (ie, meta tags), but that's all they're being used for.

All commands should run from 'site' directory

After blacksmith init, blacksmith preview and generate are run from the root directory. But running blacksmith post is required to be run from root/pages. I feel it should be aware of where the site content directory so all the commands can be run the root.

Windows support?

Hi!

I installed Blacksmith via npm and when I tried to run blacksmith preview on a newly created blog I get errors like Winston trying to use process.getuid() which isn't supported in Windows. Is Windows support planned for Blacksmith?

Add an ignore flag for the ToC

For example, on a blog with some extra pages, the extra pages (such as "archive", "about", etc.) will show up in the ToC.

Maybe the page.json can look like:

{
  "toc": {
    "index": false
  }
}

Commentary appreciated!

Switch from marked to faster parser written in C (sundown): Robotskirt

Currently blacksmith uses marked, which is fine and relatively fast. But there is a faster one, Robotskirt based on the parser written in C: sundown, the one internally used by GitHub. As marked by default uses GitHub Flavored Markdown, it should be possible to perform the switch transparently I guess.

The only problem atm is that Robotskirt is in the process of making some changes to upgrade to recent sundown version (see Issue 16) and do some other improvements (see last comments of Issue 11), thus such switch possibly shouldn't happen before.

Sort ToC by date

I need to add code to the ToC to make it sorted in reverse chrono. order. At this time, the ToC isn't sorted with respect to date at all.

Features needed

I really think I'll used Blacksmith instead on Octopress ... Anyway some keys features are needed to have an awesome blog :

  • categories
  • pagination
  • tags

For optimizing speed adding a CSS+JS compressor, and ask for URI encoded IMG :)

Thank's

Relative links should be allowed

Quote from Bradley:

Right now links assume that a blacksmith site lives at the root of a server. Since some people may put a blacksmith site at a path other than root, we should respect this and use relative links starting with '.' or '..' instead.

Working with paths in blacksmith is a little bit messy, so path handling should probably get a makeover before this issue is fixed.

Proper article previews

Basically, the article previews use jquery. This is the right idea, but the selectors/algorithm are wrong right now.

Add an "after the break" tag

This would work similarly to snippet embeds in blacksmith now. This would break wheat compatibility, which breaks on the first <h2>.

Integrating LESS and reducing template duplication?

So i know microtemplating is avoided with blacksmith. However, how would i go about integrating LESS so that .less stylesheets are compiled into css in the public folder?

I really dig how blacksmith is setup, but LESS is a bit part of my workflow and i'd love to get it integrated.
Also, if i wanted to breakdown the templates so that code isn't duplicated in every template file, how would i go about it in a way that doesn't bloat blacksmith? Is there a way? Or would i have to resort to a microformat?

Code duplication and lack of Less are the only issues i have and would love to come up with work arounds for them.

blacksmith doesn't work out of the box

System info:

przemoc@debian:~$ uname -a
Linux debian 3.2.0-2-amd64 #1 SMP Fri Jun 1 17:49:08 UTC 2012 x86_64 GNU/Linux
przemoc@debian:~$ lsb_release -drc
Description:    Debian GNU/Linux testing (wheezy)
Release:    testing
Codename:   wheezy
przemoc@debian:~$ nodejs --version
v0.6.19

blacksmith installation:

przemoc@debian:~$ sudo npm install blacksmith -g
[sudo] password for przemoc: 
npm http GET https://registry.npmjs.org/blacksmith
npm http 200 https://registry.npmjs.org/blacksmith
npm http GET https://registry.npmjs.org/blacksmith/-/blacksmith-0.0.11.tgz
npm http GET https://registry.npmjs.org/blacksmith-sites
npm http GET https://registry.npmjs.org/marked
npm http GET https://registry.npmjs.org/traverse
npm http GET https://registry.npmjs.org/mkdirp
npm http GET https://registry.npmjs.org/http-server/0.2.4
npm http GET https://registry.npmjs.org/jsdom
npm http GET https://registry.npmjs.org/weld/0.2.1
npm http GET https://registry.npmjs.org/findit
npm http GET https://registry.npmjs.org/flatiron/0.1.5-1
npm http GET https://registry.npmjs.org/nconf/0.4.3
npm http GET https://registry.npmjs.org/ncp
npm http GET https://registry.npmjs.org/colors
npm http GET https://registry.npmjs.org/optimist
npm http GET https://registry.npmjs.org/wordwrap
npm http GET https://registry.npmjs.org/rss
npm http GET https://registry.npmjs.org/hashish
npm http GET https://registry.npmjs.org/prompt
npm http GET https://registry.npmjs.org/winston
npm http GET https://registry.npmjs.org/cliff
npm http GET https://registry.npmjs.org/utile/0.0.10
npm http GET https://registry.npmjs.org/alists
npm http GET https://registry.npmjs.org/async
npm http 200 https://registry.npmjs.org/http-server/0.2.4
npm http GET https://registry.npmjs.org/http-server/-/http-server-0.2.4.tgz
npm http 200 https://registry.npmjs.org/blacksmith-sites
npm http GET https://registry.npmjs.org/blacksmith-sites/-/blacksmith-sites-0.0.3.tgz
npm http 200 https://registry.npmjs.org/mkdirp
npm http GET https://registry.npmjs.org/mkdirp/-/mkdirp-0.0.7.tgz
npm http 200 https://registry.npmjs.org/weld/0.2.1
npm http GET https://registry.npmjs.org/weld/-/weld-0.2.1.tgz
npm http 200 https://registry.npmjs.org/traverse
npm http GET https://registry.npmjs.org/traverse/-/traverse-0.4.6.tgz
npm http 200 https://registry.npmjs.org/flatiron/0.1.5-1
npm http GET https://registry.npmjs.org/flatiron/-/flatiron-0.1.5-1.tgz
npm http 200 https://registry.npmjs.org/findit
npm http GET https://registry.npmjs.org/findit/-/findit-0.1.2.tgz
npm http 200 https://registry.npmjs.org/nconf/0.4.3
npm http GET https://registry.npmjs.org/nconf/-/nconf-0.4.3.tgz
npm http 200 https://registry.npmjs.org/marked
npm http GET https://registry.npmjs.org/marked/-/marked-0.1.9.tgz
npm http 200 https://registry.npmjs.org/colors
npm http GET https://registry.npmjs.org/colors/-/colors-0.6.0-1.tgz
npm http 200 https://registry.npmjs.org/ncp
npm http 200 https://registry.npmjs.org/jsdom
npm http GET https://registry.npmjs.org/ncp/-/ncp-0.2.6.tgz
npm http GET https://registry.npmjs.org/jsdom/-/jsdom-0.2.14.tgz
npm http 200 https://registry.npmjs.org/optimist
npm http 200 https://registry.npmjs.org/wordwrap
npm http GET https://registry.npmjs.org/optimist/-/optimist-0.2.8.tgz
npm http 200 https://registry.npmjs.org/rss
npm http GET https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz
npm http GET https://registry.npmjs.org/rss/-/rss-0.0.3.tgz
npm http 200 https://registry.npmjs.org/hashish
npm http 200 https://registry.npmjs.org/prompt
npm http GET https://registry.npmjs.org/hashish/-/hashish-0.0.4.tgz
npm http GET https://registry.npmjs.org/prompt/-/prompt-0.1.12.tgz
npm http 200 https://registry.npmjs.org/utile/0.0.10
npm http GET https://registry.npmjs.org/utile/-/utile-0.0.10.tgz
npm http 200 https://registry.npmjs.org/cliff
npm http GET https://registry.npmjs.org/cliff/-/cliff-0.1.8.tgz
npm http 200 https://registry.npmjs.org/alists
npm http GET https://registry.npmjs.org/alists/-/alists-0.0.2.tgz
npm http 200 https://registry.npmjs.org/winston
npm http GET https://registry.npmjs.org/winston/-/winston-0.5.11.tgz
npm http 200 https://registry.npmjs.org/async
npm WARN excluding symbolic link test/symlinks/dir1/dangling-symlink -> does-not-exist
npm WARN package.json [email protected] 'contributers' should probably be 'contributors'
npm http GET https://registry.npmjs.org/seq
npm http GET https://registry.npmjs.org/rimraf
npm http GET https://registry.npmjs.org/xml
npm http GET https://registry.npmjs.org/logging
npm http GET https://registry.npmjs.org/director/1.0.8
npm http GET https://registry.npmjs.org/pkginfo/0.2.2
npm http GET https://registry.npmjs.org/broadway/0.1.4
npm http GET https://registry.npmjs.org/prompt/0.1.11
npm http GET https://registry.npmjs.org/pkginfo
npm http GET https://registry.npmjs.org/eyes
npm http GET https://registry.npmjs.org/winston
npm http GET https://registry.npmjs.org/ini
npm http GET https://registry.npmjs.org/pkginfo
npm http GET https://registry.npmjs.org/loggly
npm http GET https://registry.npmjs.org/stack-trace
npm http GET https://registry.npmjs.org/htmlparser
npm http GET https://registry.npmjs.org/request
npm http GET https://registry.npmjs.org/cssom
npm http GET https://registry.npmjs.org/contextify
npm http 200 https://registry.npmjs.org/director/1.0.8
npm http GET https://registry.npmjs.org/director/-/director-1.0.8.tgz
npm http 200 https://registry.npmjs.org/xml
npm http GET https://registry.npmjs.org/xml/-/xml-0.0.7.tgz
npm http 200 https://registry.npmjs.org/pkginfo/0.2.2
npm http GET https://registry.npmjs.org/pkginfo/-/pkginfo-0.2.2.tgz
npm http 200 https://registry.npmjs.org/rimraf
npm http 200 https://registry.npmjs.org/logging
npm http GET https://registry.npmjs.org/rimraf/-/rimraf-1.0.9.tgz
npm http GET https://registry.npmjs.org/logging/-/logging-2.0.16.tgz
npm http 200 https://registry.npmjs.org/broadway/0.1.4
npm http GET https://registry.npmjs.org/broadway/-/broadway-0.1.4.tgz
npm http 200 https://registry.npmjs.org/prompt/0.1.11
npm http GET https://registry.npmjs.org/prompt/-/prompt-0.1.11.tgz
npm http 200 https://registry.npmjs.org/seq
npm http GET https://registry.npmjs.org/seq/-/seq-0.3.5.tgz
npm http 304 https://registry.npmjs.org/winston
npm http GET https://registry.npmjs.org/winston/-/winston-0.6.1.tgz
npm http 200 https://registry.npmjs.org/pkginfo
npm http GET https://registry.npmjs.org/pkginfo/-/pkginfo-0.2.3.tgz
npm http 200 https://registry.npmjs.org/eyes
npm http GET https://registry.npmjs.org/eyes/-/eyes-0.1.7.tgz
npm http 200 https://registry.npmjs.org/ini
npm http GET https://registry.npmjs.org/ini/-/ini-1.0.2.tgz
npm http 200 https://registry.npmjs.org/pkginfo
npm http 200 https://registry.npmjs.org/stack-trace
npm http GET https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.6.tgz
npm http 200 https://registry.npmjs.org/loggly
npm http GET https://registry.npmjs.org/loggly/-/loggly-0.3.11.tgz
npm http 200 https://registry.npmjs.org/cssom
npm http GET https://registry.npmjs.org/cssom/-/cssom-0.2.3.tgz
npm http 200 https://registry.npmjs.org/htmlparser
npm http GET https://registry.npmjs.org/htmlparser/-/htmlparser-1.7.6.tgz
npm http 200 https://registry.npmjs.org/contextify
npm http GET https://registry.npmjs.org/contextify/-/contextify-0.1.3.tgz
npm http 200 https://registry.npmjs.org/request
npm http GET https://registry.npmjs.org/request/-/request-2.9.202.tgz
npm http GET https://registry.npmjs.org/chainsaw
npm http GET https://registry.npmjs.org/eventemitter2/0.4.1
npm http GET https://registry.npmjs.org/nconf/0.5.0
npm http GET https://registry.npmjs.org/winston/0.5.9
npm http GET https://registry.npmjs.org/utile/0.0.9
npm http GET https://registry.npmjs.org/cycle
npm http GET https://registry.npmjs.org/pkginfo
npm http GET https://registry.npmjs.org/request
npm http 200 https://registry.npmjs.org/chainsaw
npm http GET https://registry.npmjs.org/chainsaw/-/chainsaw-0.0.9.tgz
npm http GET https://registry.npmjs.org/timespan
npm http 200 https://registry.npmjs.org/utile/0.0.9
npm http GET https://registry.npmjs.org/utile/-/utile-0.0.9.tgz
npm http 200 https://registry.npmjs.org/cycle
npm http GET https://registry.npmjs.org/cycle/-/cycle-1.0.0.tgz
npm http 304 https://registry.npmjs.org/pkginfo
npm http 200 https://registry.npmjs.org/nconf/0.5.0
npm http GET https://registry.npmjs.org/nconf/-/nconf-0.5.0.tgz
npm http 304 https://registry.npmjs.org/request
npm http 200 https://registry.npmjs.org/eventemitter2/0.4.1
npm http GET https://registry.npmjs.org/eventemitter2/-/eventemitter2-0.4.1.tgz
npm http 200 https://registry.npmjs.org/timespan
npm http GET https://registry.npmjs.org/timespan/-/timespan-2.2.0.tgz
npm http 200 https://registry.npmjs.org/winston/0.5.9
npm http GET https://registry.npmjs.org/winston/-/winston-0.5.9.tgz
npm http GET https://registry.npmjs.org/traverse
npm WARN package.json [email protected] 'contributers' should probably be 'contributors'
npm http 304 https://registry.npmjs.org/traverse
npm http GET https://registry.npmjs.org/traverse/-/traverse-0.3.9.tgz
npm http GET https://registry.npmjs.org/bindings
npm http GET https://registry.npmjs.org/rimraf
npm http GET https://registry.npmjs.org/ini
npm http GET https://registry.npmjs.org/eyes
npm http GET https://registry.npmjs.org/loggly
npm http GET https://registry.npmjs.org/stack-trace
npm http 304 https://registry.npmjs.org/loggly
npm http 304 https://registry.npmjs.org/stack-trace
npm http 200 https://registry.npmjs.org/bindings
npm http GET https://registry.npmjs.org/bindings/-/bindings-0.3.0.tgz
npm http 304 https://registry.npmjs.org/rimraf
npm http 304 https://registry.npmjs.org/ini
npm http 304 https://registry.npmjs.org/eyes
npm http GET https://registry.npmjs.org/request
npm http GET https://registry.npmjs.org/timespan

> [email protected] install /usr/lib/node_modules/blacksmith/node_modules/jsdom/node_modules/contextify
> node-gyp rebuild

npm http 304 https://registry.npmjs.org/timespan
npm http 304 https://registry.npmjs.org/request
gyp WARN install got an error, rolling back install
gyp ERR! rebuild error Error: EACCES, stat '/root/.node-gyp/0.6.19'
gyp ERR! not ok 
npm WARN optional dep failed, continuing [email protected]
/usr/bin/blacksmith -> /usr/lib/node_modules/blacksmith/bin/blacksmith
[email protected] /usr/lib/node_modules/blacksmith/node_modules/alists

[email protected] /usr/lib/node_modules/blacksmith/node_modules/colors

[email protected] /usr/lib/node_modules/blacksmith/node_modules/hashish

[email protected] /usr/lib/node_modules/blacksmith/node_modules/mkdirp

[email protected] /usr/lib/node_modules/blacksmith/node_modules/weld

[email protected] /usr/lib/node_modules/blacksmith/node_modules/marked

[email protected] /usr/lib/node_modules/blacksmith/node_modules/wordwrap

[email protected] /usr/lib/node_modules/blacksmith/node_modules/async

[email protected] /usr/lib/node_modules/blacksmith/node_modules/ncp

[email protected] /usr/lib/node_modules/blacksmith/node_modules/optimist

[email protected] /usr/lib/node_modules/blacksmith/node_modules/traverse

[email protected] /usr/lib/node_modules/blacksmith/node_modules/http-server

[email protected] /usr/lib/node_modules/blacksmith/node_modules/blacksmith-sites

[email protected] /usr/lib/node_modules/blacksmith/node_modules/utile/node_modules/rimraf

[email protected] /usr/lib/node_modules/blacksmith/node_modules/utile

[email protected] /usr/lib/node_modules/blacksmith/node_modules/rss/node_modules/logging

[email protected] /usr/lib/node_modules/blacksmith/node_modules/rss/node_modules/xml

[email protected] /usr/lib/node_modules/blacksmith/node_modules/rss

[email protected] /usr/lib/node_modules/blacksmith/node_modules/prompt/node_modules/pkginfo

[email protected] /usr/lib/node_modules/blacksmith/node_modules/prompt

[email protected] /usr/lib/node_modules/blacksmith/node_modules/nconf/node_modules/ini

[email protected] /usr/lib/node_modules/blacksmith/node_modules/nconf/node_modules/pkginfo

[email protected] /usr/lib/node_modules/blacksmith/node_modules/nconf

[email protected] /usr/lib/node_modules/blacksmith/node_modules/cliff/node_modules/eyes

[email protected] /usr/lib/node_modules/blacksmith/node_modules/cliff/node_modules/winston/node_modules/cycle

[email protected] /usr/lib/node_modules/blacksmith/node_modules/cliff/node_modules/winston/node_modules/stack-trace

[email protected] /usr/lib/node_modules/blacksmith/node_modules/cliff/node_modules/winston/node_modules/pkginfo

[email protected] /usr/lib/node_modules/blacksmith/node_modules/cliff/node_modules/winston/node_modules/request

[email protected] /usr/lib/node_modules/blacksmith/node_modules/cliff/node_modules/winston

[email protected] /usr/lib/node_modules/blacksmith/node_modules/cliff

[email protected] /usr/lib/node_modules/blacksmith/node_modules/winston/node_modules/eyes

[email protected] /usr/lib/node_modules/blacksmith/node_modules/winston/node_modules/stack-trace

[email protected] /usr/lib/node_modules/blacksmith/node_modules/winston/node_modules/pkginfo

[email protected] /usr/lib/node_modules/blacksmith/node_modules/winston/node_modules/loggly/node_modules/timespan

[email protected] /usr/lib/node_modules/blacksmith/node_modules/winston/node_modules/loggly/node_modules/request

[email protected] /usr/lib/node_modules/blacksmith/node_modules/winston/node_modules/loggly

[email protected] /usr/lib/node_modules/blacksmith/node_modules/winston

[email protected] /usr/lib/node_modules/blacksmith/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse

[email protected] /usr/lib/node_modules/blacksmith/node_modules/findit/node_modules/seq/node_modules/chainsaw

[email protected] /usr/lib/node_modules/blacksmith/node_modules/findit/node_modules/seq

[email protected] /usr/lib/node_modules/blacksmith/node_modules/findit

[email protected] /usr/lib/node_modules/blacksmith/node_modules/flatiron/node_modules/pkginfo

[email protected] /usr/lib/node_modules/blacksmith/node_modules/flatiron/node_modules/prompt

[email protected] /usr/lib/node_modules/blacksmith/node_modules/flatiron/node_modules/director

[email protected] /usr/lib/node_modules/blacksmith/node_modules/flatiron/node_modules/broadway/node_modules/eventemitter2

[email protected] /usr/lib/node_modules/blacksmith/node_modules/flatiron/node_modules/broadway/node_modules/utile/node_modules/rimraf

[email protected] /usr/lib/node_modules/blacksmith/node_modules/flatiron/node_modules/broadway/node_modules/utile

[email protected] /usr/lib/node_modules/blacksmith/node_modules/flatiron/node_modules/broadway/node_modules/nconf/node_modules/ini

[email protected] /usr/lib/node_modules/blacksmith/node_modules/flatiron/node_modules/broadway/node_modules/nconf

[email protected] /usr/lib/node_modules/blacksmith/node_modules/flatiron/node_modules/broadway/node_modules/winston/node_modules/eyes

[email protected] /usr/lib/node_modules/blacksmith/node_modules/flatiron/node_modules/broadway/node_modules/winston/node_modules/stack-trace

[email protected] /usr/lib/node_modules/blacksmith/node_modules/flatiron/node_modules/broadway/node_modules/winston/node_modules/loggly/node_modules/timespan

[email protected] /usr/lib/node_modules/blacksmith/node_modules/flatiron/node_modules/broadway/node_modules/winston/node_modules/loggly/node_modules/request

[email protected] /usr/lib/node_modules/blacksmith/node_modules/flatiron/node_modules/broadway/node_modules/winston/node_modules/loggly

[email protected] /usr/lib/node_modules/blacksmith/node_modules/flatiron/node_modules/broadway/node_modules/winston

[email protected] /usr/lib/node_modules/blacksmith/node_modules/flatiron/node_modules/broadway

[email protected] /usr/lib/node_modules/blacksmith/node_modules/flatiron

[email protected] /usr/lib/node_modules/blacksmith/node_modules/jsdom/node_modules/cssom

[email protected] /usr/lib/node_modules/blacksmith/node_modules/jsdom/node_modules/request

[email protected] /usr/lib/node_modules/blacksmith/node_modules/jsdom/node_modules/htmlparser

[email protected] /usr/lib/node_modules/blacksmith/node_modules/jsdom

Blog creation:

przemoc@debian:~$ blacksmith init
info: Executing command init
info: init can create any of these site types:
info: 
info:     * doc: A docs site for blacksmith
info:     * blog: A simple blacksmith blog using Scribbish
info: 
prompt: Choose your website type: blog
info: Selecting website type blog...
prompt: Name your website: blog
warn: blacksmith is about to write a blog site to ./blog!
prompt: Is this okay? [y/N]: y
info: * Created `./blog`.

Generation:

przemoc@debian:~$ cd blog/
przemoc@debian:~/blog$ blacksmith generate
info: Executing command generate
{
  "process": {
    "pid": 5516,
    "uid": 1000,
    "gid": 1000,
    "cwd": "/home/przemoc/blog",
    "execPath": "/usr/bin/node",
    "version": "v0.6.19",
    "argv": [
      "node",
      "/usr/bin/blacksmith",
      "generate"
    ],
    "memoryUsage": {
      "rss": 32608256,
      "heapTotal": 30156288,
      "heapUsed": 13121912
    }
  },
  "os": {
    "loadavg": [
      0.98583984375,
      1.05078125,
      1.06005859375
    ],
    "uptime": 3726.38355848
  },
  "trace": [
    {
      "column": 59,
      "file": "/usr/lib/node_modules/blacksmith/node_modules/jsdom/lib/jsdom.js",
      "function": null,
      "line": 171,
      "method": null,
      "native": false
    },
    {
      "column": 5,
      "file": "/usr/lib/node_modules/blacksmith/node_modules/jsdom/lib/jsdom.js",
      "function": "Object.env",
      "line": 262,
      "method": "env",
      "native": false
    },
    {
      "column": 9,
      "file": "/usr/lib/node_modules/blacksmith/lib/blacksmith.js",
      "function": "Object.generate",
      "line": 83,
      "method": "generate",
      "native": false
    },
    {
      "column": 11,
      "file": "/usr/lib/node_modules/blacksmith/lib/commands/generate.js",
      "function": null,
      "line": 22,
      "method": null,
      "native": false
    },
    {
      "column": 19,
      "file": "/usr/lib/node_modules/blacksmith/node_modules/flatiron/lib/flatiron/plugins/cli.js",
      "function": "executeCommand",
      "line": 176,
      "method": null,
      "native": false
    },
    {
      "column": 5,
      "file": "/usr/lib/node_modules/blacksmith/node_modules/flatiron/lib/flatiron/plugins/cli.js",
      "function": "",
      "line": 221,
      "method": null,
      "native": false
    },
    {
      "column": 21,
      "file": "Object].dispatch (/usr/lib/node_modules/blacksmith/node_modules/flatiron/node_modules/director/lib/director/cli.js",
      "function": "[object",
      "line": 50,
      "method": null,
      "native": false
    },
    {
      "column": 18,
      "file": "/usr/lib/node_modules/blacksmith/node_modules/flatiron/lib/flatiron/plugins/cli.js",
      "function": null,
      "line": 58,
      "method": null,
      "native": false
    },
    {
      "column": 12,
      "file": "Object].<anonymous> (/usr/lib/node_modules/blacksmith/node_modules/flatiron/node_modules/broadway/lib/broadway/app.js",
      "function": "[object",
      "line": 74,
      "method": null,
      "native": false
    },
    {
      "column": 31,
      "file": "Object].init (/usr/lib/node_modules/blacksmith/node_modules/flatiron/lib/flatiron/app.js",
      "function": "[object",
      "line": 31,
      "method": null,
      "native": false
    }
  ],
  "stack": [
    "TypeError: Cannot read property 'implementation' of undefined",
    "    at /usr/lib/node_modules/blacksmith/node_modules/jsdom/lib/jsdom.js:171:59",
    "    at Object.env (/usr/lib/node_modules/blacksmith/node_modules/jsdom/lib/jsdom.js:262:5)",
    "    at Object.generate (/usr/lib/node_modules/blacksmith/lib/blacksmith.js:83:9)",
    "    at /usr/lib/node_modules/blacksmith/lib/commands/generate.js:22:11",
    "    at executeCommand (/usr/lib/node_modules/blacksmith/node_modules/flatiron/lib/flatiron/plugins/cli.js:176:19)",
    "    at Object.<anonymous> (/usr/lib/node_modules/blacksmith/node_modules/flatiron/lib/flatiron/plugins/cli.js:221:5)",
    "    at [object Object].dispatch (/usr/lib/node_modules/blacksmith/node_modules/flatiron/node_modules/director/lib/director/cli.js:50:21)",
    "    at /usr/lib/node_modules/blacksmith/node_modules/flatiron/lib/flatiron/plugins/cli.js:58:18",
    "    at [object Object].<anonymous> (/usr/lib/node_modules/blacksmith/node_modules/flatiron/node_modules/broadway/lib/broadway/app.js:74:12)",
    "    at [object Object].init (/usr/lib/node_modules/blacksmith/node_modules/flatiron/lib/flatiron/app.js:31:31)"
  ],
  "level": "error",
  "message": "uncaughtException"
}

Did I forget about something?

Include all link definitions in truncated content

Because of the way ##!!truncate is implemented all link definitions in the truncated portion must be defined there. We should grab all link definitions and include them in the Markdown parsing of truncated content

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.