Skip to content

Commit 4241a09

Browse files
authored
update submodules and docs (#17)
* update submodules and docs Yet another regular maintenance update. The changes include: - update RF24 to v1.4.7 - update RF24Network to v2.0.0 - update RF24Mesh to v2.0.0 - update pybind11 to v2.10.4 - fix .gitattributes file messing with png files - fix pylint deprecation warnings about old config settings Updates to the docs include necessary changes to the docs' conf.py and adding social media cards to the metadata for each page. The social media cards are generated per the newly added layout.yml file/spec (included in these changes).
1 parent 17fce18 commit 4241a09

17 files changed

+176
-43
lines changed

.gitattributes

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
*.txt text eol=lf
1111
*.css text eol=lf
1212
*.svg text eol=lf
13-
*.png text eol=lf
1413
*.sh text eol=lf
1514
*.yml text eol=lf
1615
*.bat text eol=crlf

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ instance/
6969

7070
# Sphinx documentation
7171
docs/_build/
72+
docs/social_cards_cache/
7273

7374
# PyBuilder
7475
target/

.pylintrc

+2-2
Original file line numberDiff line numberDiff line change
@@ -558,5 +558,5 @@ preferred-modules=
558558

559559
# Exceptions that will emit a warning when being caught. Defaults to
560560
# "BaseException, Exception".
561-
overgeneral-exceptions=BaseException,
562-
Exception
561+
overgeneral-exceptions=builtins.BaseException,
562+
builtins.Exception

RF24

Submodule RF24 updated 66 files

docs/ble_api.rst

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
:description: How to use the radio as a fake Bluetooth Low Energy Beacon.
2+
13
BLE API
24
=================
35

docs/conf.py

+34-6
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,19 @@
66
https://www.sphinx-doc.org/en/master/usage/configuration.html
77
"""
88
# pylint: disable=invalid-name
9+
import os
10+
911
try:
1012
from importlib.metadata import version as get_version
1113
except ImportError: # for python v3.7 or older
1214
from importlib_metadata import version as get_version # type: ignore
1315

1416
# -- Project information -----------------------------------------------------
1517

16-
project = "pyrf24"
17-
copyright = "2020, TMRh20 Avamander 2bndy5" # pylint: disable=redefined-builtin
18+
project = "pyRF24"
19+
copyright = "2023, TMRh20 Avamander 2bndy5" # pylint: disable=redefined-builtin
1820
author = "TMRh20 Avamander 2bndy5"
19-
language="en"
21+
language = "en"
2022

2123
# The full version, including alpha/beta/rc tags
2224
release = get_version("pyrf24")
@@ -31,7 +33,8 @@
3133
"sphinx.ext.autodoc",
3234
"sphinx.ext.intersphinx",
3335
"sphinx_immaterial",
34-
"sphinx.ext.graphviz",
36+
"sphinx_immaterial.graphviz",
37+
"sphinx_social_cards",
3538
]
3639

3740
intersphinx_mapping = {"python": ("https://docs.python.org/3", None)}
@@ -52,6 +55,32 @@
5255
default_role = "any"
5356

5457

58+
# -- Options for sphinx_social_cards -------------------------------------------------
59+
social_cards = {
60+
"site_url": os.environ.get(
61+
"READTHEDOCS_CANONICAL_URL", "https://nrf24.github.io/pyRF24/"
62+
),
63+
"description": (
64+
"A python package that wraps the RF24, RF24Network, and RF24Mesh C++ libraries."
65+
),
66+
"image_paths": ["social_cards/images"],
67+
"cards_layout_dir": ["social_cards/layouts"],
68+
"cards_layout": "custom",
69+
"cards_layout_options": {
70+
"logo": {
71+
"image": "material/access-point",
72+
"color": "lime",
73+
},
74+
"background_color": "#2c2c2c",
75+
"background_image": "logo_large_no-bg.png",
76+
"color": "lime",
77+
},
78+
# "debug": {
79+
# "enable": True,
80+
# "color": "lime",
81+
# },
82+
}
83+
5584
# -- Options for HTML output -------------------------------------------------
5685

5786
# The theme to use for HTML and HTML Help pages. See the documentation for
@@ -96,7 +125,6 @@
96125
# Set the repo location to get a badge with stats
97126
"repo_url": "https://github.com/nRF24/pyRF24/",
98127
"repo_name": "pyRF24",
99-
"repo_type": "github",
100128
# If False, expand all TOC entries
101129
"globaltoc_collapse": False,
102130
}
@@ -138,7 +166,7 @@
138166
},
139167
{
140168
"name": "important",
141-
"icon": "material/school",
169+
"icon": "material/alert-decagram",
142170
"override": True,
143171
},
144172
]

docs/index.rst

-6
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,3 @@
2323
:hidden:
2424

2525
topology
26-
27-
Indices and tables
28-
==================
29-
30-
* :ref:`genindex`
31-
* :ref:`modindex`

docs/requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
sphinx<6.0
22
sphinx-immaterial
3+
sphinx-social-cards

docs/rf24_api.rst

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
:description: How to use the radio's basic functionality.
2+
13
RF24 API
24
========
35

docs/rf24_mesh_api.rst

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
:description: How to use the radio as a dynamic mesh network node.
2+
13
RF24Mesh API
24
============
35

docs/rf24_network_api.rst

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
:description: How to use the radio as a static network node.
2+
13
RF24Network API
24
===============
35

110 KB
Loading

docs/social_cards/layouts/custom.yml

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# {% block color_vals %}
2+
bg_color: &bg_color '{{ layout.background_color }}'
3+
fg_color: &fg_color '{{ layout.color }}'
4+
# {% endblock %}
5+
6+
row1_width: &row1_width 1080
7+
row2_width: &row2_width 500
8+
col2: &col2 310
9+
10+
layers:
11+
# the base layer for the background
12+
- background:
13+
color: *bg_color
14+
image: >
15+
{% if layout.background_image %}
16+
{{ layout.background_image }}
17+
{% endif %}
18+
# the layer for the logo/icon image
19+
- size: { width: 60, height: 60 }
20+
offset: { x: 1050, y: 60 }
21+
icon:
22+
image: >
23+
{% if page.meta.icon %}
24+
{{ page.meta.icon }}
25+
{% elif layout.logo.image %}
26+
{{ layout.logo.image }}
27+
{% endif %}
28+
color: >
29+
{% if layout.logo.color %}
30+
{{ layout.logo.color }}
31+
{% endif %}
32+
# the layer for the large logo image
33+
- size: { width: 640, height: 320 }
34+
offset: { x: 560, y: *col2 }
35+
icon:
36+
image: '{{ layout.background_image }}'
37+
# fancy bg art
38+
# {% for r in range(60, 640, 90) %}
39+
- offset: { x: {{ -r }}, y: {{ -r }} }
40+
size: { width: {{ r * 2}}, height: {{ r * 2 }} }
41+
ellipse:
42+
border:
43+
width: {{ ((640 - r) * 0.1) | int }}
44+
color: '#802a033c'
45+
# {% endfor %}
46+
# the layer for the site's name
47+
- offset: { x: 60, y: 60 }
48+
size: { width: 960, height: 60 }
49+
typography:
50+
content: '{{ config.docstitle }}'
51+
align: end center
52+
color: '{{ layout.color }}'
53+
# the layer for the page's title
54+
- size: { width: *row1_width, height: 150 }
55+
offset: { x: 60, y: 150 }
56+
typography:
57+
content: >
58+
{% if page.meta.title %}
59+
{{ page.meta.title }}
60+
{% elif page.title %}
61+
{{ page.title }}
62+
{% endif %}
63+
line:
64+
height: 0.9
65+
font:
66+
weight: 500
67+
border:
68+
color: deep-orange
69+
width: 4
70+
color: *fg_color
71+
align: center top
72+
# the layer for the site's (or page's) description
73+
- offset: { x: 60, y: *col2 }
74+
size: { width: 490, height: 290 }
75+
typography:
76+
content: >
77+
{% if page.meta and page.meta.description %}
78+
{{ page.meta.description }}
79+
{% else %}
80+
{{ config.site_description }}
81+
{% endif %}
82+
line:
83+
height: 0.87
84+
amount: 4
85+
overflow: on
86+
align: start bottom
87+
color: '{{ layout.color }}'

docs/topology.rst

+39-24
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
:description: How a network is constructed, address composition, and common points of failure during Mesh connecting.
2+
13
Network Topology
24
================
35

@@ -20,29 +22,27 @@ integers and use an octal counting scheme.
2022
.. graphviz::
2123

2224
graph network_hierarchy {
23-
bgcolor="#323232A1"
2425
newrank=true
2526
// ratio="0.65"
2627
node [
2728
fontcolor="#FEFEFE"
2829
fontsize=14
29-
fontname=Arial
3030
]
3131
pad="0"
3232
margin="0"
3333
subgraph cluster_hierarchy {
34-
bgcolor="#24242400"
3534
color="#24242400"
3635
node [
36+
fontcolor="#FEFEFE"
3737
style=filled
38-
color="#FEFEFE7f"
38+
color="var(--md-graphviz-edge-color)"
3939
]
40-
edge [color="#FEFEFE" style="setlinewidth(2)"]
40+
edge [style="setlinewidth(2)"]
4141
subgraph lvl_0 {
4242
"0o0" [
4343
shape="circle"
4444
style="radial"
45-
fillcolor="0.85:#018268;0:#000"
45+
fillcolor="#000000;0.85:#018268"
4646
]
4747
}
4848
subgraph lvl_1 {
@@ -68,10 +68,7 @@ integers and use an octal counting scheme.
6868
"0o324" -- "0o2324"; "0o324" -- "0o3324"; "0o324" -- "0o4324"; "0o324" -- "0o5324"
6969
}
7070
subgraph cluster_legend {
71-
bgcolor="#242424"
72-
color="#24242400"
7371
"Legend" [
74-
color="#FEF9A9"
7572
shape=plain
7673
margin=0
7774
label=<
@@ -81,7 +78,7 @@ integers and use an octal counting scheme.
8178
</TR>
8279
<TR>
8380
<TD>Network Level 0</TD>
84-
<TD BORDER="1" STYLE="rounded,radial" BGCOLOR="#000:#018268"> </TD>
81+
<TD BORDER="1" STYLE="rounded,radial" BGCOLOR="#000000:#018268"> </TD>
8582
</TR>
8683
<TR>
8784
<TD>Network Level 1</TD>
@@ -108,6 +105,7 @@ integers and use an octal counting scheme.
108105
}
109106
}
110107

108+
111109
Hopefully, you should see the pattern. There can be up to a maximum of 5 network levels (that's
112110
0-4 ordered from lowest to highest).
113111

@@ -128,40 +126,57 @@ graph only demonstrates
128126

129127
graph network_levels {
130128
layout=twopi
131-
bgcolor="#323232A1"
132129
ratio="0.825"
133-
node [
134-
style=filled
135-
fontcolor="#FEFEFE"
136-
color="#FEFEFE7f"
137-
fontsize=14
138-
fontname=Arial
139-
]
140-
edge [color="#FEFEFE" style="setlinewidth(2)"]
130+
edge [style="setlinewidth(2)"]
141131
ranksep="0.85:0.9:0.95:1.1"
142132
subgraph lvl_0 {
133+
node [
134+
color="var(--md-graphviz-edge-color)"
135+
fontcolor="#FEFEFE"
136+
fontsize=14
137+
]
143138
"0o0" [
144139
root=true
145140
shape="circle"
146141
style="radial"
147-
fillcolor="0.9:#018268;0:#000"
142+
fillcolor="#000000;0.9:#018268"
148143
]
149144
}
150145
subgraph lvl_1 {
151-
node [fillcolor="#3E0180"]
146+
node [
147+
fillcolor="#3E0180"
148+
color="var(--md-graphviz-edge-color)"
149+
fontcolor="#FEFEFE"
150+
fontsize=14
151+
]
152152
"0o1" "0o2" "0o3" "0o4" "0o5"
153153
}
154154
subgraph lvl_2 {
155-
node [fillcolor="#014B80"]
155+
node [
156+
fillcolor="#014B80"
157+
color="var(--md-graphviz-edge-color)"
158+
fontcolor="#FEFEFE"
159+
fontsize=14
160+
]
156161
"0o11" "0o21" "0o12" "0o22" "0o13" "0o23" "0o14" "0o24" "0o15" "0o25"
157162
}
158163
subgraph lvl_3 {
159-
node [fillcolor="#0E6902"]
164+
node [
165+
fillcolor="#0E6902"
166+
color="var(--md-graphviz-edge-color)"
167+
fontcolor="#FEFEFE"
168+
fontsize=14
169+
]
160170
"0o311" "0o411" "0o321" "0o421" "0o312" "0o412" "0o322" "0o422" "0o313" "0o413"
161171
"0o323" "0o423" "0o314" "0o414" "0o324" "0o424" "0o315" "0o415" "0o325" "0o425"
162172
}
163173
subgraph lvl_4 {
164-
node [fillcolor="#80010B"]
174+
node [
175+
fillcolor="#80010B"
176+
color="var(--md-graphviz-edge-color)"
177+
fontcolor="#FEFEFE"
178+
fontsize=14
179+
]
165180
"0o5311" "0o5411" "0o5321" "0o5312" "0o5421" "0o5313" "0o5314" "0o5315" "0o5322"
166181
"0o5323" "0o5324" "0o5325" "0o5412" "0o5423" "0o5422" "0o5413" "0o5414" "0o5424"
167182
"0o5415" "0o5425"

0 commit comments

Comments
 (0)