Skip to content

Commit 16f4b04

Browse files
committed
add docs
1 parent 6a7b303 commit 16f4b04

File tree

9 files changed

+240
-5
lines changed

9 files changed

+240
-5
lines changed

_static/tut_chap2.png

133 KB
Loading

conf.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
# -- General configuration ---------------------------------------------------
1515
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
1616

17-
extensions = []
17+
extensions = [
18+
"sphinx_copybutton",
19+
]
1820

1921
templates_path = ['_templates']
2022
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

index.rst

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,42 @@
66
UniversalPython documentation
77
=============================
88

9-
Add your content using ``reStructuredText`` syntax. See the
10-
`reStructuredText <https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html>`_
11-
documentation for details.
9+
Welcome! This is the official documentation for UniversalPython.
10+
11+
**Documentation sections:**
12+
13+
.. raw:: html
14+
15+
<div style="display: flex; flex-wrap: wrap; gap: 30px; margin-top: 1em; padding-left: 2em;">
16+
17+
<div style="flex: 1 1 calc(50% - 50px); min-width: 200px;">
18+
<p style="margin-top: 0;">
19+
<a href="tutorial.html">Tutorial</a><br>
20+
<em>Start here: a tour of UniversalPython syntax and features</em>
21+
</p>
22+
</div>
23+
24+
<div style="flex: 1 1 calc(50% - 50px); min-width: 200px;">
25+
<p style="margin-top: 0;">
26+
<a href="supported_languages.html">Supported Languages</a><br>
27+
<em>Checkout the supported languages in UniversalPython</em>
28+
</p>
29+
</div>
30+
31+
<div style="flex: 1 1 calc(50% - 50px); min-width: 200px;">
32+
<p style="margin-top: 0;">
33+
<a href="try_it_yourself.html">Try it Yourself</a><br>
34+
<em>Try UniversalPython in your browser. No installs needed.</em>
35+
</p>
36+
</div>
37+
38+
</div>
1239

1340

1441
.. toctree::
1542
:maxdepth: 2
16-
:caption: Contents:
43+
:hidden:
1744

45+
tutorial
46+
supported_languages
47+
try_it_yourself

supported_languages.rst

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
Supported Languages
2+
===================
3+
4+
UniversalPython lets you write Python code using your preferred human language! While Python is the programming language behind the scenes, UniversalPython is a transpiler which supports writting Python code in multiple natural languages.
5+
6+
This allows developers worldwide to code in Python using the language they feel most comfortable with.
7+
8+
Supported Human Languages
9+
-------------------------
10+
11+
- English
12+
*Extension:* \[placeholder for English language extension\]
13+
- Urdu
14+
*Extension:* \[placeholder for Urdu language extension\]
15+
- Hindi
16+
*Extension:* \[placeholder for Hindi language extension\]
17+
- Spanish
18+
*Extension:* \[placeholder for Spanish language extension\]
19+
- ...and more to come!
20+
21+
How It Works
22+
------------
23+
24+
You write your UniversalPython programs using localized Python syntax in your chosen language. UniversalPython translates your code internally into standard Python, which is then executed as usual.
25+
26+
Example
27+
-------
28+
29+
Here is a simple function written in English and French versions:
30+
31+
English:
32+
33+
.. code-block:: python
34+
:linenos:
35+
36+
def hello():
37+
print("Hello, UniversalPython!")
38+
39+
hello()
40+
41+
French:
42+
43+
.. code-block:: python
44+
:linenos:
45+
46+
déf hello():
47+
imprimer("Hello, UniversalPython!")
48+
49+
hello()
50+
51+
Next Steps
52+
----------
53+
54+
For details on how to install and use language extensions, visit the corresponding language’s documentation page.
55+
56+
If you want to contribute translations or help improve UniversalPython’s language support, check out the Community page.

try_it_yourself.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Try it yourself
2+
===============
3+
4+
Want to experience UniversalPython without installing anything? Use our `Online Playground <https://universalpython.github.io/playground/>`_ to write and run Python code in your preferred language directly in the browser.
5+
6+
What You Can Do
7+
---------------
8+
9+
- Write UniversalPython code using supported languages
10+
- Instantly run code and see output
11+
- Use pre-configured examples or write your own code

