webpro / component-styleguide Goto Github PK
View Code? Open in Web Editor NEWSimple styleguide framework
Simple styleguide framework
It would be helpful to have a place to define default data, for partials that have not been given a context. i.e. given the following template:
<h1>{{ headingText }}</h1>
and the following data (possibly in a data/data.json
file, or in a location defined in the configuration options):
{
"headingText": "This is a heading"
}
the following would result:
<h1>This is a heading</h1>
Having such a function would mean authors could avoid scenarios where templates need to be written as such:
<h1>{{#if headingText}}{{headingText}}{{else}}This is a heading{{/if}}</h1>
I tried to nest a component (say components > atoms > buttons > button.html button-secondary.html etc) and the menu properly displayed Button/Button and Button/Button Secondary, however you're met with a "File not found" message when trying to navigate.
Ideally you have a way to group components, and simplify the browsing experience to navigate to grouped components.
I’m trying to add live reload functionality. To do so, I’ve added a command to my build script to start livereload server on port 9091. Of course, I then need to link to the livereload.js script. So I did the following in index.js:
var styleguide = require('component-styleguide'),
path = require('path');
styleguide({
components: path.resolve(__dirname, 'components'),
ext: 'html',
data: path.resolve(__dirname, 'data'),
staticLocalDir: path.resolve(__dirname, 'compiled'),
staticPath: '/compiled',
stylesheets: ['app.css'],
scripts: ['http://localhost:9091','app.js']
});
Unfortunately, this generates the following HTML:
<script src="/compiled/http://localhost:9091"></script>
<script src="/compiled/app.js"></script>
I tried changing staticPath:
to ''
, and add this path to each stylesheet and script individually, but this had no effect. Adding a resource to the scripts
or stylesheets
arrays that starts with http://
or https://
, the staticPath
value should be ignored… unless there is another way of achieving the desired result?
Hi there,
Thanks for putting this together. I really love the simplicity of if, but your example setup won't compile (everything works - scss, js, but not the styleguide).
I am running on Win, Node V4.4.5, and npm 3.5.2.,but when I run node index.js
on the root folder I see
Styleguide server started at http://:::3000
on the terminal, but nothing gets compiled to compiled
folder.
Tiny bug, but seen on two separate instances (one Mac OS X, one on Windows). When the server starts, it reports as running on http://:::3000
. Should this not report http://localhost:3000
instead?
I noticed that the component styleguide package depends on the express server, I was trying to set up gulp processes to automatically refresh the server when a change is detected to the component or style directory. I was looking to see if there was a method to shoot a refresh of to the server without having to install another package.
Hey Lars, I like the generic, unopinionated, feel of this and wonder how easy it would be to make this more generic. Would it be a lot of work to lose the requirement of an 'atomic' structure or add a new category of 'generic' components?
Although I like the PatternLab structure of 'atoms', 'molecules', 'organisms', 'pages' etc. not all (existing) projects are a great fit. For those I'd like to have, say, a generic '/components' folder in which I could place generic components (nested subfolders).
Being able to build a static version to include in the codebase would be useful for QA, consumption outside of running the local server, etc.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.