Skip to content

Commit 921d84c

Browse files
Merge pull request #124 from LedgerHQ/doc
Update documentation doc / generation + udev rules in `README.md`
2 parents 80d6f2c + e21d0cc commit 921d84c

File tree

8 files changed

+85
-65
lines changed

8 files changed

+85
-65
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Documentation generation & update
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
branches:
8+
- master
9+
pull_request:
10+
branches:
11+
- master
12+
13+
jobs:
14+
generate:
15+
name: Generate the documentation
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Clone
19+
uses: actions/checkout@v3
20+
with:
21+
fetch-depth: 0
22+
- name: Install Python dependencies
23+
run: |
24+
pip install -U pip
25+
pip install -U .[doc]
26+
- name: Generate the documentation
27+
run: (cd doc && make html)
28+
- name: Upload documentation bundle
29+
uses: actions/upload-artifact@v3
30+
with:
31+
name: documentation
32+
path: doc/build/html/
33+
34+
deploy:
35+
name: Deploy the documentation on Github pages
36+
runs-on: ubuntu-latest
37+
needs: generate
38+
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/'))
39+
steps:
40+
- name: Download documentation bundle
41+
uses: actions/download-artifact@v3
42+
- name: Deploy documentation on pages
43+
uses: peaceiris/actions-gh-pages@v3
44+
with:
45+
github_token: ${{ secrets.GITHUB_TOKEN }}
46+
publish_dir: documentation/

README.md

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Python tools for Ledger Blue, Nano S and Nano X
1+
# Ledgerblue - Python tools for Ledger Blue, Nano S and Nano X
22

33
This package contains Python tools to communicate with Ledger Blue, Nano S and Nano X and manage applications life cycle.
44

@@ -12,7 +12,7 @@ source ledger/bin/activate
1212
pip install ledgerblue
1313
```
1414

15-
## Supported devices
15+
## Supported devices
1616

1717
At the moment these tools work for all Nano S, Nano S+, and Blue devices, but only for special Nano X developer units which are not available to the general public.
1818
The Recover scripts, will work with Nano X starting from a specific version.
@@ -43,9 +43,9 @@ Which would end up installing glibtool and glibtoolize utilities required for th
4343
When running on Linux, make sure the following rules have been added to `/etc/udev/rules.d/`:
4444

4545
```
46-
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2c97", ATTRS{idProduct}=="0000", MODE="0660", TAG+="uaccess", TAG+="udev-acl" OWNER="<UNIX username>"
47-
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2c97", ATTRS{idProduct}=="0001", MODE="0660", TAG+="uaccess", TAG+="udev-acl" OWNER="<UNIX username>"
48-
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2c97", ATTRS{idProduct}=="0004", MODE="0660", TAG+="uaccess", TAG+="udev-acl" OWNER="<UNIX username>"
46+
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2c97", MODE="0660", TAG+="uaccess", TAG+="udev-acl" OWNER="<UNIX username>"
47+
48+
KERNEL=="hidraw*", ATTRS{idVendor}=="2c97", MODE="0660" OWNER="<UNIX username>"
4949
```
5050

5151
## Target ID
@@ -65,3 +65,26 @@ Use the following Target IDs (--targetId option) when running commands directly:
6565
| `Ledger Blue` | 2.1.x | `0x31000004` |
6666
| `Ledger Blue v2` | 2.1.x | `0x31010004` |
6767

68+
69+
## Ledgerblue documentation
70+
71+
You can generate the Ledgerblue documentation locally.
72+
73+
Firstly, make sure you have [pip installed](https://pip.pypa.io/en/stable/installing/) and `make`
74+
installed.
75+
76+
Then, install the documentation dependencies:
77+
78+
```bash
79+
# from the top of the Git repository
80+
pip install .[doc]
81+
```
82+
83+
Finally, generate the documentation:
84+
85+
```bash
86+
# from the top of the Git repository
87+
(cd doc/ && make html)
88+
```
89+
90+
The documentation will be generated into the `doc/build/` directory.

VERSIONING.md

Lines changed: 0 additions & 15 deletions
This file was deleted.

doc/README.md

Lines changed: 0 additions & 26 deletions
This file was deleted.

doc/requirements.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

doc/source/conf.py

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
import os
66
import sys
77

8-
sys.path.append(os.path.abspath('../../'))
8+
from ledgerblue.__version__ import __version__
99

1010
def setup(app):
11-
app.add_stylesheet('theme_overrides.css') # Override wide tables in RTD theme
11+
app.add_css_file('theme_overrides.css') # Override wide tables in RTD theme
1212

1313
# General Configuration
1414
# =====================
@@ -23,8 +23,8 @@ def setup(app):
2323
copyright = u'2017, Ledger Team'
2424
author = u'Ledger Team'
2525

26-
version = u'0.1.30'
27-
release = u'0.1.30'
26+
version = __version__
27+
release = __version__
2828

2929
pygments_style = 'sphinx'
3030

@@ -39,12 +39,3 @@ def setup(app):
3939
# =========
4040

4141
extensions += ['sphinxarg.ext']
42-
43-
# intersphinx
44-
# ===========
45-
46-
extensions += ['sphinx.ext.intersphinx']
47-
48-
intersphinx_mapping = {
49-
'ledger': ('https://ledger.readthedocs.io/en/2/', None)
50-
}

doc/source/script_reference.rst

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,7 @@ setupCustomCA.py
166166
signApp.py
167167
----------
168168

169-
.. argparse::
170-
:module: ledgerblue.signApp
171-
:func: get_argparser
172-
:prog: python -m ledgerblue.signApp
169+
See :ref:`loadApp <loadApp.py>`, and its `--signApp` flag.
173170

174171
.. _updateFirmware.py:
175172

pyproject.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,15 @@ include-package-data = false
5252
[project.urls]
5353
Home = "https://github.com/LedgerHQ/blue-loader-python"
5454

55-
[options.extras_require]
55+
[project.optional-dependencies]
5656
smartcard = [
5757
"python-pyscard>=1.6.12"
5858
]
59+
doc = [
60+
"sphinx",
61+
"sphinx_rtd_theme",
62+
"sphinx_argparse"
63+
]
5964

6065
[tool.setuptools_scm]
6166
write_to = "ledgerblue/__version__.py"

0 commit comments

Comments
 (0)