tut_chap1.rst

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
What is UniversalPython
2+
========================
3+
4+
UniversalPython is a **transpiler** that allows you to write Python code using keywords and identifiers in your **native human language**.
5+
6+
It is not a new language, nor a fork of **Python**. It is a thin compatibility layer that translates code written with localized keywords into **standard** **Python**. Your code is executed by the **official** **Python** **interpreter**, and behaves just like any other Python program.
7+
8+
The goal of UniversalPython is to make programming in Python more accessible, especially for beginners and students learning in non-English environments.
9+
10+
Transpiler, Not Interpreter
11+
---------------------------
12+
13+
UniversalPython works by **transpiling** code that is, converting it from one form (Python written in a different human language) to another (standard Python source code), before running it.
14+
15+
This means:
16+
17+
- You are still writing **real Python code**
18+
- Your code will work with **standard Python tools, libraries, and environments**
19+
- The result is indistinguishable from code written in standard Python
20+
21+
Why This Matters for Learners
22+
-----------------------------
23+
24+
Python is one of the most widely used languages in education. However, Python's syntax, although simple, is still written in English.
25+
26+
For many learners (who are not from English speaking countries), especially young students or those new to programming, the English vocabulary can be a barrier. **UniversalPython** helps reduce that barrier by translating code to and from the learner’s own language.
27+
28+
This allows learners to focus on **logic and structure**, not foreign keywords.
29+
30+
For example, a French learner might write:
31+
32+
.. code-block:: text
33+
:linenos:
34+
35+
something = 2
36+
37+
si something == 1:
38+
imprimer ("Hello")
39+
sinonsi something == 2:
40+
imprimer ("World")
41+
sinon:
42+
imprimer ("Didn't understand...")
43+
44+
Python will understand it as:
45+
46+
.. code-block:: python
47+
:linenos:
48+
49+
something = 2
50+
51+
if something == 1:
52+
print("Hello")
53+
elif something == 2:
54+
print("World")
55+
else:
56+
print("Didn't understand...")
57+
58+

tut_chap2.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Using Your Native Language
2+
==========================
3+
4+
UniversalPython supports writing Python code with keywords and standard library functions translated into your native language.
5+
6+
Supported Languages and Extensions
7+
----------------------------------
8+
9+
UniversalPython supports multiple languages through language-specific extensions.
10+
11+
For example:
12+
13+
- English (default, no extension needed)
14+
- French (`<filename>.fr.py`)
15+
- Chinese (`<filename>.zh.py`)
16+
- German (`<filename>.de.py`)
17+
- And many more (see the full list in the **Supported Languages** section)
18+
19+
Each language extension provides the necessary translations for Python keywords, built-in functions, and standard library aliases.
20+
21+
.. image:: _static/tut_chap2.png
22+
:alt: ""
23+
:width: 100%
24+
:align: center

tut_chap3.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Your First Program
2+
==================
3+
4+
Programming may seem intimidating at first, but it really starts with just a few words and one good idea.
5+
6+
In this tutorial, you’ll write your first real Python program using UniversalPython. You’ll use familiar, everyday language to tell the computer what to do.
7+
8+
You don’t need to understand everything right away. Just follow the steps and see what happens!
9+
10+
.. important::
11+
12+
If you haven’t set up UniversalPython yet, go to the Setup section first, then come back here when you're ready.
13+
14+
**1. Create the File**
15+
16+
Open your text editor and create a new file.
17+
18+
If you're using French, save the file as: ``main.fr.py``
19+
20+
The file extension (like ``.fr.py``) tells UniversalPython which language you're writing in. (In this case, French)

tutorial.rst

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
Tutorial
2+
========
3+
4+
.. tip::
5+
This tutorial introduces you to UniversalPython, a tool that helps learners write Python code using keywords and identifiers in their native human language.
6+
7+
8+
This tutorial introduces you to **UniversalPython**, a tool that helps learners write Python code using keywords and identifiers in their **native human language**.
9+
10+
UniversalPython is **not a new language**. It is a **transpiler**, a small layer that translates code written in other natural languages into standard Python. This allows students to begin learning Python concepts using familiar vocabulary.
11+
12+
All code written in UniversalPython is executed as **real Python**. You can use the full Python standard library and any third-party packages. The goal of UniversalPython is to **lower the language barrier**, not to replace or redefine Python.
13+
14+
This tutorial is written for:
15+
16+
- Learners who want to explore Python in their own language
17+
- Teachers who want to introduce programming without the barrier of English syntax
18+
19+
To follow this tutorial, you will need:
20+
21+
- Python 3.4 or later
22+
- A Terminal or Jupiter Notebook
23+
- Optionally, access to the `Online Playground <https://universalpython.github.io/playground/>`_ for running code in the browser
24+
25+
We recommend reading the tutorial chapters in order. However, if you are already familiar with Python and only want to understand UniversalPython’s features, you may skip ahead to the Using Your Native Language in Python chapter.
26+
27+
**Chapters:**
28+
29+
.. toctree::
30+
:maxdepth: 1
31+
32+
tut_chap1
33+
tut_chap2
34+
tut_chap3

0 commit comments

Comments
 (0)