Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixes #13 - Module names can contain a slash

  • Loading branch information...
commit bf0cf2e4434f0edaf72dc03ef74e8a24ee9746b7 1 parent c247643
@davglass davglass authored
View
9 lib/builder.js
@@ -298,9 +298,9 @@ YUI.add('doc-builder', function(Y) {
opts.meta.modules = [];
opts.meta.allModules = [];
Y.each(this.data.modules, function(v) {
- opts.meta.allModules.push({ displayName: v.name, name: v.name, description: v.description });
+ opts.meta.allModules.push({ displayName: v.displayName || v.name, name: self.filterFileName(v.name), description: v.description });
if (!v.is_submodule) {
- var o = { displayName: v.name, name: v.name };
+ var o = { displayName: v.displayName || v.name, name: self.filterFileName(v.name) };
if (v.submodules) {
o.submodules = [];
Y.each(v.submodules, function(i, k) {
@@ -576,13 +576,15 @@ YUI.add('doc-builder', function(Y) {
var stack = new Y.Parallel();
Y.log('Writing (' + Object.keys(self.data.modules).length + ') module pages', 'info', 'builder');
Y.each(this.data.modules, function(v) {
+ v.displayName = v.name;
+ v.name = self.filterFileName(v.name);
Y.prepare(themeDir, self.getProjectMeta(), function(err, opts) {
opts.meta = Y.merge(opts.meta, v);
//opts.meta.htmlTitle = v.name + ': ' + self.data.project.name;
opts.meta.title = self.data.project.name;
- opts.meta.moduleName = v.name;
+ opts.meta.moduleName = v.displayName || v.name;
opts.meta.moduleDescription = self._parseCode(markdown(v.description || ' '));
opts.meta.file = v.file;
opts.meta.line = v.line;
@@ -1026,6 +1028,7 @@ YUI.add('doc-builder', function(Y) {
opts = this.populateClasses(opts);
opts = this.populateModules(opts);
+
['classes', 'modules'].forEach(function(id) {
opts.meta[id].forEach(function(v, k) {
opts.meta[id][k] = v.name;
View
16 tests/test2/slashes.js
@@ -0,0 +1,16 @@
+/**
+* This is a module with slashes in the name
+* @module myapp/views/index
+*/
+
+/**
+* This is the main class
+* @class Main
+* @constructor
+*/
+
+/**
+* Static Property
+* @property STATIC
+* @static
+*/
View
10 themes/default/assets/js/api-filter.js
@@ -5,6 +5,16 @@ Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
initializer: function () {
this._bindUIACBase();
this._syncUIACBase();
+ },
+ getDisplayName: function(name) {
+
+ Y.each(Y.YUIDoc.meta.allModules, function(i) {
+ if (i.name === name && i.displayName) {
+ name = i.displayName;
+ }
+ });
+
+ return name;
}
}, {
View
2  themes/default/assets/js/api-list.js
@@ -106,7 +106,7 @@ function onFilterResults(e) {
YArray.each(e.results, function (result) {
frag.append(Lang.sub(LIST_ITEM_TEMPLATE, {
rootPath : APIList.rootPath,
- displayName : result.highlighted,
+ displayName : filter.getDisplayName(result.highlighted),
name : result.text,
typePlural : typePlural,
typeSingular: typeSingular
Please sign in to comment.
Something went wrong with that request. Please try again.