Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ module.exports = new Package('angular-md', [
.config(function(readFilesProcessor, writeFilesProcessor) {
readFilesProcessor.basePath = projectPath;
readFilesProcessor.sourceFiles = [
{ include: 'dist/angular-material.js', basePath: 'dist' },
{ include: 'src/components/**/*.js', basePath: '.' },
{ include: 'src/core/**/*.js', basePath: '.' },
{ include: 'docs/content/**/*.md', basePath: 'docs/content', fileReader: 'ngdocFileReader' }
];

Expand Down
41 changes: 20 additions & 21 deletions docs/config/processors/componentsData.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,34 @@ var buildConfig = require('../../../config/build.config.js');
// We don't need to publish all of a doc's data to the app, that will
// add many kilobytes of loading overhead.
function publicDocData(doc, extraData) {
var githubBaseUrl = buildConfig.repository + '/blob/master/src/components/';
doc = doc || {};
var jsName = doc.module.split('material.components.').pop();
return _.assign({
name: doc.name,
type: doc.docType,
outputPath: doc.outputPath,
url: doc.path,
label: doc.label || doc.name,
hasDemo: (doc.docType === 'directive'),
module: doc.module,
githubUrl: githubBaseUrl + jsName + '/' + jsName + '.js'
}, extraData || {});
var options = _.assign(extraData || {}, { hasDemo: (doc.docType === 'directive') });
return buildDocData(doc, options, 'components');
}

function coreServiceData(doc, extraData) {
var githubBaseUrl = buildConfig.repository + '/blob/master/src/core/services/';
doc = doc || {};
var jsName = doc.module.split('material.core.').pop();
var options = _.assign(extraData || {}, { hasDemo: false });
return buildDocData(doc, options, 'core');
}

function buildDocData(doc, extraData, descriptor) {
var module = 'material.' + descriptor;
var githubBaseUrl = buildConfig.repository + '/blob/master/src/' + descriptor + '/';
var jsName = doc.module.split(module + '.').pop();

var basePathFromProjectRoot = 'src/' + descriptor + '/';
var filePath = doc.fileInfo.filePath;
var indexOfBasePath = filePath.indexOf(basePathFromProjectRoot);
var path = filePath.substr(indexOfBasePath + basePathFromProjectRoot.length, filePath.length);

return _.assign({
name: doc.name,
type: doc.docType,
outputPath: doc.outputPath,
url: doc.path,
label: doc.label || doc.name,
hasDemo: false,
module: 'material.core',
githubUrl: githubBaseUrl + '/' + jsName + '.js'
}, extraData || {});
module: module,
githubUrl: githubBaseUrl + path
}, extraData);
}

module.exports = function componentsGenerateProcessor(log, moduleMap) {
Expand Down Expand Up @@ -74,6 +73,7 @@ module.exports = function componentsGenerateProcessor(log, moduleMap) {
.value();

var EXPOSED_CORE_SERVICES = '$mdMedia';

var services = _(docs).filter(function(doc) {
return doc.docType == 'service' &&
doc.module == 'material.core' &&
Expand All @@ -95,4 +95,3 @@ module.exports = function componentsGenerateProcessor(log, moduleMap) {
});
}
};