# GitBook legacy v1

Устанавливаем таймзону:

`sudo dpkg-reconfigure tzdata`

Обновляем убунту:

`sudo apt update && sudo apt upgrade -y`

Устанавливаем пакеты:

`sudo apt install -y curl wget vim git unzip socat bash-completion apt-transport-https build-essential`

Устанавливаем Node.js:

```
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt install -y nodejs
```

Проверяем версии:

```bash
node -v && npm -v
# v10.15.1
# 6.4.1
```

Обновим npm:

`sudo npm install -g npm@latest`

Далее создаем директорию:

```
mkdir gitbook
cd gitbook
```

Сразу же сюда клонируем наш репозиторий с базой знаний.

Теперь установим гитбук глобально:

`sudo npm install gitbook-cli -g`

И установим его в текущую папку:

`gitbook init`

Создаем файл book.json, но можно обойтись и без него:

`vim book.json`

Со следующим содержимым

```javascript
{
    "root": "./docs",
    "title": "KB",
    "author": "syalsr",
    "description": "my knowledge and solutions",
    "plugins": [
        "folding-chapters-2",
        "theme-default",
        "hints",
        "splitter",
        "theme-code",
    "embed-pdf",
    "timeline",
        "code",
        "codetabs",
        "youtube",
        "-lunr", "-search", "search-plus",
        "addcssjs", 
        "favicon-plus", 
        "anchor-navigation-ex", 
        "github-buttons", 
        "last-modified", 
        "medium-zoom"],
    "pluginsConfig": {
        "fontsettings": {
            "theme":  "night",
            "family": "sans"
        },
          "anchor-navigation-ex": {
                "multipleH1": false
          },
        "github-buttons": {
          "buttons": [{
            "user": "dortania",
            "repo": "OpenCore-Desktop-Guide",
            "type": "star",
            "size": "large"
          }]
        },
        "intopic-toc": {
          "label": "Navigation"
        },
        "github-edit": {
            "repo": "syalsr/Knowledge_Base",
            "branch": "master"
        },
        "favicon": "/icons/favicon.ico",
        "appleTouchIconPrecomposed152": "/icons/appleTouchIconPrecomposed152.png",
        "output": "_book"
    },
        "links": {
          "sharing": {
            "google": false,
            "facebook": false,
            "twitter": false,
            "weibo": false,
            "all": false
        }
    },
    "medium-zoom": {
      "margin": 24,
      "background": "#363b40",
      "scrollOffset": 0
    },
    "pdf": {
        "pageNumbers": false,
        "fontSize": 12,
        "paperSize": "a4",
        "margin": {
            "right": 62,
            "left": 62,
            "top": 36,
            "bottom": 36
        },
        "headerTemplate": null,
        "footerTemplate": null
    }
}
```

Теперь устанавливаем плагины командой:

`gitbook install`

Переместим файлы README.md и SUMMARY.md, .md файлы, фотографии в папку docs и переходим в нее

Чтобы самостоятельно не создавать дерево нашей базы, усатновим плагин:

`npm install -g gitbook-summary`

Теперь запускаем его:

`book sm g`

Запускаем базу:

`gitbook serve`

По итогу все файлы(папка node\_modules, \_book и файла book.json) должны находиться в папке `{название нашего github репозитория}`. В папке docs находятся вся база + SUMMARY.md + README.md


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://syalsr.gitbook.io/ukae/it/operation-systems/linux/installation/gitbook.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
