Skip to content

Instantly share code, notes, and snippets.

@Aratramba
Last active May 9, 2018
Embed
What would you like to do?
Design Manual setup with Collect Components
const DesignManual = require('design-manual');
const scraper = require('collect-components');
// gather components
scraper({
url: 'http://localhost:8000/',
paths: ['patterns.html'],
output: 'docs/components.json',
complete: function() {
// build design manual
DesignManual.build({
output: 'docs/',
pages: './',
components: 'docs/components.json',
meta: {
domain: 'example.com',
title: 'Example'
}
});
}
});
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Patterns</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<!-- @component
name: hello world
description: This is my first component
-->
<img src="https://assets.imgix.net/examples/butterfly.jpg?px=50&w=1200&h=50&fit=crop" alt="" />
</body>
</html>

!{hello world}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment