Skip to content

Commit 4e191ad

Browse files
authored
Merge pull request #156 from jwcooper/libraries
Libraries and Contributing page
2 parents 72f49e5 + a1a8e2e commit 4e191ad

File tree

8 files changed

+1348
-141
lines changed

8 files changed

+1348
-141
lines changed

_data/libraries.json

Lines changed: 1032 additions & 140 deletions
Large diffs are not rendered by default.

_includes/header.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
<div class="site-navigation">
1818
<a href="{{ "/downloads" | relative_url }}">DOWNLOADS</a>
19-
<a href="https://circuitpython.readthedocs.io/projects/bundle/en/latest/drivers.html">LIBRARIES</a>
19+
<a href="{{ "/libraries" | relative_url }}">LIBRARIES</a>
2020
<a href="https://blog.adafruit.com/category/circuitpython">NEWS</a>
2121
<a href="https://adafru.it/discord">DISCORD</a>
2222
<a href="{{ "/awesome" | relative_url }}">AWESOME</a>

assets/css/main.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@
1616
@import 'pages/download';
1717
@import 'pages/awesome';
1818
@import 'pages/stats';
19+
@import 'pages/libraries';

assets/javascript/libraries.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
document.addEventListener('DOMContentLoaded', function() {
2+
async function getLatestReleases() {
3+
let response = await fetch('https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Bundle/releases/latest');
4+
let data = await response.json();
5+
return data;
6+
}
7+
8+
function buildReleaseLinks(data) {
9+
let releaseList = document.querySelector('.release-list');
10+
11+
data.assets.forEach(function(asset) {
12+
let name = asset.name;
13+
14+
if (name.slice(-6) === 'ignore') {
15+
// any .ignore files in the assets list
16+
return;
17+
}
18+
19+
let versionId = name.replace(/(-[\d]+.zip$)/, '');
20+
let versionElement = document.getElementById(versionId);
21+
22+
if (!versionElement) {
23+
// likely an older version we don't want to link to, such as 2.x
24+
return;
25+
}
26+
27+
let iconElement = document.createElement('i');
28+
iconElement.className = "fas fa-download";
29+
30+
let linkElement = document.createElement('a');
31+
linkElement.title = "Library Bundle Download";
32+
linkElement.href = asset.browser_download_url;
33+
linkElement.className = "purple-button-link";
34+
let linkText = document.createTextNode(asset.name);
35+
linkElement.appendChild(linkText);
36+
linkElement.appendChild(iconElement);
37+
versionElement.appendChild(linkElement);
38+
});
39+
}
40+
41+
getLatestReleases().then(buildReleaseLinks);
42+
});

assets/sass/base/_base.scss

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,17 @@ h1, h2, h3, h4, h5 {
1919
max-width: 100%;
2020
height: auto;
2121
}
22+
23+
a.purple-button-link {
24+
display: inline-block;
25+
width: auto;
26+
padding: 15px 30px 15px 30px;
27+
color: #fff;
28+
border-radius: 5px;
29+
border: none;
30+
background-color: $purple;
31+
32+
i {
33+
padding-left: 10px;
34+
}
35+
}

assets/sass/pages/_libraries.scss

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#libraries-page {
2+
.content {
3+
h1 {
4+
text-align: center;
5+
}
6+
7+
p {
8+
margin-bottom: 16px;
9+
}
10+
11+
h2 {
12+
border-bottom: 1px solid $gray-border;
13+
padding-bottom: .3em;
14+
margin-bottom: 16px;
15+
margin-top: 24px;
16+
}
17+
18+
ul {
19+
margin-bottom: 16px;
20+
li {
21+
margin-top: .25em;
22+
}
23+
}
24+
}
25+
26+
.release-section {
27+
margin-left: 20px;
28+
}
29+
}

