From 8cb76d5730c71a9d709b266c9313fccda89cbd64 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Wed, 27 Nov 2024 16:46:39 +0200 Subject: [PATCH 1/9] Issue #34 - Print the additional platforms in the `description` table column Signed-off-by: Martin Tzvetanov Grigorov --- source/_ext/bioconda_sphinx_ext.py | 22 +++++++++++++--------- source/templates/readme.rst_t | 14 ++++++++++++++ 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/source/_ext/bioconda_sphinx_ext.py b/source/_ext/bioconda_sphinx_ext.py index 6653cc9..af88f3b 100644 --- a/source/_ext/bioconda_sphinx_ext.py +++ b/source/_ext/bioconda_sphinx_ext.py @@ -53,13 +53,14 @@ from bioconda_utils.githandler import BiocondaRepo from bioconda_utils.lint import get_checks -# Aquire a logger +# Acquire a logger try: logger = sphinx_logging.getLogger(__name__) # pylint: disable=invalid-name except AttributeError: # not running within sphinx import logging logger = logging.getLogger(__name__) # pylint: disable=invalid-name +recipe_additional_platforms = {}; def as_extlink_filter(text): """Jinja2 filter converting identifier (list) to extlink format @@ -331,7 +332,7 @@ def add_target_and_index(self, name: str, sig: str, "Duplicate entry {} {} at {} (other in {})".format( self.objtype, name, self.lineno, self.env.doc2path(objects[key][0]))) - objects[key] = (self.env.docname, target_name) + objects[key] = (self.env.docname, target_name, recipe_additional_platforms[name]) index_text = self.get_index_text(name) if index_text: @@ -396,7 +397,7 @@ def generate(self, docnames: Optional[List[str]] = None): content = {} objects = sorted(self.domain.data['objects'].items()) - for (typ, name), (docname, labelid) in objects: + for (typ, name), (docname, labelid, description) in objects: if docnames and docname not in docnames: continue entries = content.setdefault(name[0].lower(), []) @@ -405,7 +406,7 @@ def generate(self, docnames: Optional[List[str]] = None): # TODO: Add meaningful info for extra/qualifier/description # fields, e.g., latest package version. # name, subtype, docname, labelid, 'extra', 'qualifier', 'description', - name, subtype, docname, labelid, '', '', '', + name, subtype, docname, labelid, '', '', description, )) collapse = True @@ -443,7 +444,7 @@ def clear_doc(self, docname: str): if 'objects' not in self.data: return to_remove = [ - key for (key, (stored_docname, _)) in self.data['objects'].items() + key for (key, (stored_docname, _, _)) in self.data['objects'].items() if docname == stored_docname ] for key in to_remove: @@ -497,7 +498,7 @@ def get_objects(self): - 2: object is unimportant (placed after full-text matches) - -1: object should not show up in search at all """ - for (typ, name), (docname, ref) in self.data['objects'].items(): + for (typ, name), (docname, ref, _) in self.data['objects'].items(): dispname = "{} '{}'".format(typ, name) yield name, dispname, typ, docname, ref, 1 @@ -505,9 +506,9 @@ def merge_domaindata(self, docnames: List[str], otherdata: Dict) -> None: """Merge in data regarding *docnames* from a different domaindata inventory (coming from a subprocess in parallel builds). """ - for (typ, name), (docname, ref) in otherdata['objects'].items(): + for (typ, name), (docname, ref, description) in otherdata['objects'].items(): if docname in docnames: - self.data['objects'][typ, name] = (docname, ref) + self.data['objects'][typ, name] = (docname, ref, description) # broken? #for key, data in otherdata['backrefs'].items(): # if docname in docnames: @@ -599,14 +600,17 @@ def generate_readme(recipe_basedir, output_dir, folder, repodata, renderer): 'depends' : depends, }) + recipe_extra = recipe.get('extra', None) template_options = { 'name': recipe.name, 'about': recipe.get('about', None), - 'extra': recipe.get('extra', None), + 'extra': recipe_extra, 'recipe': recipe, 'packages': packages, } + recipe_additional_platforms[recipe.name] = ', '.join(recipe_extra.get('additional-platforms', [])) + renderer.render_to_file(output_file, 'readme.rst_t', template_options) return [output_file] diff --git a/source/templates/readme.rst_t b/source/templates/readme.rst_t index 4e93bb8..9049bff 100644 --- a/source/templates/readme.rst_t +++ b/source/templates/readme.rst_t @@ -64,6 +64,20 @@ {%- endfor %} :requirements: + :additional platforms: + {% if extra and extra['additional-platforms']|length > 0 %} + .. raw:: html + + + {%- for platform in extra['additional-platforms'] -%} + {{ platform }} + {%- if not loop.last -%} + {{ ",\xa0 " }} + {%- endif -%} + {%- endfor -%} + + {% endif %} + .. rubric:: Installation You need a conda-compatible package manager From e8ceb5ca4ab5772c4476976e1cde0b2cc6b4de20 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Thu, 28 Nov 2024 11:43:31 +0200 Subject: [PATCH 2/9] Use https://datatables.net to render the HTML table with the recipe index The benefit of using DataTables.net is that it renders the DOM dynamically showing just a subset/page of the data at a time. It also provides filtering, sorting and many more settings (https://datatables.net/reference/option/) Also on top I have added a small table that shows the number of recipes with additional platforms and their ratio to the total. Signed-off-by: Martin Tzvetanov Grigorov --- source/_ext/bioconda_sphinx_ext.py | 24 +++---- source/templates/domainindex.html | 102 +++++++++++++++++++++++++++++ 2 files changed, 115 insertions(+), 11 deletions(-) create mode 100644 source/templates/domainindex.html diff --git a/source/_ext/bioconda_sphinx_ext.py b/source/_ext/bioconda_sphinx_ext.py index af88f3b..05b51f5 100644 --- a/source/_ext/bioconda_sphinx_ext.py +++ b/source/_ext/bioconda_sphinx_ext.py @@ -394,23 +394,22 @@ class PackageIndex(Index): def generate(self, docnames: Optional[List[str]] = None): """build index""" - content = {} + content = [] objects = sorted(self.domain.data['objects'].items()) for (typ, name), (docname, labelid, description) in objects: if docnames and docname not in docnames: continue - entries = content.setdefault(name[0].lower(), []) - subtype = 0 # 1 has subentries, 2 is subentry - entries.append(( - # TODO: Add meaningful info for extra/qualifier/description - # fields, e.g., latest package version. - # name, subtype, docname, labelid, 'extra', 'qualifier', 'description', - name, subtype, docname, labelid, '', '', description, - )) + + # TODO: Add meaningful info for extra/qualifier/description + # fields, e.g., latest package version. + content.append({ + "name": name, + "archs": description + }) collapse = True - return sorted(content.items()), collapse + return content, collapse class CondaDomain(Domain): @@ -609,7 +608,10 @@ def generate_readme(recipe_basedir, output_dir, folder, repodata, renderer): 'packages': packages, } - recipe_additional_platforms[recipe.name] = ', '.join(recipe_extra.get('additional-platforms', [])) + if recipe_extra is None: + recipe_additional_platforms[recipe.name] = '' + else: + recipe_additional_platforms[recipe.name] = ', '.join(recipe_extra.get('additional-platforms', [])) renderer.render_to_file(output_file, 'readme.rst_t', template_options) return [output_file] diff --git a/source/templates/domainindex.html b/source/templates/domainindex.html new file mode 100644 index 0000000..4b059a1 --- /dev/null +++ b/source/templates/domainindex.html @@ -0,0 +1,102 @@ +{# Template for domain indices (module index, ...). #} +{%- extends "layout.html" %} +{% set title = indextitle %} +{% block extrahead %} +{{ super() }} +{% if not embedded and collapse_index %} + +{% endif %} + + + + + + +{% endblock %} +{% block body %} + + {%- set groupid = idgen() %} + +

