Skip to content

Commit 8421cf0

Browse files
authored
Merge pull request #12849 from MisRob/docs-new-howtos
Developer documentation updates
2 parents 9501abb + e047e1b commit 8421cf0

File tree

7 files changed

+74
-17
lines changed

7 files changed

+74
-17
lines changed

docs/getting_started.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ To ensure a more efficient workflow, install appropriate editor plugins for Vue.
335335
Sample resources and data
336336
-------------------------
337337

338-
Once you have the server running, proceed to import some channels and resources. To quickly import all available and supported Kolibri resource types, use the token ``nakav-mafak`` for the `Kolibri QA channel <https://kolibri-beta.learningequality.org/en/learn/#/topics/95a52b386f2c485cb97dd60901674a98>`__ (~350MB).
338+
Once you have the server running, proceed to import some channels and resources. To quickly import all available and supported Kolibri resource types, `import with the token <https://kolibri.readthedocs.io/en/latest/manage/resources.html?highlight=import#import-with-token>`__ ``nakav-mafak`` for the `Kolibri QA channel <https://kolibri-beta.learningequality.org/en/learn/#/topics/95a52b386f2c485cb97dd60901674a98>`__ (~350MB).
339339

340340

341341
Now you can create users, classes, lessons, etc manually. To auto-generate some sample user data you can also run:

docs/howtos/development_with_kds.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Running Kolibri with local Kolibri Design System
1+
# Running Kolibri with local Kolibri Design System
22