libraries/contributing.html

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
---
2+
layout: default
3+
title: Libraries - Contributing
4+
permalink: /libraries/contributing
5+
---
6+
7+
<!-- https://github.com/adafruit/circuitpython/issues/1246 -->
8+
9+
<div id="libraries-page" class="common-layout">
10+
<div class="content">
11+
<h1>Contributing</h1>
12+
<p>
13+
If you'd like to contribute to the CircuitPython project, the CircuitPython
14+
libraries are a great way to begin. This page is updated weekly with status
15+
information from the CircuitPython libraries, including open issues and
16+
repo-level issues.
17+
</p>
18+
<p>
19+
If this is your first time contributing, or you'd
20+
like to see our recommended contribution workflow, we have a guide on
21+
<a href="https://learn.adafruit.com/contribute-to-circuitpython-with-git-and-github">Contributing to CircuitPython with Git and Github</a>.
22+
You can also find us in the #circuitpython channel on the
23+
<a href="https://adafru.it/discord">Adafruit Discord</a>.
24+
</p>
25+
<p>
26+
Have an idea for a new driver or library?
27+
<a href="https://github.com/adafruit/circuitpython/issues">File an issue on the CircuitPython repo!</a>
28+
</p>
29+
<h2>Current Status for Week of {{ site.data.libraries.updated_at | date: "%a, %b %d, %Y" }}</h2>
30+
<p>
31+
This is the current status of open pull requests and issues across all of the library repos.
32+
</p>
33+
<div class="libraries open-pull-requests">
34+
<h3>Open Pull Requests</h3>
35+
<ul>
36+
{% for library in site.data.libraries.pull_requests %}
37+
<li>
38+
{{library[0]}}
39+
<ul>
40+
{% for issue in library[1] %}
41+
{% for details in issue %}
42+
<li><a href="{{ details[0] }}">{{ details[1] }}</a></li>
43+
{% endfor %}
44+
{% endfor %}
45+
</ul>
46+
</li>
47+
{% endfor %}
48+
</ul>
49+
</div>
50+
<div class="libraries open-issues">
51+
<h3>Open Issues</h3>
52+
<ul>
53+
{% for library in site.data.libraries.open_issues %}
54+
<li>
55+
{{library[0]}}
56+
<ul>
57+
{% for issue in library[1] %}
58+
{% for details in issue %}
59+
<li><a href="{{ details[0] }}">{{ details[1] }}</a></li>
60+
{% endfor %}
61+
{% endfor %}
62+
</ul>
63+
</li>
64+
{% endfor %}
65+
</ul>
66+
</div>
67+
<h2>Library Infrastructure Issues</h2>
68+
<p>
69+
The following are issues with the library infrastructure. Having a standard library structure
70+
greatly improves overall maintainability. Accordingly, we have a series of checks to ensure
71+
the standard is met. Most of these are changes that can be made via a pull request, however
72+
there are a few checks reported here that require changes to GitHub settings. If you are
73+
interested in addressing any of these issues, please feel free to contact us with any questions.
74+
</p>
75+
<p>
76+
If you're looking for a Good First Issue to begin contributing, consider the two issues related to
77+
example naming: "Example file(s) missing sensor/library name." and "Missing simpletest example."
78+
Every repo should have a <code>libraryname_simpletest.py</code> file in the examples folder at a
79+
minimum. Any other included examples should be prefixed with <code>libraryname_</code> so all
80+
examples found in any given repo folder start with the library name followed by an underscore.
81+
The GitHub end of things is a simple fix, however, please be aware many examples are linked in
82+
Learn guides. You should mention in your pull request that it is possible that guides will
83+
require updating to match the new example name.
84+
</p>
85+
<div class="libraries">
86+
<ul>
87+
{% for repo_issue in site.data.libraries.repo_infrastructure_errors %}
88+
<li>
89+
{{repo_issue[0]}}
90+
<ul>
91+
{% for issue in repo_issue[1] %}
92+
<li><a href="{{ issue }}">{{ issue }}</a></li>
93+
{% endfor %}
94+
</ul>
95+
</li>
96+
{% endfor %}
97+
</ul>
98+
</div>
99+
</div>
100+
</div>

