mirror of
https://github.com/mdbootstrap/mdb-ui-kit.git
synced 2025-06-22 05:53:13 +03:00
working on gulp copy
This commit is contained in:
parent
10539f84ab
commit
b859447118
36
Gruntfile.js
36
Gruntfile.js
|
@ -335,24 +335,24 @@ module.exports = function (grunt) {
|
||||||
],
|
],
|
||||||
dest: 'docs/getting-started/'
|
dest: 'docs/getting-started/'
|
||||||
},
|
},
|
||||||
'bs-docs-content': {
|
//'bs-docs-content': {
|
||||||
options: {
|
// options: {
|
||||||
// https://regex101.com/r/cZ7aO8/2
|
// // https://regex101.com/r/cZ7aO8/2
|
||||||
process: function (content, srcpath) {
|
// process: function (content, srcpath) {
|
||||||
return content
|
// return content
|
||||||
// insert docs reference
|
// // insert docs reference
|
||||||
.replace(/(---[\s\S]+?---)([\s\S]+)/mg, referenceDocNotice)
|
// .replace(/(---[\s\S]+?---)([\s\S]+)/mg, referenceDocNotice)
|
||||||
// remove sample text 'display' as this is a particular style and is confusing
|
// // remove sample text 'display' as this is a particular style and is confusing
|
||||||
.replace(/Fancy display heading/, 'Fancy heading');
|
// .replace(/Fancy display heading/, 'Fancy heading');
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
expand: true,
|
// expand: true,
|
||||||
cwd: '../bootstrap/docs/content',
|
// cwd: '../bootstrap/docs/content',
|
||||||
src: [
|
// src: [
|
||||||
'**/*'
|
// '**/*'
|
||||||
],
|
// ],
|
||||||
dest: 'docs/content/'
|
// dest: 'docs/content/'
|
||||||
}
|
//}
|
||||||
},
|
},
|
||||||
|
|
||||||
connect: {
|
connect: {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import {Preset, Clean, MinifyCss, Sass, RollupEs, RollupUmd, RollupIife, ScssLint, EsLint, TaskSeries, Uglify} from 'gulp-pipeline/src/index'
|
import {Preset, Clean, Copy, MinifyCss, Sass, RollupEs, RollupUmd, RollupIife, ScssLint, EsLint, TaskSeries, Uglify} from 'gulp-pipeline/src/index'
|
||||||
|
|
||||||
// debug the project source - remove for repo
|
// debug the project source - remove for repo
|
||||||
//import {Clean, CleanDigest, Images, MinifyCss, Sass, RollupIife, ScssLint, EsLint, Rev, TaskSeries} from 'gulp-pipeline'
|
//import {Clean, CleanDigest, Images, MinifyCss, Sass, RollupIife, ScssLint, EsLint, Rev, TaskSeries} from 'gulp-pipeline'
|
||||||
|
@ -46,8 +46,7 @@ let rollupConfig = {
|
||||||
'anchor-js': 'anchors',
|
'anchor-js': 'anchors',
|
||||||
clipboard: 'Clipboard'
|
clipboard: 'Clipboard'
|
||||||
},
|
},
|
||||||
banner:
|
banner: `/*!
|
||||||
`/*!
|
|
||||||
* Bootstrap Material Design v${pkg.version} (${pkg.homepage})
|
* Bootstrap Material Design v${pkg.version} (${pkg.homepage})
|
||||||
* Copyright 2014-${moment().format("YYYY")} ${pkg.author}
|
* Copyright 2014-${moment().format("YYYY")} ${pkg.author}
|
||||||
* Licensed under MIT (https://github.com/FezVrasta/bootstrap-material-design/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/FezVrasta/bootstrap-material-design/blob/master/LICENSE)
|
||||||
|
@ -104,7 +103,7 @@ new TaskSeries(gulp, 'css', [scsslint, sass])
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const referenceDocNotice =
|
const referenceDocNotice =
|
||||||
`$1\n
|
`$1\n
|
||||||
[//]: # DO NOT EDIT IT WILL BE OVERWRITTEN - copy of bootstrap documentation generated by grunt docs-copy-bootstrap-docs\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**
|
{% callout info %}\n**Bootstrap Reference Documentation**
|
||||||
This is a part of the reference documentation from <a href="http://getbootstrap.com">Bootstrap</a>.
|
This is a part of the reference documentation from <a href="http://getbootstrap.com">Bootstrap</a>.
|
||||||
|
@ -114,7 +113,6 @@ See the <a href="/material-design/buttons">Material Design</a> section for more
|
||||||
\n\n$2`
|
\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'}},
|
||||||
|
@ -133,24 +131,41 @@ const docsConfig = {task: {prefix: 'docs:'}}
|
||||||
|
|
||||||
let docs = [
|
let docs = [
|
||||||
[
|
[
|
||||||
new ScssLint(gulp, docsPreset, extend(true, {}, docsConfig, {
|
new ScssLint(gulp, docsPreset, docsConfig, {
|
||||||
source: {glob: ['**/*.scss', '!docs.scss']},
|
source: {glob: ['**/*.scss', '!docs.scss']},
|
||||||
watch: {glob: ['**/*.scss', '!docs.scss']}
|
watch: {glob: ['**/*.scss', '!docs.scss']}
|
||||||
})),
|
}),
|
||||||
new EsLint(gulp, docsPreset, docsConfig)
|
new EsLint(gulp, docsPreset, docsConfig)
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
new RollupIife(gulp, docsPreset, extend(true, {}, docsConfig, rollupConfig, {
|
new RollupIife(gulp, docsPreset, docsConfig, rollupConfig, {
|
||||||
options: {
|
options: {
|
||||||
dest: 'docs.iife.js',
|
dest: 'docs.iife.js',
|
||||||
moduleName: 'docs'
|
moduleName: 'docs'
|
||||||
}
|
}
|
||||||
})),
|
}),
|
||||||
new Uglify(gulp, docsPreset, extend(true, {}, docsConfig, {
|
new Uglify(gulp, docsPreset, docsConfig, {
|
||||||
task: {name: 'vendor:uglify'},
|
task: {name: 'vendor:uglify'},
|
||||||
source: {options: {cwd: 'docs/assets/js/vendor'}},
|
source: {options: {cwd: 'docs/assets/js/vendor'}},
|
||||||
options: {dest: 'docs-vendor.min.js'}
|
options: {dest: 'docs-vendor.min.js'}
|
||||||
})),
|
}),
|
||||||
new Sass(gulp, docsPreset, docsConfig)
|
new Sass(gulp, docsPreset, docsConfig)
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
let bsDocs = [
|
||||||
|
new Copy(gulp, docsPreset, docsConfig, {
|
||||||
|
task: {name: 'copy:bs-docs-content'},
|
||||||
|
source: {
|
||||||
|
options: {cwd: '../bootstrap/docs/content'},
|
||||||
|
glob: ['**/*']
|
||||||
|
},
|
||||||
|
dest: 'docs/content/',
|
||||||
|
process: (content, srcpath) => { // https://regex101.com/r/cZ7aO8/2
|
||||||
|
return content
|
||||||
|
.replace(/(---[\s\S]+?---)([\s\S]+)/mg, referenceDocNotice) // insert docs reference
|
||||||
|
.replace(/Fancy display heading/, 'Fancy heading') // remove sample text 'display' as this is a particular MD style and is confusing
|
||||||
|
}
|
||||||
|
})
|
||||||
|
]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user