MCPcopy
hub / github.com/GitbookIO/gitbook / indexArticleLevels

Function indexArticleLevels

lib/modifiers/summary/indexArticleLevels.js:9–21  ·  view source on GitHub ↗

Index levels in an article tree @param {Article} @param {String} baseLevel @return {Article}

(article, baseLevel)

Source from the content-addressed store, hash-verified

7 @return {Article}
8*/
9function indexArticleLevels(article, baseLevel) {
10 baseLevel = baseLevel || article.getLevel();
11 var articles = article.getArticles();
12
13 articles = articles.map(function(inner, i) {
14 return indexArticleLevels(inner, baseLevel + '.' + (i + 1));
15 });
16
17 return article.merge({
18 level: baseLevel,
19 articles: articles
20 });
21}
22
23module.exports = indexArticleLevels;

Callers 3

indexPartLevelsFunction · 0.85
insertArticleFunction · 0.85
removeArticleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…