libraries/index.html

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
---
2+
layout: default
3+
title: Libraries
4+
permalink: /libraries
5+
---
6+
7+
<div id="libraries-page" class="common-layout">
8+
<div class="content">
9+
<h1>CircuitPython Libraries</h1>
10+
<p>
11+
The CircuitPython Library Bundle contains all current libraries available for
12+
CircuitPython. They are designed for use with CircuitPython and may or may not
13+
work with MicroPython. The bundle options are explained below.
14+
<p>
15+
CircuitPython libraries are separate files designed to work with CircuitPython code.
16+
CircuitPython programs require a lot of information to run. CircuitPython is so simple
17+
to use because most of this information is processed in the background and stored in
18+
libraries. Some libraries are built into CircuitPython. Others are downloaded and
19+
stored on your CIRCUITPY drive in a folder called lib.
20+
</p>
21+
<p>
22+
The full list of all the CircuitPython libraries contained in the following bundles
23+
can be found on the
24+
<a href="https://circuitpython.readthedocs.io/projects/bundle/en/latest/drivers.html" title="">libraries page</a>.
25+
<h2>Download and Installation Instructions</h2>
26+
<p>
27+
The libraries in each release are compiled to .mpy for all recent major versions
28+
of CircuitPython. Please download the bundle that matches the major version
29+
of your CircuitPython. For example, if you are running 4.0.0 you should
30+
download the 4.x bundle. The .mpy files are designed to take up less space on
31+
your CIRCUITPY drive. Unless you have a specific reason, choose the appropiate
32+
.mpy library bundle!
33+
</p>
34+
<p>
35+
<b>To install</b>, download the appropriate bundle for your version of CircuitPython.
36+
Unzip the file, open the resulting folder and find the lib folder. Open the lib
37+
folder and find the library files you need to load. Create a lib folder on your
38+
CIRCUITPY drive. Copy the individual library files you need to the lib folder
39+
on your CIRCUITPY drive.
40+
</p>
41+
<p>
42+
You can always find the
43+
<a href="https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases/latest">latest releases of the libraries bundle</a>
44+
on GitHub.
45+
<div class="release-section">
46+
<div id="adafruit-circuitpython-bundle-4.x-mpy">
47+
<h3>Bundle Version 4.x</h3>
48+
<p>
49+
This bundle is built for use with CircuitPython 4.x.x. If you are using
50+
CircuitPython 4, please download this bundle.
51+
</p>
52+
</div>
53+
<div id="adafruit-circuitpython-bundle-3.x-mpy">
54+
<h3>Bundle Version 3.x</h3>
55+
<p>
56+
This bundle is built for use with CircuitPython 3.x.x. If you are using
57+
CircuitPython 3, please download this bundle.
58+
</p>
59+
</div>
60+
<div id="adafruit-circuitpython-bundle-py">
61+
<h3>Bundle Version py</h3>
62+
<p>
63+
This bundle is the uncompiled source code for every library. It is not
64+
intended for general use! It is only recommended if you need to edit
65+
a library file. This bundle works with all versions of CircuitPython.
66+
</p>
67+
</div>
68+
<div id="adafruit-circuitpython-bundle-examples">
69+
<h3>Bundle Examples</h3>
70+
<p>
71+
Every CircuitPython library has examples to go along with it. This bundle
72+
contains every library example. This bundle will have examples that
73+
require the latest version of CircuitPython, and therefore contains files
74+
that may not work with all versions.
75+
</p>
76+
</div>
77+
</div>
78+
<h2>Contributing</h2>
79+
<p>
80+
If you'd like to contribute to the CircuitPython project, the CircuitPython
81+
libraries are a great way to begin. Everyone is welcome to contribute!
82+
Regardless of your experience level, we have many resources to get you
83+
started. Check out the Contributing page for detailed information!
84+
</p>
85+
<p>
86+
Find out more about how you can
87+
<a href="{{ "/libraries/contributing" | relative_url }}" title="Contributing Page">contribute to CircuitPython libraries</a>.
88+
</p>
89+
<h2>Library Activity for Week of {{ site.data.libraries.updated_at | date: "%a, %b %d, %Y" }}</h2>
90+
<p>
91+
Thank you to all of our contributors!
92+
</p>
93+
<p>
94+
This week there were {{ site.data.libraries.merged_pr_count }} pull requests merged:
95+
<ul>
96+
<li>
97+
Authors:
98+
{% for contributor in site.data.libraries.contributors %}
99+
<a href="https://github.com/{{contributor}}" title="Contributor Name">{{contributor}}</a>{% if forloop.last != true %}, {% endif %}
100+
{% endfor %}
101+
</li>
102+
<li>
103+
Reviewers:
104+
{% for reviewer in site.data.libraries.reviewers %}
105+
<a href="https://github.com/{{reviewer}}" title="Contributor Name">{{reviewer}}</a>{% if forloop.last != true %}, {% endif %}
106+
{% endfor %}
107+
</li>
108+
</ul>
109+
</p>
110+
<div class="libraries new">
111+
<h3>New Libraries</h3>
112+
<ul>
113+
{% for library in site.data.libraries.library_updates.new %}
114+
<li><a href="{{library[1]}}" title="New Library Location">{{library[0]}}</a></li>
115+
{% endfor %}
116+
</ul>
117+
</div>
118+
<div class="libraries updated">
119+
<h3>Updated Libraries</h3>
120+
<ul>
121+
{% for library in site.data.libraries.library_updates.updated %}
122+
<li><a href="{{library[1]}}" title="Updated Library Location">{{library[0]}}</a></li>
123+
{% endfor %}
124+
</ul>
125+
</div>
126+
</div>
127+
</div>
128+
129+
<script src="/assets/javascript/libraries.js"></script>

0 commit comments

Comments
 (0)