Skip to content
This repository has been archived by the owner on Apr 1, 2019. It is now read-only.

Commit

Permalink
change the way that docs works
Browse files Browse the repository at this point in the history
  • Loading branch information
Walker Leite committed Sep 12, 2017
1 parent ff8ce27 commit c4e8605
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 10 deletions.
2 changes: 1 addition & 1 deletion meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
"label": "Author"
}
},
"completeMessage": "To get started:\n\n{{^inPlace}}cd {{destDirName}}\n\n{{/inPlace}}1. Install dependencies npm install\n2. Write your component in src/Component.vue\n3. Write a demo in README.md\n4. Access demo and docs with npm run serve\n5. Build with npm run build\n6. Build docs with npm run build:doc"
"completeMessage": "To get started:\n\n{{^inPlace}}cd {{destDirName}}\n\n{{/inPlace}}1. Install dependencies npm install\n2. Write your component in src/Component.vue\n3. Write a demo in docs usage.md\n4. Access demo and docs with npm run serve\n5. Build with npm run build\n6. Build docs with npm run build:doc"
}
1 change: 1 addition & 0 deletions template/docs/Introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
> {{ description }}
3 changes: 3 additions & 0 deletions template/docs/Usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<{{ name }} text="Hello World!"></{{ name }}>

* You can add more demos in `docs` directory (remember to update styleguide.config.js also)
2 changes: 1 addition & 1 deletion template/src/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Component from './Component.vue';
import Component from './Component/Component.vue';

Component.install = Vue => Vue.component(Component.name, Component);
Component.version = process.env.VERSION;
Expand Down
25 changes: 17 additions & 8 deletions template/styleguide.config.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
const {name, version} = require('./package.json')
const loaders = require('vue-webpack-loaders');

module.exports = {
components: 'src/**/[A-Z]*.vue',
sections: [
{
/* The component itself */
name: '{{ name }}',
content: 'docs/Introduction.md',
components: 'src/Component/Component.vue',
ignore: ['src/Component/Component.vue'],
sections: [
/* One item for every different demo or doc of the component */
{
name: 'usage',
content: 'docs/Usage.md'
}
]
},
],
webpackConfig: {
module: {
loaders,
},
plugins: [
new webpack.DefinePlugin({
'proccess.env.VERSION': JSON.stringify(version) // adds MyComponent.version
})
]
}
},
serverPort: 6062
};

0 comments on commit c4e8605

Please sign in to comment.