Skip to content

Commit b8d8c62

Browse files
pllimtomdonaldson
andauthored
Post-APE 22 listing (#590)
* Post-APE 22 listing Co-authored-by: Tom Donaldson <[email protected]> * Assume package_name is also pypi_name and make GH username a link for maintainer full name. * Replace HTTP with HTTPS on affiliated page and add a generic link back to pyOpenSci --------- Co-authored-by: Tom Donaldson <[email protected]>
1 parent 2605341 commit b8d8c62

File tree

3 files changed

+265
-14
lines changed

3 files changed

+265
-14
lines changed

affiliated/index.html

+117-13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE html>
2-
<html xmlns="http://www.w3.org/1999/xhtml">
2+
<html xmlns="https://www.w3.org/1999/xhtml">
33
<head>
44
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
55
<meta name="description" content="Astropy. A Community Python Library for Astronomy." />
@@ -23,7 +23,7 @@
2323
<nav>
2424
<div id="mobile-header">
2525
<!-- Menu Icon -->
26-
<a id="responsive-menu-button" href="#sidr-main"><div><svg senable-background="new 0 0 24 24" height="24px" id="Layer_1" version="1.1" viewBox="0 0 24 24" width="24px" x="0px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" y="0px"><g><g><path d="M23.244,17.009H0.75c-0.413,0-0.75,0.36-0.75,0.801v3.421C0,21.654,0.337,22,0.75,22h22.494c0.414,0,0.75-0.346,0.75-0.77 V17.81C23.994,17.369,23.658,17.009,23.244,17.009z M23.244,9.009H0.75C0.337,9.009,0,9.369,0,9.81v3.421 c0,0.424,0.337,0.769,0.75,0.769h22.494c0.414,0,0.75-0.345,0.75-0.769V9.81C23.994,9.369,23.658,9.009,23.244,9.009z M23.244,1.009H0.75C0.337,1.009,0,1.369,0,1.81V5.23c0,0.423,0.337,0.769,0.75,0.769h22.494c0.414,0,0.75-0.346,0.75-0.769V1.81 C23.994,1.369,23.658,1.009,23.244,1.009z"/></g></g></svg></div></a>
26+
<a id="responsive-menu-button" href="#sidr-main"><div><svg senable-background="new 0 0 24 24" height="24px" id="Layer_1" version="1.1" viewBox="0 0 24 24" width="24px" x="0px" xml:space="preserve" xmlns="https://www.w3.org/2000/svg" xmlns:xlink="https://www.w3.org/1999/xlink" y="0px"><g><g><path d="M23.244,17.009H0.75c-0.413,0-0.75,0.36-0.75,0.801v3.421C0,21.654,0.337,22,0.75,22h22.494c0.414,0,0.75-0.346,0.75-0.77 V17.81C23.994,17.369,23.658,17.009,23.244,17.009z M23.244,9.009H0.75C0.337,9.009,0,9.369,0,9.81v3.421 c0,0.424,0.337,0.769,0.75,0.769h22.494c0.414,0,0.75-0.345,0.75-0.769V9.81C23.994,9.369,23.658,9.009,23.244,9.009z M23.244,1.009H0.75C0.337,1.009,0,1.369,0,1.81V5.23c0,0.423,0.337,0.769,0.75,0.769h22.494c0.414,0,0.75-0.346,0.75-0.769V1.81 C23.994,1.369,23.658,1.009,23.244,1.009z"/></g></g></svg></div></a>
2727
<!-- -->
2828
</div>
2929
<a href="../index.html"><img src="../images/astropy_word.svg" height="32" onerror="this.src='../images/astropy_word_32.png; this.onerror=null;"/></a>
@@ -46,10 +46,10 @@
4646
<li><a href="../contribute.html">Contribute</a></li>
4747
<li>
4848
<div class="dropdown">
49-
<a href="http://docs.astropy.org">Documentation</a>
49+
<a href="https://docs.astropy.org">Documentation</a>
5050
<div class="dropdown-content">
5151
<ul>
52-
<li><a href="http://docs.astropy.org" target="_blank">Current Release</a></li>
52+
<li><a href="https://docs.astropy.org" target="_blank">Current Release</a></li>
5353
<li><a href="http://devdocs.astropy.org/" target="_blank">In Development</a></li>
5454
</ul>
5555
</div>
@@ -60,7 +60,7 @@
6060

6161
</ul> </div>
6262
<div class="search pull-right">
63-
<form action="http://docs.astropy.org/en/stable/search.html" method="get">
63+
<form action="https://docs.astropy.org/en/stable/search.html" method="get">
6464
<input type="text" name="q" placeholder="Search Documentation" />
6565
<input type="hidden" name="check_keywords" value="yes" />
6666
<input type="hidden" name="area" value="default" />
@@ -166,16 +166,48 @@ <h1 id="coordinated-package-list">Coordinated Packages<a class="paralink" href="
166166
<section id="affiliated-package-registry">
167167
<h1 id="affiliated-package-list">Affiliated Packages Registry<a class="paralink" href="#affiliated-package-list" title="Permalink to this headline"></a></h1>
168168
<p>The following table lists all currently registered affiliated packages.</p>
169-
<p>NOTE: The listing is currently empty because Astropy has just accepted
169+
<p>NOTE: The listing is currently minimal because Astropy has just accepted
170170
<a href="https://github.com/astropy/astropy-APEs/blob/main/APE22.rst">APE 22</a>
171171
in January 2024. We are in the midst of transitioning to the new process in
172172
partnership with pyOpenSci, so we really appreciate your patience.
173173
</p>
174174

175-
<!-- TODO: Leah Wasser is going to give Erik Tollerud some RSS/XML to ingest here
176-
(maybe https://github.com/pyOpenSci/pyopensci.github.io/blob/main/_data/packages.yml).
177-
We have promised pyOpenSci that we would also link back to their canonical listing
178-
here, with their Astropy filter applied. -->
175+
<p>Total number of post-APE 22 affiliated packages: <strong id="total-pyos-pkgs"></strong></p>
176+
177+
<table border="1" class="docutils" id="pyos-package-table">
178+
<colgroup>
179+
<col width="5%" />
180+
<col width="3%" />
181+
<col width="3%" />
182+
<col/>
183+
</colgroup>
184+
<thead valign="bottom">
185+
<tr class="row-odd">
186+
<th class="head"></th>
187+
<th class="head"></th>
188+
<th class="head"></th>
189+
<th class="head"></th>
190+
</tr>
191+
</thead>
192+
<tbody valign="top">
193+
<tr class="row-even"><td rowspan="1">Loading...</td>
194+
<td rowspan="1">&nbsp;</td>
195+
<td rowspan="1">&nbsp;</td>
196+
<td rowspan="1">&nbsp;</td>
197+
<td rowspan="1">&nbsp;</td>
198+
</tr>
199+
<tr class="row-odd">
200+
<td colspan="1">&nbsp;</td>
201+
<td colspan="3">&nbsp;</td>
202+
</tr>
203+
</tbody>
204+
</table>
205+
206+
<!-- TODO: We have promised pyOpenSci that we would also link back to their canonical listing
207+
here, with their Astropy filter applied. Waiting for resolution of
208+
https://github.com/pyOpenSci/software-peer-review/issues/268
209+
but for now just do a generic link to their listing. -->
210+
<p>All accepted pyOpenSci packages available <a href="https://www.pyopensci.org/python-packages.html">here</a>.</p>
179211

180212
</section>
181213

@@ -252,7 +284,7 @@ <h1 id="becoming-an-affiliated-package">Becoming an Affiliated Package<a class="
252284
<li>Specifically use, interface with, or provide complementary capabilities
253285
to other Astropy packages.</li>
254286

255-
<li>Use <a href="http://docs.astropy.org/">classes and functions from the
287+
<li>Use <a href="https://docs.astropy.org/">classes and functions from the
256288
astropy core package</a> wherever possible and appropriate, and (as much as
257289
possible) avoid duplication with other packages in the Astropy ecosystem.
258290
This facilitates re-use of code and sharing of resources.</li>
@@ -344,13 +376,85 @@ <h2 id="new-affil-reviewer">I am a new reviewer<a class="paralink" href="#new-af
344376
<script src="../js/jquery.sidr.min.js"></script>
345377
<script src="../js/functions.js"></script>
346378

347-
348-
<script type="text/javascript">
379+
<script type="text/javascript">
349380
$(document).ready(function() {
350381
$.getJSON("registry.json", populateTables);
351382
});
352383
</script>
353384

385+
<!-- Tom Donaldson: The idea was to use the existing YAML parser that works fine in nodejs,
386+
but bundle it for use in a client. So I created yaml_parse.js
387+
388+
import parse from 'yaml'
389+
window.yaml = parse;
390+
391+
and then bundled it with a bundler I found called esbuild:
392+
393+
npm install --save-exact --save-dev esbuild
394+
./node_modules/.bin/esbuild yaml_parse.js --bundle --minify --outfile=yaml_parse_bundle.js
395+
-->
396+
<script src="../js/yaml_parse_bundle.js"></script>
397+
398+
<script>
399+
fetch('https://raw.githubusercontent.com/pyOpenSci/pyopensci.github.io/main/_data/packages.yml')
400+
.then(response => response.text())
401+
.then(yamlString => {
402+
var parsed = yaml.parse(yamlString);
403+
var i = 0;
404+
405+
// We have to delete the "Loading..." row
406+
var tab = document.getElementById("pyos-package-table");
407+
tab.deleteRow(1);
408+
409+
var info = "";
410+
for (var p=0; p<parsed.length; p++) {
411+
var package = parsed[p];
412+
if (package["partners"] == null || package["partners"].indexOf("astropy") == -1) {
413+
continue;
414+
}
415+
416+
namerow = tab.insertRow(i*4 + 1);
417+
418+
nmcell = namerow.insertCell(0);
419+
urlcell = namerow.insertCell(1);
420+
repocell = namerow.insertCell(2);
421+
pypicell = namerow.insertCell(3);
422+
423+
nmcell.innerHTML = package["package_name"];
424+
nmcell.className = 'first-package-row'
425+
nmcell.setAttribute('width', 100)
426+
urlcell.innerHTML = url_translator(package["gh_meta"]["documentation"]);
427+
repocell.innerHTML = repo_translator(package["repository_link"]);
428+
pypicell.innerHTML = pypi_translator(package["package_name"]); // FIXME: https://github.com/pyOpenSci/pyopensci.github.io/issues/390
429+
430+
descrow = tab.insertRow(i*4 + 2);
431+
descrow.insertCell(0).innerHTML = "";
432+
desccell = descrow.insertCell(1);
433+
desccell.colSpan = "3";
434+
desccell.innerHTML = package["package_description"];
435+
436+
var maintainers = package["all_current_maintainers"];
437+
var maintainers_str = "";
438+
for (var m=0; m<maintainers.length; m++) {
439+
maintainers_str += ghuser_translator(maintainers[m]["name"], maintainers[m]["github_username"]);
440+
if (m < (maintainers.length - 1)) {
441+
maintainers_str += ", ";
442+
}
443+
}
444+
445+
maintrow = tab.insertRow(i*4 + 3);
446+
maintrow.insertCell(0).innerHTML = "";
447+
maintcell = maintrow.insertCell(1);
448+
maintcell.colSpan = "3";
449+
maintcell.innerHTML = "Maintainer(s): " + maintainers_str;
450+
451+
i += 1;
452+
}
453+
document.getElementById("total-pyos-pkgs").innerHTML = i;
454+
;
455+
});
456+
</script>
457+
354458
<hr>
355459
<p>
356460
<img style="vertical-align:middle" src="../images/astropy_brandmark.png" height=20><span style="vertical-align:middle">

js/functions.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ function pypi_translator(pypiname) {
250250
if (pypiname === undefined) {
251251
return 'None';
252252
} else {
253-
var urltext = 'http://pypi.python.org/pypi/' + pypiname;
253+
var urltext = 'https://pypi.python.org/pypi/' + pypiname;
254254
return '<a href="' + urltext + '">' + 'PyPI' + '</a>';
255255
}
256256
}
@@ -263,6 +263,15 @@ function bool_translator(stable) {
263263
}
264264
}
265265

266+
function ghuser_translator(fullname, ghname) {
267+
if (fullname === undefined || ghname === undefined) {
268+
return 'None';
269+
} else {
270+
var urltext = 'https://github.com/' + ghname;
271+
return '<a href="' + urltext + '">' + fullname + '</a>';
272+
}
273+
}
274+
266275
var _email_regex_str = '[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}';
267276
var _email_regex = new RegExp(_email_regex_str, 'i');
268277
var _email_with_name_regex = new RegExp('(.+)<(' + _email_regex_str + ')>', 'i');

0 commit comments

Comments
 (0)