diff options
author | Samy Pesse <samypesse@gmail.com> | 2016-05-08 11:08:27 +0200 |
---|---|---|
committer | Samy Pesse <samypesse@gmail.com> | 2016-05-08 11:08:27 +0200 |
commit | c7864927ecdfce09e29488a97358b797dcfdcfa3 (patch) | |
tree | 6b9475b2a04c4bd4282a302c61c39c3d53111f6c /lib/api | |
parent | 54956de59f1a3a5796b4a3665d36c08cba91bf4d (diff) | |
download | gitbook-c7864927ecdfce09e29488a97358b797dcfdcfa3.zip gitbook-c7864927ecdfce09e29488a97358b797dcfdcfa3.tar.gz gitbook-c7864927ecdfce09e29488a97358b797dcfdcfa3.tar.bz2 |
Add method summary.getArticleByPath to summary api
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/encodeSummary.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/api/encodeSummary.js b/lib/api/encodeSummary.js index 2bb8d11..f1a7d97 100644 --- a/lib/api/encodeSummary.js +++ b/lib/api/encodeSummary.js @@ -31,6 +31,17 @@ function encodeSummary(output, summary) { getArticleByLevel: function(level) { var article = summary.getByLevel(level); return (article? encodeSummaryArticle(article) : undefined); + }, + + /** + Get an article by its path + + @param {String} level + @return {Object} + */ + getArticleByPath: function(level) { + var article = summary.getByPath(level); + return (article? encodeSummaryArticle(article) : undefined); } }; |