Skip to content

Commit a0ad3a8

Browse files
authored
Extend Sphinx documentation (mherrmann#43)
Thank you @IgnisDa1
1 parent ea0a3a1 commit a0ad3a8

File tree

5 files changed

+73
-4
lines changed

5 files changed

+73
-4
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ documentation for Helium's various functions. Otherwise, please look at
100100
functions. I have not yet had time to bring this into a more readable state,
101101
sorry.
102102

103+
The documentation for this project can be found [here](https://selenium-python-helium.readthedocs.io/en/latest/).
104+
103105
## Status of this project
104106

105107
I have too little spare time to maintain this project for free. If you'd like

docs/conf.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import os
22
import sys
3-
43
from datetime import date
54

65
sys.path.insert(0, os.path.abspath('..'))
@@ -46,5 +45,3 @@
4645
# relative to this directory. They are copied after the builtin static files,
4746
# so a file named "default.css" will overwrite the builtin "default.css".
4847
html_static_path = ['_static']
49-
50-
# autodoc_member_order = 'bysource'

docs/contributors.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ Contributors to this project
55
`SocialUsernameName <Profile-Url>`_ (**Your Name**) - *Description of your contribution in a few words*
66
77
- `mherrmann <https://github.com/mherrmann>`_ (**Michael Herrmann**) - *Project creator and maintainer*
8-
- `IgnisDa <https://github.com/IgnisDa>`_ (**Diptesh Choudhuri**) - *Added documentation*
8+
- `IgnisDa <https://github.com/IgnisDa>`_ (**Diptesh Choudhuri**) - *Documentation maintainer*
99

docs/getting-started.rst

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
Getting started with Helium
2+
===========================
3+
4+
Installing Helium
5+
^^^^^^^^^^^^^^^^^
6+
7+
To get started with Helium, you need Python 3 and Chrome or Firefox.
8+
9+
If you already know Python, then the following command should be all you need:
10+
11+
12+
.. code-block:: bash
13+
14+
pip install helium
15+
16+
Otherwise - Hi! I would recommend you create a virtual environment in the
17+
current directory. Any libraries you download (such as Helium) will be placed
18+
there. Enter the following into a command prompt:
19+
20+
.. code-block:: bash
21+
22+
python3 -m venv venv
23+
24+
This creates a virtual environment in the `venv/` directory. To activate it:
25+
26+
.. code-block:: bash
27+
28+
# On Mac/Linux, bash shell:
29+
source venv/bin/activate
30+
# On Windows:
31+
call venv\Scripts\activate.bat
32+
33+
Then, install Helium using `pip`:
34+
35+
.. code-block:: bash
36+
37+
python -m pip install helium
38+
39+
Now enter :code:`python` into the command prompt and the command :code:`from
40+
helium import *` and you are ready to get started!

docs/index.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,40 @@
11
Welcome to Helium's documentation!
22
==================================
33

4+
What is Helium?
5+
^^^^^^^^^^^^^^^
6+
7+
Selenium-python but lighter
8+
9+
`Selenium-python <https://selenium-python.readthedocs.io/>`_ is great for web
10+
automation. Helium makes it easier to use.
11+
12+
Under the hood, Helium forwards each call to Selenium. The difference is that
13+
Helium's API is much more high-level. In Selenium, you need to use HTML IDs,
14+
XPaths and CSS selectors to identify web page elements. Helium on the other hand
15+
lets you refer to elements by user-visible labels. As a result, Helium scripts
16+
are typically 30-50% shorter than similar Selenium scripts. What's more, they
17+
are easier to read and more stable with respect to changes in the underlying web
18+
page.
19+
20+
Because Helium is simply a wrapper around Selenium, you can freely mix the two
21+
libraries. For example:
22+
23+
24+
.. code-block:: python
25+
26+
# A Helium function:
27+
driver = start_chrome()
28+
# A Selenium API:
29+
driver.execute_script("alert('Hi!');")
30+
31+
So in other words, you don't lose anything by using Helium over pure Selenium.
32+
433
.. toctree::
534
:maxdepth: 2
635
:caption: Contents:
736

37+
getting-started.rst
838
main.rst
939
contributors.rst
1040

0 commit comments

Comments
 (0)