refact(doc-shredder): move into `tools` folder
This commit is contained in:
parent
a06b98ba75
commit
ce298009e6
|
@ -37,8 +37,9 @@ gulp.task('watch', function (cb) {
|
|||
gulp.task('map', function() {
|
||||
var options = {
|
||||
jadeDir: 'test_jade',
|
||||
examplesDir: 'test_source',
|
||||
apiExamplesDir: 'test_source',
|
||||
fragmentsDir: 'test_fragments',
|
||||
devguideExamplesDir: 'test_source',
|
||||
outputDir: '.'
|
||||
}
|
||||
return docShredder.buildShredMap(options).then(function(x) {
|
|
@ -33,11 +33,11 @@ include ../../../../_includes/_util-fns
|
|||
|
||||
In the `<body>`, add an element called `<my-app>` that will be the root of your
|
||||
application.
|
||||
|
||||
|
||||
The TypeScript setup includes System.js, a third-party open-source library that adds ES6 module loading functionality to browsers. This step isn't needed for the ES5 version.
|
||||
|
||||
+makeTabs('gettingstarted', 'ts/index2.html,js/index.html', 'TypeScript, JavaScript')
|
||||
|
||||
|
||||
.callout.is-helpful
|
||||
header Don't use code.angularjs.org in a live app
|
||||
:markdown
|
|
@ -62,11 +62,11 @@ function createShredPackage(shredOptions) {
|
|||
var options = resolveShredOptions(shredOptions);
|
||||
|
||||
initializePackage(pkg)
|
||||
.factory(require('./fileShredder'))
|
||||
.processor(require('./mdWrapperProcessor'))
|
||||
.factory(require('./fileReaders/regionFileReader'))
|
||||
.processor(require('./processors/renderAsMarkdownProcessor'))
|
||||
|
||||
.config(function(readFilesProcessor, fileShredder ) {
|
||||
readFilesProcessor.fileReaders = [ fileShredder];
|
||||
.config(function(readFilesProcessor, regionFileReader) {
|
||||
readFilesProcessor.fileReaders = [regionFileReader];
|
||||
})
|
||||
// default configs - may be overriden
|
||||
.config(function(readFilesProcessor) {
|
||||
|
@ -106,8 +106,8 @@ var createShredMapPackage = function(mapOptions) {
|
|||
var options = resolveMapOptions(mapOptions);
|
||||
|
||||
initializePackage(pkg)
|
||||
.factory(require('./extractPathsReader'))
|
||||
.processor(require('./shredMapProcessor'))
|
||||
.factory(require('./fileReaders/extractPathsReader'))
|
||||
.processor(require('./processors/shredMapProcessor'))
|
||||
.config(function(shredMapProcessor) {
|
||||
shredMapProcessor.options = options;
|
||||
})
|
||||
|
@ -180,11 +180,12 @@ var createShredMapPackage = function(mapOptions) {
|
|||
}
|
||||
|
||||
function resolveShredOptions(shredOptions) {
|
||||
var DOCS_FOLDER = '../../public/docs';
|
||||
var so = _.defaults({}, shredOptions, {
|
||||
// read files from any subdir under here
|
||||
examplesDir: "./docs/_examples",
|
||||
examplesDir: path.join(DOCS_FOLDER, "_examples"),
|
||||
// shredded files get copied here with same subdir structure.
|
||||
fragmentsDir: "./docs/_fragments",
|
||||
fragmentsDir: path.join(DOCS_FOLDER, "_fragments"),
|
||||
// whether to include subdirectories when shredding.
|
||||
includeSubdirs: true
|
||||
});
|
|
@ -1,13 +1,13 @@
|
|||
var regionExtractor = require('./regionExtractor');
|
||||
var regionExtractor = require('../regionExtractor');
|
||||
var buildRegionDocs = regionExtractor.buildRegionDocs;
|
||||
|
||||
/**
|
||||
* @dgService htmlFileShredder
|
||||
* @dgService
|
||||
* @description
|
||||
*/
|
||||
module.exports = function fileShredder(log ) {
|
||||
module.exports = function regionFileReader(log ) {
|
||||
return {
|
||||
name: 'fileShredder',
|
||||
name: 'regionFileReader',
|
||||
|
||||
getDocs: function (fileInfo) {
|
||||
// log.info("fileShredder processing: " + fileInfo.relativePath);
|
|
@ -1,9 +1,9 @@
|
|||
/**
|
||||
* dgProcessor shredderProcessor
|
||||
* dgProcessor
|
||||
* @description
|
||||
*
|
||||
*/
|
||||
module.exports = function mdWrapperProcessor(log) {
|
||||
module.exports = function renderAsMarkdownProcessor() {
|
||||
return {
|
||||
$runAfter: ['readFilesProcessor'],
|
||||
$runBefore: ['writing-files'],
|
Loading…
Reference in New Issue