Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit e7a2c34

Browse files
committed
docs(util-fns): generalize getExampleName()
1 parent a843310 commit e7a2c34

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

public/_includes/_util-fns.jade

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,11 @@ mixin makeExcerpt(_filePath, _region, _title, stylePatterns)
100100
- if (title) title = title + ' (' + excerpt + ')';
101101
+makeExample(filePath, region, title, stylePatterns)(format='.')
102102

103-
//- Extract the doc example name from `current`.
103+
//- Get the doc example name either from `_example` if set, or
104+
//- extract the example name from `current`.
104105
- var getExampleName = function() {
105106
- var dir = current.path[current.path.length - 1];
106-
- return dir == 'latest' ? current.source : dir;
107+
- return _example ? _example : dir == 'latest' ? current.source : dir;
107108
- };
108109

109110
mixin makeTabs(filePaths, regions, tabNames, stylePatterns)

0 commit comments

Comments
 (0)