Skip to content

Commit b0f7c7b

Browse files
committed
Merge remote-tracking branch 'origin/master' into nrf-pwm-audio
2 parents 3b3a7bb + 366fdcc commit b0f7c7b

File tree

47 files changed

+917
-314
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+917
-314
lines changed

.travis.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ git:
2121
# that SDK is shortest and add it there. In the case of major re-organizations,
2222
# just try to make the builds "about equal in run time"
2323
env:
24-
- TRAVIS_TESTS="unix docs translations website" TRAVIS_BOARDS="circuitplayground_express mini_sam_m4 grandcentral_m4_express capablerobot_usbhub pygamer pca10056 pca10059 feather_nrf52840_express makerdiary_nrf52840_mdk makerdiary_nrf52840_mdk_usb_dongle particle_boron particle_argon particle_xenon sparkfun_nrf52840_mini electronut_labs_papyr electronut_labs_blip" TRAVIS_SDK=arm:nrf
24+
- TRAVIS_TESTS="unix docs translations website" TRAVIS_BOARDS="trinket_m0_haxpress circuitplayground_express mini_sam_m4 grandcentral_m4_express capablerobot_usbhub pygamer pca10056 pca10059 feather_nrf52840_express makerdiary_nrf52840_mdk makerdiary_nrf52840_mdk_usb_dongle particle_boron particle_argon particle_xenon sparkfun_nrf52840_mini electronut_labs_papyr electronut_labs_blip" TRAVIS_SDK=arm:nrf
2525
- TRAVIS_BOARDS="metro_m0_express metro_m4_express metro_m4_airlift_lite pirkey_m0 trellis_m4_express trinket_m0 sparkfun_lumidrive sparkfun_redboard_turbo bast_pro_mini_m0 datum_distance pyruler" TRAVIS_SDK=arm
26-
- TRAVIS_BOARDS="feather_radiofruit_zigbee gemma_m0 hallowing_m0_express itsybitsy_m0_express itsybitsy_m4_express meowmeow sam32 uchip escornabot_makech pygamer_advance datum_imu" TRAVIS_SDK=arm
27-
- TRAVIS_BOARDS="feather_m0_express_crickit feather_m0_rfm69 feather_m0_rfm9x feather_m4_express arduino_zero arduino_mkr1300 arduino_mkrzero pewpew10 kicksat-sprite ugame10 robohatmm1 datum_light" TRAVIS_SDK=arm
28-
- TRAVIS_BOARDS="circuitplayground_express_crickit feather_m0_adalogger feather_m0_basic feather_m0_express catwan_usbstick pyportal sparkfun_samd21_mini sparkfun_samd21_dev pybadge pybadge_airlift datum_weather" TRAVIS_SDK=arm
26+
- TRAVIS_BOARDS="cp32-m4 feather_radiofruit_zigbee gemma_m0 hallowing_m0_express itsybitsy_m0_express itsybitsy_m4_express meowmeow sam32 uchip escornabot_makech pygamer_advance datum_imu" TRAVIS_SDK=arm
27+
- TRAVIS_BOARDS="feather_m0_supersized feather_m0_express_crickit feather_m0_rfm69 feather_m0_rfm9x feather_m4_express arduino_zero arduino_mkr1300 arduino_mkrzero pewpew10 kicksat-sprite ugame10 robohatmm1_m0 robohatmm1_m4 datum_light" TRAVIS_SDK=arm
28+
- TRAVIS_BOARDS="datalore_ip_m4 circuitplayground_express_crickit feather_m0_adalogger feather_m0_basic feather_m0_express catwan_usbstick pyportal sparkfun_samd21_mini sparkfun_samd21_dev pybadge pybadge_airlift datum_weather" TRAVIS_SDK=arm
2929

3030
addons:
3131
artifacts:
@@ -71,7 +71,6 @@ before_script:
7171
- function var_search () { case "$1" in *$2*) true;; *) false;; esac; }
7272
- sudo dpkg --add-architecture i386
7373

