From 745d0913d1216ca981d7c81dd2c586ba0165ea11 Mon Sep 17 00:00:00 2001 From: KeshavAnandCode Date: Thu, 21 May 2026 16:10:03 +0000 Subject: [PATCH] fixed readme template --- README.md | 164 +++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 149 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index b11686b..3fec0e6 100644 --- a/README.md +++ b/README.md @@ -1,36 +1,170 @@ -# foreignthon-{code} + -{language} language pack for ForeignThon. +# foreignthon-xx + + +French language pack for [ForeignThon](https://foreignthon.keshavanand.net/) — write Python in Français. + +--- ## Install ```bash -pip install foreignthon foreignthon-{code} +pip install foreignthon foreignthon-xx ``` -## Usage + -```py -fpy run main.{code}.py +--- + +## Example + + + +**`fizzbuzz.xx.py`** + +```python + +pour i dans intervalle(1, 21): + si i % 15 == 0: + afficher("FizzBuzz") + sinonsi i % 3 == 0: + afficher("Fizz") + sinonsi i % 5 == 0: + afficher("Buzz") + sinon: + afficher(i) ``` -## What's translated + -- **Keywords** — {keywords} -- **Builtins** — {builtins} -- **Exceptions** — {exceptions} -- **Stdlib** — {stdlib} +Compiles to standard Python: -{postfix_section} +```python +for i in range(1, 21): + if i % 15 == 0: + print("FizzBuzz") + elif i % 3 == 0: + print("Fizz") + elif i % 5 == 0: + print("Buzz") + else: + print(i) +``` + +Run it directly without compiling first: + +```bash +fpy run fizzbuzz.xx.py +``` + +--- + +## Keyword reference + + + +| Python | | +|---|---| +| `if` | | +| `else` | | +| `elif` | | +| `for` | | +| `while` | | +| `def` | | +| `class` | | +| `return` | | +| `import` | | +| `True` | | +| `False` | | +| `None` | | +| `print` | | +| `input` | | +| `len` | | +| `range` | | + +The full mapping is in [`xx.json`](https://git.keshavanand.net/foreign-thon/foreignthon-xx/raw/branch/main/src/foreignthon_xx/xx.json). + + + +--- + + + +## Postfix syntax + + +This pack supports the `@@` postfix operator for natural SOV word order. +Instead of writing the keyword first: + +```python +ஆனால் x > 0: + பதிப்பி(x) +``` + +You can write it in natural Tamil order — condition first, keyword after: + +```python +x > 0 @@ஆனால்: + பதிப்பி(x) +``` + +Both compile to the same Python. Decompile with postfix output using: + +```bash +fpy decompile script.py --lang xx --postfix +``` + +See [Postfix Syntax](https://foreignthon.keshavanand.net/postfix-syntax/) for full details. + + + +--- + +## Start a project + +```bash +fpy new myproject --lang xx +cd myproject +fpy run src/main.xx.py +``` + + + +--- ## Documentation -→ https://foreignthon.keshavanand.net/ +→ [foreignthon.keshavanand.net](https://foreignthon.keshavanand.net/) + +--- ## Contributing -Found a missing translation or a better keyword choice? Open an issue or PR — no core access needed. +Found a missing translation or a better keyword for your language? Open an issue or PR — no access to the core repo is needed. + +--- ## License -GPL +GPL v3