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

docs(util-fns): generalize getExampleName() #1666

Closed
Closed
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
5 changes: 3 additions & 2 deletions public/_includes/_util-fns.jade
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,11 @@ mixin makeExcerpt(_filePath, _region, _title, stylePatterns)
- if (title) title = title + ' (' + excerpt + ')';
+makeExample(filePath, region, title, stylePatterns)(format='.')

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

mixin makeTabs(filePaths, regions, tabNames, stylePatterns)
Expand Down