33
Kolibri uses components from [Kolibri Design System](https://github.com/learningequality/kolibri-design-system) (KDS). KDS is installed in Kolibri as a usual npm dependency.
44

@@ -12,4 +12,5 @@ yarn run devserver-with-kds <kds-path>
1212

1313
where `<kds-path>` is the path of the local `kolibri-design-system` repository.
1414

15-
It is recommended to use an absolute KDS path as some developers observed problems when running the command with a relative path.
15+
.. warning::
16+
Some developers have reported issues when running the command with a relative path. If you encounter any problems, try using an absolute KDS path.

docs/howtos/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ These guides are step by step guides for common tasks in getting started and wor
1515
rebasing_a_pull_request
1616
another_kolibri_instance
1717
development_with_kds
18+
preview_on_mobile

docs/howtos/installing_pyenv.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
## Installing pyenv
1+
# Installing pyenv
22

3-
### Prerequisites
3+
## Prerequisites
44

55
[Git](https://git-scm.com/) installed.
66

7-
### Install
7+
## Install
88

99
First check to see if you already have `pyenv` installed by running this in a terminal window:
1010

@@ -91,7 +91,7 @@ The output of the command tells you to add certain lines to your startup files f
9191

9292
**Proxy note**: If you use a proxy, export `http_proxy` and `https_proxy`, too.
9393

94-
### Installation of pyenv on Windows
94+
## Installation of pyenv on Windows
9595

9696
1. Run PowerShell terminal as Administrator
9797
2. Run the following installation command in the PowerShell terminal :
@@ -110,7 +110,7 @@ press Y not A, to execute Policy Change for this power shell only.
110110

111111
then run the previous command again
112112

113-
### Restart your shell
113+
## Restart your shell
114114

115115
For the `PATH` changes to take effect, run the following command.
116116

@@ -124,13 +124,13 @@ To check if pyenv is installed correctly, type:
124124

125125
`pyenv version`
126126

127-
### Install Python build dependencies
127+
## Install Python build dependencies
128128

129129
[**Install Python build dependencies**](https://github.com/pyenv/pyenv/wiki#suggested-build-environment) before attempting to install a new Python version.
130130

131131
You can now begin using Pyenv.
132132

133-
### Installing a Python Version with PyEnv
133+
## Installing a Python Version with PyEnv
134134

135135
Use the `pyenv` command in your terminal to install a recent version of Python:
136136

docs/howtos/preview_on_mobile.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Preview Kolibri on a mobile device
2+
3+
_Note: This guide focuses on Kolibri as a web app rather than the Android version of Kolibri._
4+
5+
Some tasks may require either an actual or simulated mobile device, such as a phone or tablet.
6+
7+
## Browser development tools
8+
9+
Most browsers provide ways to simulate mobile devices via their development tools. These tools are generally useful for testing:
10+
11+
- Mobile viewports
12+
- Network and CPU throttling
13+
- Touch gestures
14+
15+
Find specific guidance for the browser you are using.
16+
17+
## Real mobile device
18+
19+
Since browser development tools only offer an approximation, some tasks may require you to preview Kolibri on a real mobile device.
20+
21+
### Option 1 (recommended)
22+
23+
1. Ensure that the mobile device you wish to use for previewing Kolibri is connected to the same local network as your computer where you run the development server.
24+
2. Run the development server with `yarn python-devserver` and `yarn run watch --write-to-disk`
25+
3. In the section with URLs in the ``yarn python-devserver`` terminal output, locate Kolibri's ``http://A.B.C.D:8000/`` URL on the first line. Open a browser on the mobile device and navigate to that URL, where you should see Kolibri.
26+
27+
```bash
28+
INFO 2024-11-19 15:14:21,967 Kolibri running on: http://A.B.C.D:8000/ # use this URL
29+
...
30+
INFO 2024-11-19 15:14:21,967 Kolibri running on: http://127.0.0.1:8000/
31+
```
32+
33+
### Option 2
34+
35+
1. Ensure that the mobile device you wish to use for previewing Kolibri is connected to the same local network as your computer where you run the development server.
36+
2. Run the development server with `yarn python-devserver` and `yarn build`
37+
3. In the section with URLs in the ``yarn python-devserver`` terminal output, locate Kolibri's ``http://A.B.C.D:8000/`` URL on the first line. Open a browser on the mobile device and navigate to that URL, where you should see Kolibri.
38+
39+
```bash
40+
INFO 2024-11-19 15:14:21,967 Kolibri running on: http://A.B.C.D:8000/ # use this URL
41+
...
42+
INFO 2024-11-19 15:14:21,967 Kolibri running on: http://127.0.0.1:8000/
43+
```
44+
45+
.. warning::
46+
When running the development server as described above, you will need to rebuild frontend assets manually using ``yarn build`` after every change.
47+
48+
.. tip::
49+
Rebuild frontend assets faster by rebuilding only assets related to a plugin where you currently work. For example when developing on files of the Learn plugin, after the initial ``yarn build`` run, for all subsequent rebuilds only run ``yarn exec kolibri-tools build prod -- --plugins kolibri.plugins.learn`` instead of ``yarn build``. Use ``kolibri plugin list`` to see all plugins.
50+
51+
### Troubleshooting
52+
53+
- If you see an indefinite Kolibri loader on your mobile device, double-check that you are not running the development server with `yarn development-hot`. Follow the steps outlined above instead.
54+
55+
- If you cannot access Kolibri at all, check your firewall, VPN, or similar network settings.

docs/howtos/pyenv_virtualenv.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
## Using pyenv-virtualenv
1+
# Using pyenv-virtualenv
22

3-
### Virtual Environments
3+
## Virtual Environments
44

55
Virtual environments allow a developer to have an encapsulated Python environment, using a specific version of Python, and with dependencies installed in a way that only affect the virtual environment. This is important as different projects or even different versions of the same project may have different dependencies, and virtual environments allow you to switch between them seamlessly and explicitly.
66

7-
### Using `pyenv virtualenv` with pyenv
7+
## Using `pyenv virtualenv` with pyenv
88

99
To create a virtualenv for the Python version used with pyenv, run `pyenv virtualenv`, specifying the Python version you want and the name of the virtualenv directory. For example, because we can make a virtual environment for Kolibri using Python 3.9.9:
1010

@@ -17,7 +17,7 @@ If you get 'command not found' or a similar error, and pyenv virtualenv is not i
1717
will create a virtualenv based on Python 3.9.9 under `$(pyenv root)/versions` in a
1818
folder called `kolibri-py3.9`.
1919

20-
### List existing virtualenvs
20+
## List existing virtualenvs
2121

2222
`pyenv virtualenvs` shows you the list of existing virtualenvs and `conda` environments.
2323

@@ -30,7 +30,7 @@ $ pyenv virtualenvs
3030
There are two entries for each virtualenv, and the shorter one is just a symlink.
3131

3232

33-
### Activate virtualenv
33+
## Activate virtualenv
3434

3535
If you want a virtual environment to always activate when you enter a certain directory, you can use the [`pyenv local`](https://github.com/pyenv/pyenv/blob/master/COMMANDS.md#pyenv-local) command.
3636

@@ -47,7 +47,7 @@ pyenv activate kolibri-py3.9
4747
pyenv deactivate
4848
```
4949

50-
### Delete existing virtualenv
50+
## Delete existing virtualenv
5151

5252
Removing the directories in `$(pyenv root)/versions` and `$(pyenv root)/versions/{version}/envs` will delete the virtualenv, or you can run:
5353

docs/howtos/rebasing_a_pull_request.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Rebasing a Pull Request
1+
# Rebasing a Pull Request
22

33
On certain occasions, it might be necessary to redirect a pull request from the develop branch to the latest release branch, such as `release-v*` (e.g., `release-v0.16.x` when working on version 0.16), or vice versa. This guide outlines the steps for rebasing a feature branch related to your pull request while maintaining a clean commit history.
44

0 commit comments

Comments
 (0)