Skip to content

Commit 40bdce6

Browse files
committed
doc(examples): init
1 parent e09e621 commit 40bdce6

File tree

13 files changed

+309
-22
lines changed

13 files changed

+309
-22
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434

3535
- name: Publish to Maven Central
3636
run: |
37-
./mvnw -B clean deploy -PsonatypeRelease -DskipTests -pl '!jacoco-coverage-aggregate-report'
37+
./mvnw -B clean deploy -PsonatypeRelease -DskipTests -pl '!jacoco-coverage-aggregate-report,!documentation'
3838
env:
3939
MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USER }}
4040
MAVEN_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}

.github/workflows/snapshot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727

2828
- name: Publish Snapshot to Maven Central
2929
run: |
30-
./mvnw -B clean deploy -PsonatypeSnapshot -DskipTests -pl '!jacoco-coverage-aggregate-report'
30+
./mvnw -B clean deploy -PsonatypeSnapshot -DskipTests -pl '!jacoco-coverage-aggregate-report,!documentation'
3131
env:
3232
MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USER }}
3333
MAVEN_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ workbench.xmi
2323
.factorypath
2424
documentation/venv
2525
documentation/site
26+
documentation/target

documentation/README.md

Lines changed: 83 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,99 @@
1-
## Documentation
1+
## Документация
22

3-
### Local Build
3+
### Локальная сборка документации
44

5-
To deploy the site locally on the current branch/tag:
5+
Чтобы собрать документацию локально на текущей ветке/теге:
66

7-
1. ```bash
7+
1. Перейдите на ветку/тег и инициализируйте python-окружение:
8+
9+
```shell
810
git checkout <branch/tag>
9-
```
10-
2. ```bash
1111
cd documentation
12-
```
13-
3. ```bash
1412
python3 -m venv venv
15-
```
16-
4. ```bash
1713
source venv/bin/activate
18-
```
19-
5. ```bash
2014
pip install -r requirements.txt
2115
```
22-
6. ```bash
23-
mkdocs serve
16+
17+
2. Соберите или запустите сайт:
18+
19+
```shell
20+
mkdocs build
21+
```
22+
23+
```shell
24+
mkdocs serve
2425
```
2526

26-
### Schemas
27+
### Интернационализация
28+
29+
На данный момент документация поддерживает два языка:
30+
31+
- Русский 🇷🇺 - по умолчанию
32+
- Английский 🇺🇸
33+
34+
### Правила написания новых страниц и разделов
35+
36+
#### Раздел
37+
38+
`Раздел` - группа страниц, описывающая одну конкретную тему. Раздел может включать подразделы.
39+
Раздел оформаляется в отдельной директории. Каждый раздел обязан иметь страницу с именем `index.md`,
40+
в которой описывается тематика раздела.
41+
42+
`Страница` - страница с произвольным именем и расширением `.md`, написанная на `markdown`.
43+
44+
При добавлении страницы и раздела, добавьте их в секцию `nav` в файле `mkdocs.yml`:
2745

