Skip to content

Commit d9089f2

Browse files
jtrabandnaomiblack
authored andcommitted
shred and watch build tooling - v2 ( dgeni, gulp, jade)
1 parent 7e6ff55 commit d9089f2

File tree

7 files changed

+24
-239
lines changed

7 files changed

+24
-239
lines changed

gulpfile.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@ var shredOptions = {
1313
destDir: "_fragments"
1414
};
1515

16+
/*
17+
Within this repo generated files are checked in so that we can avoid running the
18+
shredder over the entire _examples dir each time someone refreshes the repo
19+
( the ‘shred-full’ gulp task). The gulp ‘serve-and-watch’ shredder is only
20+
a ‘partial’ shredder. It only shred’s files in directories changed during
21+
the current session.
22+
*/
23+
24+
1625
gulp.task('shred-full', ['shred-clean'], function() {
1726
docShredder.shred( shredOptions);
1827
});
@@ -73,4 +82,4 @@ function execCommands(cmds, options, cb) {
7382

7483

7584

76-
gulp.task('default', ['shred']);
85+
gulp.task('default', ['shred-full']);

public/_includes/_util-fns.jade

+4-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@
1717

1818
// HACK: to avoid having to include a path in makeTabs calls
1919
- var currentPath = current.path;
20-
// need to back up to 'docs'
20+
21+
// simple way to only take as many '../' sections as we need to back up to the 'docs' dir
22+
// from the current document
23+
// we will almost certainly never go 10 or 11 deep but ...
2124
- var pathToFrags = "../../../../../../../../../../../".substr(0, (currentPath.length-2)*3) + "_fragments/";
2225

2326
mixin makeTabs(path, fileNames, tabNames)

public/doc-shredder/regionExtractor.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module.exports = function regionExtractor() {
1313
var docStack = [];
1414
var doc = null;
1515
var nullLine = '###';
16-
var rx = new RegExp(nullLine + '\n', 'g');
16+
1717
lines.forEach(function(line, ix) {
1818
if (isCommentLine(line, commentPrefixes)) {
1919
if (hasRegionTag(line)) {
@@ -37,6 +37,7 @@ module.exports = function regionExtractor() {
3737
content = lines.slice(doc.startIx + 1).join('\n');
3838
}
3939
// eliminate all #docregion lines
40+
var rx = new RegExp(nullLine + '\n', 'g');
4041
doc.content = content.replace(rx, '');
4142

4243
});

public/doc-shredder/test/LICENSE

-201
This file was deleted.

public/doc-shredder/test/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Files in the `test_source` dir may not pass current coding conventions (such as missing EOF new lines). This is deliberate so that we can test
2+
the doc-shredder with edge conditions.

public/doc-shredder/test/package.json

-35
This file was deleted.

public/docs/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Why the _fragments dir is checked in
2+
3+
Within this repo files generated as a result of shredding the `_examples` dir ( the contents of the `_fragments` dir) are checked in so that we can avoid running the
4+
shredder over the entire `_examples` dir each time someone refreshes the repo ( the `shred-full` gulp task).
5+
The gulp `serve-and-watch` shredder is only a ‘partial’ shredder. It only shred’s files in directories changed during
6+
the current session.

0 commit comments

Comments
 (0)