{{ indextitle }}

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
CountRatio
Total recipes:
linux-aarch64 recipes:%
osx-arm64 recipes:%
+ +
+ + + +{% endblock %} From eda8dece85ef0887ba490643c8904b13d69278c7 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Thu, 28 Nov 2024 13:47:26 +0200 Subject: [PATCH 3/9] Simplify the handling of the recipes' extra details There is no need to keep them in data['objects'] Signed-off-by: Martin Tzvetanov Grigorov --- source/_ext/bioconda_sphinx_ext.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/source/_ext/bioconda_sphinx_ext.py b/source/_ext/bioconda_sphinx_ext.py index 05b51f5..6da9030 100644 --- a/source/_ext/bioconda_sphinx_ext.py +++ b/source/_ext/bioconda_sphinx_ext.py @@ -60,7 +60,8 @@ import logging logger = logging.getLogger(__name__) # pylint: disable=invalid-name -recipe_additional_platforms = {}; +# A structure that holds extra information about recipes +recipes_details = {} def as_extlink_filter(text): """Jinja2 filter converting identifier (list) to extlink format @@ -332,7 +333,7 @@ def add_target_and_index(self, name: str, sig: str, "Duplicate entry {} {} at {} (other in {})".format( self.objtype, name, self.lineno, self.env.doc2path(objects[key][0]))) - objects[key] = (self.env.docname, target_name, recipe_additional_platforms[name]) + objects[key] = (self.env.docname, target_name) index_text = self.get_index_text(name) if index_text: @@ -397,10 +398,11 @@ def generate(self, docnames: Optional[List[str]] = None): content = [] objects = sorted(self.domain.data['objects'].items()) - for (typ, name), (docname, labelid, description) in objects: + for (typ, name), (docname, labelid) in objects: if docnames and docname not in docnames: continue + description = recipes_details[name] # TODO: Add meaningful info for extra/qualifier/description # fields, e.g., latest package version. content.append({ @@ -443,7 +445,7 @@ def clear_doc(self, docname: str): if 'objects' not in self.data: return to_remove = [ - key for (key, (stored_docname, _, _)) in self.data['objects'].items() + key for (key, (stored_docname, _)) in self.data['objects'].items() if docname == stored_docname ] for key in to_remove: @@ -497,7 +499,7 @@ def get_objects(self): - 2: object is unimportant (placed after full-text matches) - -1: object should not show up in search at all """ - for (typ, name), (docname, ref, _) in self.data['objects'].items(): + for (typ, name), (docname, ref) in self.data['objects'].items(): dispname = "{} '{}'".format(typ, name) yield name, dispname, typ, docname, ref, 1 @@ -505,9 +507,9 @@ def merge_domaindata(self, docnames: List[str], otherdata: Dict) -> None: """Merge in data regarding *docnames* from a different domaindata inventory (coming from a subprocess in parallel builds). """ - for (typ, name), (docname, ref, description) in otherdata['objects'].items(): + for (typ, name), (docname, ref) in otherdata['objects'].items(): if docname in docnames: - self.data['objects'][typ, name] = (docname, ref, description) + self.data['objects'][typ, name] = (docname, ref) # broken? #for key, data in otherdata['backrefs'].items(): # if docname in docnames: @@ -609,9 +611,9 @@ def generate_readme(recipe_basedir, output_dir, folder, repodata, renderer): } if recipe_extra is None: - recipe_additional_platforms[recipe.name] = '' + recipes_details[recipe.name] = '' else: - recipe_additional_platforms[recipe.name] = ', '.join(recipe_extra.get('additional-platforms', [])) + recipes_details[recipe.name] = ', '.join(recipe_extra.get('additional-platforms', [])) renderer.render_to_file(output_file, 'readme.rst_t', template_options) return [output_file] From 2b921e5b39c350400d9ed5b0f9aae92773e4b832 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Thu, 28 Nov 2024 14:41:57 +0200 Subject: [PATCH 4/9] Add recipe latest version to the table Signed-off-by: Martin Tzvetanov Grigorov --- source/_ext/bioconda_sphinx_ext.py | 18 ++++++++++++++---- source/templates/domainindex.html | 12 ++++++++---- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/source/_ext/bioconda_sphinx_ext.py b/source/_ext/bioconda_sphinx_ext.py index 6da9030..730cfa2 100644 --- a/source/_ext/bioconda_sphinx_ext.py +++ b/source/_ext/bioconda_sphinx_ext.py @@ -402,12 +402,14 @@ def generate(self, docnames: Optional[List[str]] = None): if docnames and docname not in docnames: continue - description = recipes_details[name] + recipe_details = recipes_details.get(name, {}) + # TODO: Add meaningful info for extra/qualifier/description # fields, e.g., latest package version. content.append({ "name": name, - "archs": description + "additional-platforms": ', '.join(recipe_details.get('additional-platforms', [])), + "latest-version": recipe_details.get('latest-version') }) collapse = True @@ -574,6 +576,8 @@ def generate_readme(recipe_basedir, output_dir, folder, repodata, renderer): logger.error("Unable to process %s: %s", meta_fname, e) return [] + recipe_details = recipes_details.get(recipe.name, {}) + # Format the README packages = [] for package in sorted(list(set(recipe.package_names))): @@ -592,6 +596,10 @@ def generate_readme(recipe_basedir, output_dir, folder, repodata, renderer): build_number=sorted_versions[0][1], )[0] ] + + if recipe.name == package: + recipe_details['latest-version'] = sorted_versions[0][0] + # recipe_details['build_number'] = sorted_versions[0][1] else: depends = [] @@ -611,9 +619,11 @@ def generate_readme(recipe_basedir, output_dir, folder, repodata, renderer): } if recipe_extra is None: - recipes_details[recipe.name] = '' + recipe_details['additional-platforms'] = [] else: - recipes_details[recipe.name] = ', '.join(recipe_extra.get('additional-platforms', [])) + recipe_details['additional-platforms'] = recipe_extra.get('additional-platforms', []) + + recipes_details[recipe.name] = recipe_details renderer.render_to_file(output_file, 'readme.rst_t', template_options) return [output_file] diff --git a/source/templates/domainindex.html b/source/templates/domainindex.html index 4b059a1..0e26804 100644 --- a/source/templates/domainindex.html +++ b/source/templates/domainindex.html @@ -54,7 +54,7 @@