28-
Documentation supports `.drawio` format schemas. Place your schema in the `assets` directory. In the markdown text,
29-
refer to the schema as a regular markdown image. The path to the image must be relative:
46+
Пример раздела:
47+
48+
> ![alt](readme-images/sections.png)
49+
50+
Пример оформленной навигации для этого раздела:
51+
52+
> ![alt](readme-images/navigation.png)
53+
54+
### Схемы
55+
56+
#### Plantuml
57+
58+
Документация поддерживает рендеринг `plantuml-диаграмм`. Для того чтобы добавить схему plantuml в
59+
текст страницы `markdown` используйте блок кода с расширением `puml`:
60+
61+
> \`\`\`puml
62+
>
63+
> @startuml
64+
>
65+
> Alice -> Bob: test
66+
>
67+
> @enduml
68+
>
69+
> \`\`\`
70+
71+
#### Drawio
72+
73+
Документация поддерживает отображение схем, написанных в `drawio` (файлы с расширением `.drawio`).
74+
Необходимо добавить схему в директорию `assets`. В тексте markdown добавьте схему также как
75+
добавляете обыное изображение, используя относительный путь:
3076

3177
```markdown
3278
![](../../../../assets/<some-paths>/schema.drawio)
3379
```
80+
81+
### Code Snippets
82+
83+
Документация поддерживает добавление в текст markdown включение текста из других файлов (snippets).
84+
Для того, чтобы добавить snippet в текст markdown изучите
85+
документацию [расширения](https://facelessuser.github.io/pymdown-extensions/extensions/snippets/).
86+
Путь к файлам, которые будут включены вычисляется относительно директории
87+
`docs/documentation/examples`.
88+
89+
#### Дополнительные возможности
90+
91+
Также поддерживаются следующие дополнения:
92+
93+
- Использование [emoji](https://squidfunk.github.io/mkdocs-material/reference/icons-emojis/) в
94+
тексте страниц.
95+
- [Табы](https://squidfunk.github.io/mkdocs-material/reference/content-tabs/)
96+
- [Сноски](https://squidfunk.github.io/mkdocs-material/reference/footnotes/)
97+
- [Диаграммы mermaid](https://squidfunk.github.io/mkdocs-material/reference/diagrams/)
98+
- [Admonitions](https://squidfunk.github.io/mkdocs-material/reference/admonitions/)
99+
- [Аннотации](https://squidfunk.github.io/mkdocs-material/reference/annotations/)

documentation/README_EN.md

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
## Documentation
2+
3+
### Local documentation deploy
4+
5+
To deploy documentation locally on current branch/tag:
6+
7+
1. Checkout branch/tag and initialize python-environment:
8+
9+
```shell
10+
git checkout <branch/tag>
11+
cd documentation
12+
python3 -m venv venv
13+
source venv/bin/activate
14+
pip install -r requirements.txt
15+
```
16+
17+
2. Build or serve site:
18+
19+
```shell
20+
mkdocs build
21+
```
22+
23+
```shell
24+
mkdocs serve
25+
```
26+
27+
### Internationalization
28+
29+
Documentation supports two languages:
30+
31+
- Russian 🇷🇺 - by default
32+
- English 🇺🇸
33+
34+
### New pages writing rules
35+
36+
#### Section
37+
38+
`Section` is group of pages, describing one certain topic. Section can include subsections. Write
39+
section on separate directory. Each section must have page with `index.md` name that describe topic
40+
area.
41+
42+
`Page` is page with any name and `.md` extension.
43+
44+
When a new section and page are being written, they should be added to the `nav` section in the
45+
`mkdocs.yml` file.
46+
47+
Section example:
48+
49+
> ![alt](readme-images/sections.png)
50+
51+
Example of a decorated navigation for this section:
52+
53+
> ![alt](readme-images/navigation.png)
54+
55+
### Схемы
56+
57+
#### Plantuml
58+
59+
The documentation supports the rendering of `plantuml diagrams`. To add the plantuml schema to the
60+
text of the `markdown` page, use a block of code with the `puml` extension.:
61+
62+
> \`\`\`puml
63+
>
64+
> @startuml
65+
>
66+
> Alice -> Bob: test
67+
>
68+
> @enduml
69+
>
70+
> \`\`\`
71+
72+
#### Drawio
73+
74+
The documentation supports the display of diagrams written in `drawio` (files with the `.drawio`
75+
extension). It is necessary to add the schema to the `assets` directory. In the Markdown text, add a
76+
diagram in the same way as you add an image using a relative path:
77+
78+
```markdown
79+
![](../../../../assets/<some-paths>/schema.drawio)
80+
```
81+
82+
### Code Snippets
83+
84+
The documentation supports adding text inclusions from other files (snippets) to the Markdown text.
85+
To add snippet to the Markdown text, read the
86+
extension's [documentation](https://facelessuser.github.io/pymdown-extensions/extensions/snippets/).
87+
The path to the files to be included is calculated relative to the `docs/documentation/examples`
88+
directory.
89+
90+
#### Additional extensions
91+
92+
- Usage of [emoji](https://squidfunk.github.io/mkdocs-material/reference/icons-emojis/) in Markdown
93+
pages
94+
- [Tabs of content](https://squidfunk.github.io/mkdocs-material/reference/content-tabs/)
95+
- [Footnotes](https://squidfunk.github.io/mkdocs-material/reference/footnotes/)
96+
- [Mermaid diagrams](https://squidfunk.github.io/mkdocs-material/reference/diagrams/)
97+
- [Admonitions](https://squidfunk.github.io/mkdocs-material/reference/admonitions/)
98+
- [Annotations](https://squidfunk.github.io/mkdocs-material/reference/annotations/)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: Подключение к узлам
3+
hide:
4+
- toc
5+
---
6+
7+
В данном разделе приводятся примеры подключения к Tarantool с помощью `tarantool-java-sdk`.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
title: Примеры использования
3+
hide:
4+
- toc
5+
---
6+
7+
В разделе приводятся примеры использования `tarantool-java-sdk`.
8+
9+
???+ note "Заметка"
10+
11+
Где это возможно, производится сравнение кода с
12+
[cartridge-java](https://github.com/tarantool/cartridge-java)

documentation/mkdocs.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,14 @@ plugins:
4141
Одиночный узел: Single Node
4242
Кластер TarantoolDB: TarantoolDB Cluster
4343
Кластер TQE: TQE Cluster
44+
Примеры использования: Usage examples
45+
Подключение к узлам: Connecting to nodes
4446
- drawio:
4547
darkmode: true
4648
- plantuml:
4749
puml_url: https://www.plantuml.com/plantuml/
50+
# в секундах(in seconds)
51+
request_timeout: 300
4852

4953
theme:
5054
features:
@@ -118,6 +122,8 @@ nav:
118122
- documentation/client/arch/connection-to-multiple-nodes.md
119123
- documentation/client/arch/call.md
120124
- documentation/client/arch/tuple_pojo_mapping.md
125+
- Примеры использования:
126+
- documentation/client/examples/index.md
121127
- Tarantool Testcontainers:
122128
- documentation/testcontainers/index.md
123129
- Одиночный узел:
@@ -139,7 +145,6 @@ markdown_extensions:
139145
- tables
140146
- admonition
141147
- pymdownx.details
142-
- pymdownx.superfences
143148
- pymdownx.tabbed:
144149
alternate_style: true
145150
- footnotes
@@ -154,10 +159,17 @@ markdown_extensions:
154159
line_spans: __spanz
155160
pygments_lang_class: true
156161
- pymdownx.inlinehilite
157-
- pymdownx.snippets
162+
- pymdownx.snippets:
163+
check_paths: true
164+
base_path: docs/documentation/examples
158165
- def_list
159166
- pymdownx.tasklist:
160167
custom_checkbox: true
168+
- pymdownx.superfences:
169+
custom_fences:
170+
- name: mermaid
171+
class: mermaid
172+
format: !!python/name:pymdownx.superfences.fence_code_format
161173

162174
exclude_docs: |
163175
venv

0 commit comments

Comments
 (0)