Skip to content

Commit 7c2a11f

Browse files
authored
doc i18n (#27)
1 parent 9a5e209 commit 7c2a11f

22 files changed

Lines changed: 343 additions & 210 deletions

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
[![PyPI version](https://img.shields.io/pypi/v/aloha)](https://pypi.python.org/pypi/aloha/)
1111
[![PyPI Downloads](https://img.shields.io/pypi/dm/aloha)](https://pepy.tech/badge/aloha/)
1212
[![Code Activity](https://img.shields.io/github/commit-activity/m/LabNow-ai/aloha-python)](https://github.com/LabNow-ai/aloha-python/pulse)
13-
[![Recent Code Update](https://img.shields.io/github/last-commit/LabNow-ai/docker-images.svg)](https://github.com/LabNow-ai/aloha-python/stargazers)
13+
[![Recent Code Update](https://img.shields.io/github/last-commit/LabNow-ai/aloha-python.svg)](https://github.com/LabNow-ai/aloha-python/stargazers)
1414

1515
Please generously STAR★ our project or donate to us!
1616
[![GitHub Starts](https://img.shields.io/github/stars/LabNow-ai/aloha-python.svg?label=Stars&style=social)](https://github.com/LabNow-ai/aloha-python/stargazers)

doc/.readthedocs.yaml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,12 @@
22
# Read the Docs configuration file
33
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
44

5-
# Required
65
version: 2
76

8-
# Set the version of Python and other tools you might need
97
build:
108
os: ubuntu-lts-latest
119
tools:
1210
python: "3"
13-
# nodejs: "latest"
14-
# apt_packages: []
1511
jobs:
1612
pre_create_environment:
1713
- echo "Command run at 'pre_create_environment' step"
@@ -21,9 +17,8 @@ build:
2117
mkdocs:
2218
configuration: ./doc/mkdocs.yml
2319

24-
# Optionally declare the Python requirements required to build your docs
2520
python:
2621
install:
22+
- requirements: ./doc/requirements.txt
2723
- method: pip
2824
path: ./src
29-
extra_requirements: [docs, base]

doc/README-cli.md

Lines changed: 0 additions & 35 deletions
This file was deleted.

doc/README-config.md

Lines changed: 0 additions & 80 deletions
This file was deleted.

doc/README-get-start.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

doc/en/README-cli.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Common Tasks
2+
3+
## Test whether aloha is properly installed
4+
5+
```bash
6+
aloha info
7+
```
8+
9+
This displays package version information.
10+
11+
## Start a function from the main function entrypoint
12+
13+
```bash
14+
aloha start package_name.module_name
15+
# e.g.: aloha start app_common.debug
16+
```
17+
18+
Note: this `module_name` **must** include a function named `main()`.
19+
20+
## Compile Python code into binary
21+
22+
Sometimes you need to compile Python source code into binary libraries to protect source code.
23+
24+
Aloha helps you build Python source code into binaries using `Cython`:
25+
26+
```bash
27+
aloha compile --base=./app --dist=./build --keep='main.py'
28+
```
29+
30+
Available options:
31+
32+
- `--base`: root folder that includes source code to build
33+
- `--dist`: (default=`build`) target folder for binary code
34+
- `--exclude`: files/folders to exclude (use multiple times for multiple paths)
35+
- `--keep`: source files to keep as-is instead of converting to dynamic libraries (use multiple times)

doc/en/README-config.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Configurations
2+
3+
## OS environment variables
4+
5+
### `ENV_PROFILE`
6+
7+
*Default value*: `None` (not defined).
8+
9+
Define the environment profile for the current process, such as `DEV | STG | PRD`.
10+
This is usually used to decide which config file in `${DIR_CONFIG}` should be used as the entrypoint config.
11+
12+
If this environment variable is defined, `aloha` will first search for `main-${ENV_PROFILE}.conf`; otherwise it uses `main.conf`.
13+
14+
### `ENTRYPOINT`
15+
16+
*Default value*: `None` (not defined).
17+
18+
Define the entrypoint **Python module** when using `aloha start` to start a service/process.
19+
It is equivalent to `aloha start ${ENTRYPOINT}`.
20+
21+
The specified **Python module must** contain a `main()` function.
22+
23+
### `APP_MODULE`
24+
25+
*Default value*: `default`.
26+
27+
Define the application module name. It is mapped to config variable `APP_MODULE` and used as the prefix for log files.
28+
29+
### `DIR_LOG`
30+
31+
*Default value*: `logs`.
32+
33+
Define where log files are stored.
34+
35+
### `DIR_RESOURCE`
36+
37+
*Default value*: `resource` under the current working directory.
38+
39+
Define the resource folder. It will be used as the root directory by `aloha.config.paths.get_resource_dir()`.
40+
41+
### `DIR_CONFIG`
42+
43+
*Default value*: `${DIR_RESOURCE}/config`.
44+
45+
Define where to find configuration files.
46+
47+
### `FILES_CONFIG`
48+
49+
*Default value*: `None` (not defined).
50+
51+
Optional. Define a comma-separated list of config files to load.
52+
If this variable is set, `ENV_PROFILE` is ignored.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Development Docs
22

3-
## Live debug on source code using docker
3+
## Live debug source code with Docker
44

55
```bash
6-
# Firstly, cd to the project root folder (which includes `src`) of the project, and then:
6+
# First, cd to project root (which includes `src`), then run:
77
docker run -it \
88
-v $(pwd):/root/app/ \
99
-w /root/app/src \
@@ -14,7 +14,7 @@ docker run -it \
1414
python -m aloha.script.start app_common.debug
1515
```
1616

17-
## Build docker image
17+
## Build Docker image
1818

1919
```bash
2020
source tool/tool.sh

doc/en/README-get-start.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Getting Started
2+
3+
## Step 1. Install the Python package
4+
5+
```title="Install aloha with all extra requirements"
6+
pip install aloha[all]
7+
```
8+
9+
## Step 2. Start your project based on the template
10+
11+
You can refer to the `app` folder in the GitHub repository to start using `aloha` in your project:
12+
13+
[:octicons-mark-github-16: Go to Template Project](https://github.com/LabNow-ai/aloha-python/tree/main/app){ .md-button }
File renamed without changes.

0 commit comments

Comments
 (0)