Skip to content

Commit dff913f

Browse files
sebastiaanspeckvitorhclkbdharun
authored
scripts/_common.py: add a shared Python file to move duplicated code (#12755)
* `scripts/_common.py`: add a shared Python file to move duplicated code --------- Co-authored-by: VΓ­tor Henrique <[email protected]> Co-authored-by: K.B.Dharun Krishna <[email protected]>
1 parent 4a0f674 commit dff913f

File tree

9 files changed

+737
-359
lines changed

9 files changed

+737
-359
lines changed

β€Ž.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
run: npm ci
3535

3636
- name: Install pip dependencies
37-
run: pip install -r requirements.txt -r scripts/pdf/requirements.txt
37+
run: pip install -r requirements.txt -r scripts/pdf/requirements.txt -r scripts/test-requirements.txt
3838

3939
- name: Test
4040
run: npm test

β€Ž.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,6 @@ scripts/pdf/tldr-pages.pdf
2828
# Python venv for testing the PDF script
2929
# Create it with: python3 -m venv scripts/pdf/venv/
3030
venv
31+
32+
# Generated pycache
33+
__pycache__

β€Žscripts/README.md

+10-7
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,37 @@
22

33
The current directory contains useful scripts used/to use with `tldr` pages.
44

5+
> [!NOTE]
6+
> [Git](https://git-scm.com/) and [Python](https://www.python.org/) must be installed in your system to run/test the scripts locally.
7+
58
## Summary
69

710
This section contains a summary of the scripts available in this directory. For more information about each script, please refer to the header of each script.
811

912
- [pdf](pdf/README.md) directory contains the `render.py` and `build-pdf.sh` script and related resources to generate a PDF document of tldr-pages for a specific language or platform (or both).
1013
- [build.sh](build.sh) script builds the ZIP archives of the `pages` directory.
1114
- [build-index.sh](build-index.sh) script builds the index of available pages.
12-
- [check-pr.sh](check-pr.sh) script checks the pages syntax and performs various checks on the PR.
15+
- [check-pr.sh](check-pr.sh) script checks the page's syntax and performs various checks on the PR.
1316
- [deploy.sh](deploy.sh) script deploys the ZIP and PDF archives to the static website repository.
14-
- [send-to-bot.py](send-to-bot.py) is a Python script that send the build or tests output to tldr-bot.
17+
- [send-to-bot.py](send-to-bot.py) is a Python script that sends the build or test output to tldr-bot.
1518
- [set-alias-page.py](set-alias-page.py) is a Python script to generate or update alias pages.
1619
- [set-more-info-link.py](set-more-info-link.py) is a Python script to generate or update more information links across pages.
1720
- [set-page-title.py](set-page-title.py) is a Python script to update the title across pages.
18-
- [test.sh](test.sh) script runs some basic tests on every PR/commit to make sure that the pages are valid and that the code is formatted correctly.
21+
- [test.sh](test.sh) script runs some basic tests on every PR/commit to ensure the pages are valid and the code is formatted correctly.
1922
- [wrong-filename.sh](wrong-filename.sh) script checks the consistency between the filenames and the page title.
2023
- [update-command.py](update-command.py) is a Python script to update the common contents of a command example across all languages.
2124

2225
## Compatibility
2326

24-
The below table shows the compatibility of user-executable scripts with different platforms.
27+
The table below shows the compatibility of user-executable scripts with different platforms:
2528

2629
| Script | Linux | macOS (`osx`) | Windows |
2730
| ------ | ----- | ----- | ------- |
2831
| [render.py](pdf/render.py) | βœ… | βœ… | βœ… |
29-
| [build-pdf.sh](pdf/build-pdf.sh) | βœ… | βœ… | ❌ |
30-
| [build.sh](build.sh) | βœ… | βœ… | ❌ |
32+
| [build-pdf.sh](pdf/build-pdf.sh) | βœ… | βœ… | ❌ (WSL βœ…)|
33+
| [build.sh](build.sh) | βœ… | βœ… | ❌ (WSL βœ…)|
3134
| [set-alias-pages.py](set-alias-pages.py) | βœ… | βœ… | βœ… |
3235
| [set-more-info-link.py](set-more-info-link.py) | βœ… | βœ… | βœ… |
3336
| [set-page-title.py](set-page-title.py) | βœ… | βœ… | βœ… |
34-
| [wrong-filename.sh](wrong-filename.sh) | βœ… | ❌ | ❌ |
37+
| [wrong-filename.sh](wrong-filename.sh) | βœ… | ❌ | ❌ (WSL βœ…)|
3538
| [update-command.py](update-command.py) | βœ… | βœ… | βœ… |

0 commit comments

Comments
Β (0)