{{ indextitle }}

let dataset = [ {%- for (entry) in content %} - ["{{ entry.name }}", "{{ entry.archs }}"]{%- if not loop.last -%}{{ "," }}{%- endif -%} + ["{{ entry.name }}", "{{ entry['latest-version'] }}", "{{ entry['additional-platforms'] }}"]{%- if not loop.last -%}{{ "," }}{%- endif -%} {%- endfor %} ]; @@ -62,10 +62,10 @@

{{ indextitle }}

let arm64Count = 0; for (let i=0; i{{ indextitle }} data: dataset, columns: [ { title: "Name" }, - { + { + title: "Latest version", + orderable: false + }, + { title: "Additional platforms", orderable: false }, From 93f5e59b2f9a27bbee4d6e5ce1b53f7b890144bb Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Thu, 28 Nov 2024 15:28:37 +0200 Subject: [PATCH 5/9] Render the recipe name as a link to its README.html page Signed-off-by: Martin Tzvetanov Grigorov --- source/templates/domainindex.html | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/source/templates/domainindex.html b/source/templates/domainindex.html index 0e26804..56431ca 100644 --- a/source/templates/domainindex.html +++ b/source/templates/domainindex.html @@ -24,25 +24,25 @@

{{ indextitle }}

- + - - + + - - + + - - + + @@ -94,6 +94,15 @@

{{ indextitle }}

[10, 25, 50, -1], [10, 25, 50, 'All'] ], + columnDefs: [ + { + render: (data, type, row) => { + console.log(data, type, row); + return '' + data + '' + }, + targets: 0 + }, + ], rowGroup: { enable: true, dataSrc: function(row) { From 2dca014fb4cbd4ec21377679914c879c3be50d25 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Thu, 28 Nov 2024 15:36:11 +0200 Subject: [PATCH 6/9] Show 50 recipes per page by default. Remove debug statement Signed-off-by: Martin Tzvetanov Grigorov --- source/templates/domainindex.html | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/source/templates/domainindex.html b/source/templates/domainindex.html index 56431ca..83146c2 100644 --- a/source/templates/domainindex.html +++ b/source/templates/domainindex.html @@ -89,25 +89,22 @@

{{ indextitle }}

orderable: false }, ], - displayLength: 25, + displayLength: 50, lengthMenu: [ - [10, 25, 50, -1], - [10, 25, 50, 'All'] + [10, 50, 100, -1], + [10, 50, 100, 'All'] ], columnDefs: [ { render: (data, type, row) => { - console.log(data, type, row); - return '' + data + '' - }, + return '' + data + ''; + }, targets: 0 }, ], rowGroup: { enable: true, - dataSrc: function(row) { - return row[0].charAt(0).toLowerCase(); - } + dataSrc: (row) => row[0].charAt(0).toLowerCase() } }); From 15ece24bf2cc256461fbc8f4d9e8d8968bb9163e Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Fri, 29 Nov 2024 09:43:54 +0200 Subject: [PATCH 7/9] Add a check for non-empty id before trying to find it in the document Signed-off-by: Martin Tzvetanov Grigorov --- source/templates/layout.html | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/source/templates/layout.html b/source/templates/layout.html index b9b181b..7352d00 100644 --- a/source/templates/layout.html +++ b/source/templates/layout.html @@ -34,11 +34,13 @@ let closest; // Get the last part of the URL after the # symbol - should match the div id to display let id = window.location.hash.substring(1); - let elem = document.getElementById(id); - if (elem != null) { - // Get the closest "details" element and open it - closest = elem.closest("details"); - if (closest) closest.open = true; + if (id) { + let elem = document.getElementById(id); + if (elem != null) { + // Get the closest "details" element and open it + closest = elem.closest("details"); + if (closest) closest.open = true; + } } From f854a6fd045d439cec3b1f7f9ad90d7f8d65c89b Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Fri, 29 Nov 2024 09:44:37 +0200 Subject: [PATCH 8/9] Add info about noarch recipes to the package index page Signed-off-by: Martin Tzvetanov Grigorov --- source/_ext/bioconda_sphinx_ext.py | 17 ++++++++++++++--- source/templates/domainindex.html | 13 ++++++++++++- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/source/_ext/bioconda_sphinx_ext.py b/source/_ext/bioconda_sphinx_ext.py index 730cfa2..c61b126 100644 --- a/source/_ext/bioconda_sphinx_ext.py +++ b/source/_ext/bioconda_sphinx_ext.py @@ -404,12 +404,21 @@ def generate(self, docnames: Optional[List[str]] = None): recipe_details = recipes_details.get(name, {}) + platforms = [] + noarch = recipe_details.get('noarch') + if noarch: + platforms.append("noarch (%s)" % noarch) + + additional_platforms = recipe_details.get('additional-platforms', []) + if len(additional_platforms) > 0: + platforms.extend(additional_platforms) + # TODO: Add meaningful info for extra/qualifier/description # fields, e.g., latest package version. content.append({ "name": name, - "additional-platforms": ', '.join(recipe_details.get('additional-platforms', [])), - "latest-version": recipe_details.get('latest-version') + "additional_platforms": ', '.join(platforms), + "latest_version": recipe_details.get('latest_version') }) collapse = True @@ -577,6 +586,8 @@ def generate_readme(recipe_basedir, output_dir, folder, repodata, renderer): return [] recipe_details = recipes_details.get(recipe.name, {}) + + recipe_details['noarch'] = recipe.meta["build"].get("noarch", '') # Format the README packages = [] @@ -598,7 +609,7 @@ def generate_readme(recipe_basedir, output_dir, folder, repodata, renderer): ] if recipe.name == package: - recipe_details['latest-version'] = sorted_versions[0][0] + recipe_details['latest_version'] = sorted_versions[0][0] # recipe_details['build_number'] = sorted_versions[0][1] else: depends = [] diff --git a/source/templates/domainindex.html b/source/templates/domainindex.html index 83146c2..4062a46 100644 --- a/source/templates/domainindex.html +++ b/source/templates/domainindex.html @@ -35,6 +35,11 @@

