Skip to content

Commit 897ffa0

Browse files
Documentation hosting on Github Pages (#11)
Before this PR, the only way to access the documentation was by browsing through the repository's markdown files. Using the mkdocs framework, an alternative way was created to view documentation as a website. This patch contains: - Mkdocs config file `mkdocs.yml`. - Small corrections in .md files for more correct rendering on the website. - Custom hooks before site build to ensure .md file links remain accurate in both the website and repository versions of the docs. - CI workflow to deploy the documentation site to GitHub Pages. To check how the site looks locally, you need to: ``` make doc ``` Open documentation on http://localhost:8000/ Important: - In the repository settings, set the Github Actions source for Github Pages. Settings -> Pages -> Build and deployment: "GitHub Actions" - The documentation is deployed in the `github-pages` environment. You can set up rules for each environment (for example, a timer for deferred deployment) Settings -> Environment -> [env-name] Co-authored-by: Vladimir Severov <[email protected]>
1 parent 30e6d42 commit 897ffa0

File tree

24 files changed

+454
-19
lines changed

24 files changed

+454
-19
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ on:
1212
push:
1313
branches: ["master"]
1414

15+
concurrency:
16+
group: "${{ github.workflow }}-${{ github.ref_name }}"
17+
cancel-in-progress: "${{ github.ref_name != github.event.repository.default_branch }}"
18+
1519
jobs:
1620
create-semantic-tag:
1721
runs-on: "ubuntu-latest"
@@ -62,3 +66,7 @@ jobs:
6266
uses: "./.github/workflows/release.yml"
6367
with:
6468
release_name: "${{ needs.create-semantic-tag.outputs.RELEASE_VERSION }}"
69+
70+
deploy-docs:
71+
needs: ["release-latest"]
72+
uses: "./.github/workflows/doc.yml"

.github/workflows/doc.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: "Documentation"
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
deploy:
8+
permissions:
9+
pages: "write"
10+
id-token: "write"
11+
environment:
12+
name: "github-pages"
13+
url: ${{ steps.deployment.outputs.page_url }}
14+
runs-on: "ubuntu-latest"
15+
steps:
16+
- uses: "actions/checkout@v4"
17+
18+
- name: "Set up Python"
19+
uses: "actions/setup-python@v5"
20+
with:
21+
python-version: '3.x'
22+
23+
- name: "Install requirements"
24+
run: "make doc/prepare"
25+
26+
- name: "Build site"
27+
run: "make doc/build"
28+
29+
- name: "Upload artifact"
30+
uses: "actions/upload-pages-artifact@v3"
31+
with:
32+
path: "./site"
33+
34+
- name: "Deploy to GitHub Page"
35+
id: "deployment"
36+
uses: "actions/deploy-pages@v4"

.gitignore

Lines changed: 111 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ config/*
1616
!config/config.yml
1717
!config/models.yml
1818

19-
### Go template
19+
### Go
2020

2121
# Binaries for programs and plugins
2222
*.exe
@@ -37,6 +37,116 @@ vendor/
3737
# Go workspace file
3838
go.work
3939

40+
### Python
41+
42+
# Byte-compiled / optimized / DLL files
43+
__pycache__/
44+
*.py[cod]
45+
*$py.class
46+
47+
# Distribution / packaging
48+
.Python
49+
develop-eggs/
50+
dist/
51+
downloads/
52+
eggs/
53+
.eggs/
54+
lib/
55+
lib64/
56+
parts/
57+
sdist/
58+
var/
59+
wheels/
60+
share/python-wheels/
61+
*.egg-info/
62+
.installed.cfg
63+
*.egg
64+
MANIFEST
65+
66+
# Installer logs
67+
pip-log.txt
68+
pip-delete-this-directory.txt
69+
70+
# Translations
71+
*.mo
72+
*.pot
73+
74+
# IPython
75+
profile_default/
76+
ipython_config.py
77+
78+
# pyenv
79+
# For a library or package, you might want to ignore these files since the code is
80+
# intended to run in multiple environments; otherwise, check them in:
81+
.python-version
82+
83+
# pipenv
84+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
85+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
86+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
87+
# install all needed dependencies.
88+
Pipfile.lock
89+
90+
# poetry
91+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
92+
# This is especially recommended for binary packages to ensure reproducibility, and is more
93+
# commonly ignored for libraries.
94+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
95+
poetry.lock
96+
97+
# pdm
98+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
99+
pdm.lock
100+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
101+
# in version control.
102+
# https://pdm.fming.dev/#use-with-ide
103+
.pdm.toml
104+
105+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
106+
__pypackages__/
107+
108+
# Celery stuff
109+
celerybeat-schedule
110+
celerybeat.pid
111+
112+
# SageMath parsed files
113+
*.sage.py
114+
115+
# Environments
116+
.env
117+
.venv
118+
env/
119+
venv/
120+
ENV/
121+
env.bak/
122+
venv.bak/
123+
124+
# mkdocs documentation
125+
/site
126+
127+
# mypy
128+
.mypy_cache/
129+
.dmypy.json
130+
dmypy.json
131+
132+
# Pyre type checker
133+
.pyre/
134+
135+
# pytype static type analyzer
136+
.pytype/
137+
138+
# Cython debug symbols
139+
cython_debug/
140+
141+
# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration
142+
poetry.toml
143+
144+
# ruff
145+
.ruff_cache/
146+
147+
# LSP config files
148+
pyrightconfig.json
149+
40150
### VSCode
41151

42152
.vscode

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ test/performance:
2424

2525
include ./build/package/Makefile
2626
include ./build/ci/Makefile
27+
include ./doc/build/Makefile

README.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,46 @@
1+
<div class="hide-in-mkdocs">
2+
13
# Synthetic Data Values Generator (SDVG)
24

5+
</div>
6+
37
[![Release][release-badge]][release-url]
48
[![Pre-release][pre-release-badge]][pre-release-url]
59
[![CI][actions-badge]][actions-url]
610
[![Coverage Status][test-coverage-badge]][test-coverage-url]
711
[![Language][language-badge]][language-url]
812
[![License][license-badge]][license-url]
913

10-
[release-badge]: https://img.shields.io/github/v/release/tarantool/sdvg
14+
[release-badge]: https://badgen.net/github/release/tarantool/sdvg/stable?color=pink
1115
[release-url]: https://github.com/tarantool/sdvg/releases/latest/
12-
[pre-release-badge]: https://img.shields.io/badge/pre--release-latest-orange
16+
[pre-release-badge]: https://badgen.net/static/pre-release/latest/orange?color=purple
1317
[pre-release-url]: https://github.com/tarantool/sdvg/releases/tag/latest/
14-
[actions-badge]: https://img.shields.io/github/check-runs/tarantool/sdvg/master
18+
[actions-badge]: https://badgen.net/github/checks/tarantool/sdvg
1519
[actions-url]: https://github.com/tarantool/sdvg/actions
16-
[test-coverage-badge]: https://img.shields.io/coverallsCoverage/github/tarantool/sdvg?branch=master
20+
[test-coverage-badge]: https://badgen.net/coveralls/c/github/tarantool/sdvg
1721
[test-coverage-url]: https://coveralls.io/github/tarantool/sdvg?branch=master
18-
[language-badge]: https://img.shields.io/github/languages/top/tarantool/sdvg
22+
[language-badge]: https://badgen.net/static/language/go/blue
1923
[language-url]: https://github.com/tarantool/sdvg/search?l=go
20-
[license-badge]: https://img.shields.io/github/license/tarantool/sdvg
24+
[license-badge]: https://badgen.net/github/license/tarantool/sdvg?color=cyan
2125
[license-url]: ./LICENSE
2226

23-
![scheme.png](asset/scheme.png)
27+
<div class="hide-in-mkdocs">
2428

25-
## Language
29+
## Documentation version
2630

31+
- [Multilingual web version](https://tarantool.github.io/sdvg/) (recommended)
2732
- **English**
2833
- [Русский](README.ru.md)
2934

35+
</div>
36+
3037
## Description
3138

3239
SDVG (Synthetic Data Values Generator) is a tool for generating synthetic data.
3340
It supports various run modes, data types for generation, and output formats.
3441

42+
![scheme.png](./asset/scheme.png)
43+
3544
Run modes:
3645

3746
- CLI - generate data, create configs, and validate them via the console;
@@ -180,7 +189,7 @@ sdvg generate -h
180189

181190
More information can be found in the [user guide](./doc/en/usage.md).
182191

183-
## Documentation
192+
## Next Steps
184193

185194
- [User Guide](./doc/en/usage.md)
186195
- [Developer Guide](./doc/en/contributing.md)

README.ru.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,46 @@
1+
<div class="hide-in-mkdocs">
2+
13
# Synthetic Data Values Generator (SDVG)
24

5+
</div>
6+
37
[![Release][release-badge]][release-url]
48
[![Pre-release][pre-release-badge]][pre-release-url]
59
[![CI][actions-badge]][actions-url]
610
[![Coverage Status][test-coverage-badge]][test-coverage-url]
711
[![Language][language-badge]][language-url]
812
[![License][license-badge]][license-url]
913

10-
[release-badge]: https://img.shields.io/github/v/release/tarantool/sdvg
14+
[release-badge]: https://badgen.net/github/release/tarantool/sdvg/stable?color=pink
1115
[release-url]: https://github.com/tarantool/sdvg/releases/latest/
12-
[pre-release-badge]: https://img.shields.io/badge/pre--release-latest-orange
16+
[pre-release-badge]: https://badgen.net/static/pre-release/latest/orange?color=purple
1317
[pre-release-url]: https://github.com/tarantool/sdvg/releases/tag/latest/
14-
[actions-badge]: https://img.shields.io/github/check-runs/tarantool/sdvg/master
18+
[actions-badge]: https://badgen.net/github/checks/tarantool/sdvg
1519
[actions-url]: https://github.com/tarantool/sdvg/actions
16-
[test-coverage-badge]: https://img.shields.io/coverallsCoverage/github/tarantool/sdvg?branch=master
20+
[test-coverage-badge]: https://badgen.net/coveralls/c/github/tarantool/sdvg
1721
[test-coverage-url]: https://coveralls.io/github/tarantool/sdvg?branch=master
18-
[language-badge]: https://img.shields.io/github/languages/top/tarantool/sdvg
22+
[language-badge]: https://badgen.net/static/language/go/blue
1923
[language-url]: https://github.com/tarantool/sdvg/search?l=go
20-
[license-badge]: https://img.shields.io/github/license/tarantool/sdvg
24+
[license-badge]: https://badgen.net/github/license/tarantool/sdvg?color=cyan
2125
[license-url]: ./LICENSE
2226

23-
![scheme.png](asset/scheme.png)
27+
<div class="hide-in-mkdocs">
2428

25-
## Язык
29+
## Версия документации
2630

31+
- [Многоязычная веб-версия](https://tarantool.github.io/sdvg/ru/) (рекомендуется)
2732
- [English](README.md)
2833
- **Русский**
2934

35+
</div>
36+
3037
## Описание продукта
3138

3239
SDVG (Synthetic Data Values Generator) — это инструмент для генерации синтетических данных.
3340
Он поддерживает различные форматы запуска, типы данных для генерации и форматы вывода.
3441

42+
![scheme.png](./asset/scheme.png)
43+
3544
Форматы запуска:
3645

3746
- CLI - генерация данных, создание конфигураций и их валидация через консоль;
@@ -180,7 +189,7 @@ sdvg generate -h
180189

181190
Больше информации можно найти в [руководстве по эксплуатации](./doc/ru/usage.md).
182191

183-
## Документация
192+
## Следующие шаги
184193

185194
- [Руководство по эксплуатации](./doc/ru/usage.md)
186195
- [Руководство для разработчиков](./doc/ru/contributing.md)

asset/favicon.png

84.3 KB
Loading

doc/assets/images/favicon.png

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../asset/favicon.png

doc/assets/images/scheme.png

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../asset/scheme.png

doc/assets/stylesheets/sdvg.css

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.hide-in-mkdocs {
2+
display: none;
3+
}
4+
5+
.md-header__title {
6+
margin-left: 0 !important;
7+
}
8+
9+
[data-md-color-scheme="slate"] {
10+
--md-code-fg-color: #ffffff;
11+
--md-code-bg-color: #333542;
12+
}
13+
14+
[data-md-color-scheme="default"] {
15+
--md-code-bg-color: #ECEFF1;
16+
}
17+
18+
.md-typeset code {
19+
padding: 0.2em 0.4em;
20+
border-radius: 4px;
21+
white-space: pre-wrap;
22+
word-wrap: break-word;
23+
}

0 commit comments

Comments
 (0)