dist-to-docs copy

This commit is contained in:
Kevin Ross 2016-03-09 11:39:56 -06:00
parent c7e8aefd94
commit 25436dff34
2 changed files with 29 additions and 30 deletions

View File

@ -262,15 +262,15 @@ module.exports = function (grunt) {
}, },
copy: { copy: {
'dist-to-docs': { // for example templates //'dist-to-docs': { // for example templates
expand: true, // expand: true,
cwd: 'dist', // cwd: 'dist',
src: [ // src: [
'js/*.iife*', // 'js/*.iife*',
'css/*.*' // 'css/*.*'
], // ],
dest: 'docs/dist/' // dest: 'docs/dist/'
}, //},
//'bs-docs-js-vendor': { //'bs-docs-js-vendor': {
// expand: true, // expand: true,
// cwd: '../bootstrap/docs/assets/js/vendor', // cwd: '../bootstrap/docs/assets/js/vendor',

View File

@ -101,18 +101,6 @@ new TaskSeries(gulp, 'css', [scsslint, sass])
/** /**
* DOCS * DOCS
*/ */
const referenceDocNotice =
`$1\n
[//]: # DO NOT EDIT IT WILL BE OVERWRITTEN - copy of bootstrap documentation generated by grunt docs-copy-bootstrap-docs\n
{% callout info %}\n**Bootstrap Reference Documentation**
This is a part of the reference documentation from <a href="http://getbootstrap.com">Bootstrap</a>.
It is included here to demonstrate rendering with Material Design for Bootstrap default styling.
See the <a href="/material-design/buttons">Material Design</a> section for more elements and customization options.
{% endcallout %}
\n\n$2`
let docsPreset = Preset.baseline({ let docsPreset = Preset.baseline({
javascripts: { javascripts: {
source: {options: {cwd: 'docs/assets/js/src'}}, source: {options: {cwd: 'docs/assets/js/src'}},
@ -153,6 +141,15 @@ let docs = [
] ]
] ]
const referenceDocNotice =
`$1\n
[//]: # DO NOT EDIT IT WILL BE OVERWRITTEN - copy of bootstrap documentation generated by gulp docs:copy:bs\n
{% callout info %}\n**Bootstrap Reference Documentation**
This is a part of the reference documentation from <a href="http://getbootstrap.com">Bootstrap</a>.
It is included here to demonstrate rendering with Material Design for Bootstrap default styling.
See the <a href="/material-design/buttons">Material Design</a> section for more elements and customization options.
{% endcallout %}
\n\n$2`
const docsProcess = (content, srcpath) => { // https://regex101.com/r/cZ7aO8/2 const docsProcess = (content, srcpath) => { // https://regex101.com/r/cZ7aO8/2
return content return content
@ -170,7 +167,6 @@ let bsDocs = [
dest: 'docs/content/', dest: 'docs/content/',
process: docsProcess process: docsProcess
}), }),
new Copy(gulp, docsPreset, docsConfig, { new Copy(gulp, docsPreset, docsConfig, {
task: {name: 'copy:bs-docs-components'}, task: {name: 'copy:bs-docs-components'},
source: { source: {
@ -180,7 +176,6 @@ let bsDocs = [
dest: 'docs/components/', dest: 'docs/components/',
process: docsProcess process: docsProcess
}), }),
new Copy(gulp, docsPreset, docsConfig, { new Copy(gulp, docsPreset, docsConfig, {
task: {name: 'copy:bs-docs-scss'}, task: {name: 'copy:bs-docs-scss'},
source: { source: {
@ -189,10 +184,9 @@ let bsDocs = [
}, },
dest: 'docs/assets/scss/', dest: 'docs/assets/scss/',
process: (content, srcpath) => { process: (content, srcpath) => {
return content.replace(/([\s\S]+)/mg, '// DO NOT EDIT IT WILL BE OVERWRITTEN - copy of bootstrap documentation generated by gulp docs:copy-bs\n\n$1'); return content.replace(/([\s\S]+)/mg, '// DO NOT EDIT IT WILL BE OVERWRITTEN - copy of bootstrap documentation generated by gulp docs:copy:bs\n\n$1');
} }
}), }),
new Copy(gulp, docsPreset, docsConfig, { new Copy(gulp, docsPreset, docsConfig, {
task: {name: 'copy:bs-docs-plugins'}, task: {name: 'copy:bs-docs-plugins'},
source: { source: {
@ -201,7 +195,6 @@ let bsDocs = [
}, },
dest: 'docs/_plugins/' dest: 'docs/_plugins/'
}), }),
new Copy(gulp, docsPreset, docsConfig, { new Copy(gulp, docsPreset, docsConfig, {
task: {name: 'copy:bs-docs-js-vendor'}, task: {name: 'copy:bs-docs-js-vendor'},
source: { source: {
@ -213,9 +206,15 @@ let bsDocs = [
] ]
}, },
dest: 'docs/assets/js/vendor/' dest: 'docs/assets/js/vendor/'
}), })
] ]
new TaskSeries(gulp, 'docs:copy:bs', bsDocs)
new Copy(gulp, docsPreset, docsConfig, {
task: {name: 'copy:dist'},
new TaskSeries(gulp, 'docs:copy-bs', bsDocs) source: {
options: {cwd: 'dist'},
glob: ['js/*.iife*', 'css/*.*']
},
dest: 'docs/dist/'
})