{{ indextitle }}

+ + + + + @@ -54,12 +59,13 @@

{{ indextitle }}

let dataset = [ {%- for (entry) in content %} - ["{{ entry.name }}", "{{ entry['latest-version'] }}", "{{ entry['additional-platforms'] }}"]{%- if not loop.last -%}{{ "," }}{%- endif -%} + ["{{ entry.name }}", "{{ entry.latest_version }}", "{{ entry.additional_platforms }}"]{%- if not loop.last -%}{{ "," }}{%- endif -%} {%- endfor %} ]; let aarch64Count = 0; let arm64Count = 0; + let noarchCount = 0; for (let i=0; i{{ indextitle }} if (entry[2].includes("osx-arm64")) { arm64Count += 1; } + if (entry[2].includes("noarch")) { + noarchCount += 1; + } } let totalCount = dataset.length; + document.getElementById("noarch-count").textContent = noarchCount; + document.getElementById("noarch-ratio").textContent = (noarchCount / totalCount * 100).toFixed(2); document.getElementById("linux-aarch64-count").textContent = aarch64Count; document.getElementById("linux-aarch64-ratio").textContent = (aarch64Count / totalCount * 100).toFixed(2); document.getElementById("osx-arm64-count").textContent = arm64Count; From 4ecbd31e44c1eaecdc54f90353de5d979a5a3412 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Fri, 29 Nov 2024 10:39:59 +0200 Subject: [PATCH 9/9] List all available platform builds for the latest version of a recipe Signed-off-by: Martin Tzvetanov Grigorov --- source/_ext/bioconda_sphinx_ext.py | 30 ++++++++++++--------- source/templates/domainindex.html | 42 +++++++++++++++++++++++------- 2 files changed, 49 insertions(+), 23 deletions(-) diff --git a/source/_ext/bioconda_sphinx_ext.py b/source/_ext/bioconda_sphinx_ext.py index c61b126..bd267a5 100644 --- a/source/_ext/bioconda_sphinx_ext.py +++ b/source/_ext/bioconda_sphinx_ext.py @@ -404,20 +404,11 @@ def generate(self, docnames: Optional[List[str]] = None): recipe_details = recipes_details.get(name, {}) - platforms = [] - noarch = recipe_details.get('noarch') - if noarch: - platforms.append("noarch (%s)" % noarch) - - additional_platforms = recipe_details.get('additional-platforms', []) - if len(additional_platforms) > 0: - platforms.extend(additional_platforms) - # TODO: Add meaningful info for extra/qualifier/description # fields, e.g., latest package version. content.append({ "name": name, - "additional_platforms": ', '.join(platforms), + "platforms": ', '.join(recipe_details.get('platforms', [])), "latest_version": recipe_details.get('latest_version') }) @@ -586,8 +577,6 @@ def generate_readme(recipe_basedir, output_dir, folder, repodata, renderer): return [] recipe_details = recipes_details.get(recipe.name, {}) - - recipe_details['noarch'] = recipe.meta["build"].get("noarch", '') # Format the README packages = [] @@ -609,7 +598,22 @@ def generate_readme(recipe_basedir, output_dir, folder, repodata, renderer): ] if recipe.name == package: - recipe_details['latest_version'] = sorted_versions[0][0] + latest_version = sorted_versions[0][0] + platforms = set(repodata.get_package_data('platform', channels='bioconda', name=package, version=latest_version)) + if "noarch" in platforms: + platforms = ["noarch"] # no need to list linux or osx + else: + def mapper(platform): + if "linux" == platform: + return "linux-64" + elif "osx" == platform: + return "osx-64" + else: + return platform + platforms = map(mapper, platforms) + recipe_details['platforms'] = list(platforms) + + recipe_details['latest_version'] = latest_version # recipe_details['build_number'] = sorted_versions[0][1] else: depends = [] diff --git a/source/templates/domainindex.html b/source/templates/domainindex.html index 4062a46..39054ce 100644 --- a/source/templates/domainindex.html +++ b/source/templates/domainindex.html @@ -40,11 +40,21 @@

