MCPcopy Index your code
hub / github.com/GitbookIO/gitbook / parseLanguages

Function parseLanguages

lib/parse/parseLanguages.js:10–26  ·  view source on GitHub ↗

Parse languages list from book @param {Book} book @return {Promise }

(book)

Source from the content-addressed store, hash-verified

8 @return {Promise<Book>}
9*/
10function parseLanguages(book) {
11 var logger = book.getLogger();
12
13 return parseStructureFile(book, 'langs')
14 .spread(function(file, result) {
15 if (!file) {
16 return book;
17 }
18
19 var languages = Languages.createFromList(file, result);
20
21 logger.debug.ln('languages index file found at', file.getPath());
22 logger.info.ln('parsing multilingual book, with', languages.getList().size, 'languages');
23
24 return book.set('languages', languages);
25 });
26}
27
28module.exports = parseLanguages;

Callers

nothing calls this directly

Calls 1

parseStructureFileFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…