2021-04-21 02:43:11 +08:00
|
|
|
/**
|
|
|
|
* Настройки docsify
|
|
|
|
* https://docsify.js.org/#/ru-ru/configuration
|
|
|
|
*
|
|
|
|
*/
|
2021-04-20 23:22:57 +08:00
|
|
|
window.$docsify = {
|
|
|
|
name: 'Linux для себя',
|
|
|
|
repo: 'https://github.com/Linux4Yourself/Linux4Yourself.Book',
|
|
|
|
coverpage: false,
|
|
|
|
loadSidebar: true,
|
2021-04-22 00:33:21 +08:00
|
|
|
maxLevel: 2,
|
|
|
|
subMaxLevel: 3,
|
2021-04-20 23:22:57 +08:00
|
|
|
auto2top: true,
|
2021-06-16 23:39:44 +08:00
|
|
|
homepage: './index.md',
|
2021-04-20 23:22:57 +08:00
|
|
|
autoHeader: true,
|
|
|
|
executeScript: true,
|
2021-05-03 16:05:28 +08:00
|
|
|
mergeNavbar: true,
|
2021-06-03 18:59:35 +08:00
|
|
|
el: '#main',
|
2021-04-20 23:22:57 +08:00
|
|
|
notFoundPage: {
|
|
|
|
'/': '_404.md',
|
|
|
|
},
|
|
|
|
search: {
|
|
|
|
placeholder: 'Поиск',
|
2021-04-22 00:33:21 +08:00
|
|
|
},
|
|
|
|
alias: {
|
|
|
|
'/.*/_sidebar.md': '/_sidebar.md',
|
|
|
|
},
|
2021-04-22 01:35:37 +08:00
|
|
|
copyCode: {
|
|
|
|
buttonText: 'Скопировать в буфер обмена',
|
|
|
|
errorText: 'Ошибка',
|
|
|
|
successText: 'Текст скопирован в буфер обмена'
|
2021-05-03 16:05:28 +08:00
|
|
|
},
|
|
|
|
requestHeaders: {
|
|
|
|
'cache-control': 'max-age=0',
|
|
|
|
},
|
2021-05-22 21:48:47 +08:00
|
|
|
// https://github.com/imyelo/docsify-pagination
|
|
|
|
pagination: {
|
|
|
|
previousText: 'Назад',
|
|
|
|
nextText: 'Вперёд',
|
|
|
|
crossChapter: true,
|
|
|
|
crossChapterText: true,
|
|
|
|
},
|
2021-04-20 23:22:57 +08:00
|
|
|
}
|
2021-04-21 02:43:11 +08:00
|
|
|
|
|
|
|
// Секция локальной настройки для содержания книги.
|
|
|
|
book = {
|
|
|
|
// ревизия книги. (develop | release | tag (releases/v.0.0.1))
|
|
|
|
// выставить в релизной ветке.
|
2021-06-21 20:45:15 +08:00
|
|
|
revision: 'develop',
|
2021-06-21 21:04:56 +08:00
|
|
|
revisionShort: 'dev',
|
2021-04-21 23:10:38 +08:00
|
|
|
}
|
2021-04-25 17:55:33 +08:00
|
|
|
|
2021-06-10 00:03:59 +08:00
|
|
|
const exrtraUrl = `${book.revisionShort}-extra/#/`;
|
|
|
|
|
2021-04-25 17:55:33 +08:00
|
|
|
// источник метаданных пакетов.
|
2021-07-09 04:40:39 +08:00
|
|
|
const pkgsUrlBase = `packages/core`;
|
2021-06-03 18:59:35 +08:00
|
|
|
const pkgsSrc = `${pkgsUrlBase}/packages.json`;
|
2021-05-23 02:09:25 +08:00
|
|
|
const wgetList = `${pkgsUrlBase}/wget-list`;
|
2021-06-03 18:59:35 +08:00
|
|
|
const md5Sums = `${pkgsUrlBase}/md5sums`;
|
2021-04-25 17:55:33 +08:00
|
|
|
|
|
|
|
// Получить список всех пакетов из источника.
|
|
|
|
getPackages = function () {
|
|
|
|
return axios.get(pkgsSrc);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Получить пакет по наименованию
|
|
|
|
getPackage = function (name) {
|
|
|
|
return axios.get(pkgsSrc)
|
2021-06-03 18:59:35 +08:00
|
|
|
.then(response => (response.data.filter(pkg => pkg.name === name))[0]);
|
|
|
|
}
|
|
|
|
|
|
|
|
getPackageScript = function (name, script) {
|
|
|
|
return axios.get(`${pkgsUrlBase}/${name}/${script}`, {
|
|
|
|
responseType: 'text'
|
|
|
|
})
|
|
|
|
.then(response => response.data);
|
2021-04-25 17:55:33 +08:00
|
|
|
}
|