74-
7574
- (! var_search "${TRAVIS_SDK-}" arm || (wget https://s3.amazonaws.com/adafruit-circuit-python/gcc-arm-embedded_7-2018q2-1~xenial1_amd64.deb && sudo dpkg -i gcc-arm-embedded*_amd64.deb))
7675

7776
# For huzzah builds
@@ -80,12 +79,16 @@ before_script:
8079

8180
# For coverage testing (upgrade is used to get latest urllib3 version)
8281
- sudo apt-get install -y python3-pip
83-
- pip3 install --user sh click
82+
- pip3 install --user sh click setuptools
8483
- ([[ -z "$TRAVIS_TESTS" ]] || sudo pip install --upgrade cpp-coveralls)
8584
- (! var_search "${TRAVIS_TESTS-}" docs || sudo apt-get install -y librsvg2-bin)
86-
- (! var_search "${TRAVIS_TESTS-}" docs || pip install --user Sphinx sphinx-rtd-theme recommonmark sphinxcontrib-svg2pdfconverter)
85+
- (! var_search "${TRAVIS_TESTS-}" docs || pip3 install --user Sphinx sphinx-rtd-theme recommonmark sphinxcontrib-svg2pdfconverter)
8786
- (! var_search "${TRAVIS_TESTS-}" translations || pip3 install --user polib)
8887

88+
# Check if there's any board missing in TRAVIS_BOARDS
89+
- cd tools && python3 -u travis_new_boards_check.py
90+
- cd ..
91+
8992
# report some good version numbers to the build
9093
- gcc --version
9194
- (! var_search "${TRAVIS_SDK-}" arm || arm-none-eabi-gcc --version)

conf.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# All configuration values have a default; values that are commented out
1414
# serve to show the default.
1515

16+
import json
1617
import sys
1718
import os
1819

@@ -24,8 +25,20 @@
2425
sys.path.insert(0, os.path.abspath('docs'))
2526
sys.path.insert(0, os.path.abspath('.'))
2627

28+
import shared_bindings_matrix
29+
2730
master_doc = 'docs/index'
2831

32+
# Grab the JSON values to use while building the module support matrix
33+
# in 'shared-bindings/index.rst'
34+
35+
#modules_support_matrix = shared_bindings_matrix.support_matrix_excluded_boards()
36+
modules_support_matrix = shared_bindings_matrix.support_matrix_by_board()
37+
38+
html_context = {
39+
'support_matrix': modules_support_matrix
40+
}
41+
2942
# -- General configuration ------------------------------------------------
3043

3144
# If your documentation needs a minimal Sphinx version, state it here.
@@ -40,7 +53,9 @@
4053
'sphinxcontrib.rsvgconverter',
4154
'sphinx.ext.intersphinx',
4255
'sphinx.ext.todo',
43-
'sphinx.ext.coverage'
56+
'sphinx.ext.coverage',
57+
'rstjinja',
58+
'c2rst'
4459
]
4560

4661
# Add any paths that contain templates here, relative to this directory.
@@ -49,8 +64,7 @@
4964
# The suffix of source filenames.
5065
source_suffix = ['.rst', '.md', '.c', '.h']
5166

52-
source_parsers = {'.md': CommonMarkParser,
53-
'.c': "c2rst.CStrip", '.h': "c2rst.CStrip"}
67+
source_parsers = {'.md': CommonMarkParser}
5468

5569
# The encoding of source files.
5670
#source_encoding = 'utf-8-sig'

docs/c2rst.py

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,31 @@
1-
import sphinx.parsers
1+
def c2rst(app, docname, source):
2+
""" Pre-parse '.c' & '.h' files that contain rST source.
3+
"""
4+
# Make sure we're outputting HTML
5+
if app.builder.format != 'html':
6+
return
27

3-
class CStrip(sphinx.parsers.Parser):
4-
def __init__(self):
5-
self.rst_parser = sphinx.parsers.RSTParser()
8+
fname = app.env.doc2path(docname)
9+
if (not fname.endswith(".c") and
10+
not fname.endswith(".h")):
11+
#print("skipping:", fname)
12+
return
613

7-
def parse(self, inputstring, document):
8-
# This setting is missing starting with Sphinx 1.7.1 so we set it ourself.
9-
document.settings.tab_width = 4
10-
document.settings.character_level_inline_markup = False
11-
stripped = []
12-
for line in inputstring.split("\n"):
13-
line = line.strip()
14-
if line == "//|":
15-
stripped.append("")
16-
elif line.startswith("//| "):
17-
stripped.append(line[len("//| "):])
18-
stripped = "\r\n".join(stripped)
19-
self.rst_parser.parse(stripped, document)
14+
src = source[0]
15+
16+
stripped = []
17+
for line in src.split("\n"):
18+
line = line.strip()
19+
if line == "//|":
20+
stripped.append("")
21+
elif line.startswith("//| "):
22+
stripped.append(line[len("//| "):])
23+
stripped = "\r\n".join(stripped)
24+
25+
rendered = app.builder.templates.render_string(
26+
stripped, app.config.html_context
27+
)
28+
source[0] = rendered
29+
30+
def setup(app):
31+
app.connect("source-read", c2rst)

docs/library/network.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
.. include:: ../templates/unsupported_in_circuitpython.inc
66

77
.. module:: network
8+
:noindex:
89
:synopsis: network configuration
910

1011
This module provides network drivers and routing configuration. To use this

docs/rstjinja.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Derived from code on Eric Holscher's blog, found at:
2+
# https://www.ericholscher.com/blog/2016/jul/25/integrating-jinja-rst-sphinx/
3+
4+
def rstjinja(app, docname, source):
5+
"""
6+
Render our pages as a jinja template for fancy templating goodness.
7+
"""
8+
# Make sure we're outputting HTML
9+
if app.builder.format != 'html':
10+
return
11+
12+
# we only want our one jinja template to run through this func
13+
if "shared-bindings/support_matrix" not in docname:
14+
return
15+
16+
src = source[0]
17+
print(docname)
18+
rendered = app.builder.templates.render_string(
19+
src, app.config.html_context
20+
)
21+
source[0] = rendered
22+
23+
def setup(app):
24+
app.connect("source-read", rstjinja)

0 commit comments

Comments
 (0)