From e7a2c3456145599d96140a7c5ccd973842cf5863 Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Tue, 14 Jun 2016 12:12:34 -0700 Subject: [PATCH] docs(util-fns): generalize getExampleName() --- public/_includes/_util-fns.jade | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/_includes/_util-fns.jade b/public/_includes/_util-fns.jade index ac4f76d92f..396bfa35df 100644 --- a/public/_includes/_util-fns.jade +++ b/public/_includes/_util-fns.jade @@ -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)