{{ indextitle }}

+ + + + + + + + + + @@ -59,20 +69,28 @@

{{ indextitle }}

let dataset = [ {%- for (entry) in content %} - ["{{ entry.name }}", "{{ entry.latest_version }}", "{{ entry.additional_platforms }}"]{%- if not loop.last -%}{{ "," }}{%- endif -%} + ["{{ entry.name }}", "{{ entry.latest_version }}", "{{ entry.platforms }}"]{%- if not loop.last -%}{{ "," }}{%- endif -%} {%- endfor %} ]; - let aarch64Count = 0; - let arm64Count = 0; + let linux64Count = 0; + let linuxAarch64Count = 0; + let osx64Count = 0; + let osxArm64Count = 0; let noarchCount = 0; for (let i=0; i{{ indextitle }} let totalCount = dataset.length; document.getElementById("noarch-count").textContent = noarchCount; document.getElementById("noarch-ratio").textContent = (noarchCount / totalCount * 100).toFixed(2); - document.getElementById("linux-aarch64-count").textContent = aarch64Count; - document.getElementById("linux-aarch64-ratio").textContent = (aarch64Count / totalCount * 100).toFixed(2); - document.getElementById("osx-arm64-count").textContent = arm64Count; - document.getElementById("osx-arm64-ratio").textContent = (arm64Count / totalCount * 100).toFixed(2); + document.getElementById("linux-64-count").textContent = linux64Count; + document.getElementById("linux-64-ratio").textContent = (linux64Count / totalCount * 100).toFixed(2); + document.getElementById("linux-aarch64-count").textContent = linuxAarch64Count; + document.getElementById("linux-aarch64-ratio").textContent = (linuxAarch64Count / totalCount * 100).toFixed(2); + document.getElementById("osx-64-count").textContent = osx64Count; + document.getElementById("osx-64-ratio").textContent = (osx64Count / totalCount * 100).toFixed(2); + document.getElementById("osx-arm64-count").textContent = osxArm64Count; + document.getElementById("osx-arm64-ratio").textContent = (osxArm64Count / totalCount * 100).toFixed(2); document.getElementById("total-count").textContent = totalCount; let table = new DataTable('#recipes-table', { @@ -96,7 +118,7 @@

{{ indextitle }}

orderable: false }, { - title: "Additional platforms", + title: "Platforms", orderable: false }, ],
Recipes Count Ratio
Total recipes:Total
linux-aarch64 recipes:linux-aarch64 %
osx-arm64 recipes:osx-arm64: %
noarch%
linux-aarch64 %
linux-64%
linux-aarch64 %
osx-64:%
osx-arm64: