Skip to content

Commit

Permalink
Merge branch 'main' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
boegel committed Sep 12, 2024
2 parents 86db487 + 4655ea2 commit f399e29
Show file tree
Hide file tree
Showing 3,588 changed files with 84,488 additions and 44,914 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
ignore_words_list: atleast,ninjs,simpy,proovread,namd,precice,crate,ake
# filter out
# docs/js/asciinema-player-2.6.1.js as it is not markdown
# version-specific/supported-software.md as the software descriptions have spelling errors
skip: './docs/js/asciinema-player-2.6.1.js,./docs/version-specific/supported-software.md,./docs/release-notes.md'
# version-specific/supported-software/* as the software descriptions have spelling errors
skip: './docs/js/asciinema-player-2.6.1.js,./docs/version-specific/supported-software/*,./docs/version-specific/supported-software/*/*.md,./docs/release-notes.md'

- name: check internal links
run: python ./.github/workflows/link_check.py
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ To contribute to this documentation, [open a pull request](https://github.com/ea
- [Installing](installation.md), [configuring](configuration.md), and [using](using-easybuild.md) EasyBuild
- [Writing easyconfig files](writing-easyconfig-files.md) | [available easyconfig parameters](version-specific/easyconfig-parameters.md)
- [Generic easyblocks](version-specific/generic-easyblocks.md)
- List of [common toolchains](common-toolchains.md) and [supported software](version-specific/supported-software.md)
- List of [common toolchains](common-toolchains.md) and [supported software](version-specific/supported-software/index.md)
- [Contributing to EasyBuild](contributing.md) | [GitHub integration features](integration-with-github.md)
- [EasyBuild release notes](release-notes.md) | [EasyBuild v5.0](easybuild-v5/index.md)
- For [end users](roles/end-users) | [user support](roles/user-support) | [contributors](roles/contributors) | [developers](roles/developers) | [maintainers](roles/maintainers)
Expand Down
4 changes: 2 additions & 2 deletions docs/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ search:
# EasyBuild release notes {: #release_notes }

The latest version of EasyBuild provides support for building and
installing [**3,552** different software packages](version-specific/supported-software.md),
installing [**3,552** different software packages](version-specific/supported-software/index.md),
including 40 different (compiler) toolchains.
It contains 259 software-specific easyblocks and 43 generic easyblocks,
alongside 19,985 easyconfig files.
Expand All @@ -21,7 +21,7 @@ bugfix/update release
- various enhancements, including:
- improve behavior when using extension which has `nosource` enabled ([#4506](https://github.com/easybuilders/easybuild-framework/pull/4506))
- enhance `get_software_libdir` to return `lib` or `lib64` if only one of them contains library files ([#4513](https://github.com/easybuilders/easybuild-framework/pull/4513))
- implement versions checks to avoid mixing major versions across the EasyBuild components ([#4520](https://github.com/easybuilders/easybuild-framework/pull/4520), [#4553](https://github.com/easybuilders/easybuild-framework/pull/4553))
- implement version checks to avoid mixing major versions across the EasyBuild components ([#4520](https://github.com/easybuilders/easybuild-framework/pull/4520), [#4553](https://github.com/easybuilders/easybuild-framework/pull/4553))
- add support for easyconfig parameter `module_only` ([#4537](https://github.com/easybuilders/easybuild-framework/pull/4537))
- various bug fixes, including:
- fix typo in `patch_step` logging ([#4505](https://github.com/easybuilders/easybuild-framework/pull/4505))
Expand Down
2 changes: 1 addition & 1 deletion docs/version-specific/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* [List of available easyblocks](easyblocks.md)
* [List of available toolchain options](toolchain-opts.md)
* [List of known toolchains](toolchains.md)
* [List of supported software](supported-software.md)
* [List of supported software](supported-software/index.md)
* [Overview of EasyBuild configuration options](eb-help.md)
* [Overview of generic easyblocks](generic-easyblocks.md)
* [Templates available for easyconfig files](easyconfig-templates.md)
132 changes: 132 additions & 0 deletions docs/version-specific/software-markdown-pages.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
import argparse
import json
import shutil
import sys
from collections import defaultdict
from pathlib import Path


MKDOCS_SEARCH_PRIORITY = """---
search:
boost: 0.5
---
"""


def generate_quick_links_line(chars, level, current=None):
"""
Generate links to index page for each character
:param characters: Initial characters to generate links for
"""
up = '/'.join(['..'] * level) or '.'
links = []
if level > 0:
links.append(f"[(all)]({up}/index.md)")
for char in chars:
if char == current:
links.append(f'*{char}*')
else:
links.append(f"[{char}]({up}/{char}/index.md)")
links_txt = ' - '.join(links)
return f"*(quick links: {links_txt})*\n\n"


def output_markdown(processed, output_base_path):
"""
Output markdown pages (index and per letter directories, each with an index and page per software)
:param processed: Processed data to output (dictionary - letter -> software -> list of versions)
:param output_base_path: Pathlib object for base path of output
"""
pkg_cnt = sum(len(v) for v in processed.values())
letters = sorted(processed.keys())

with open(output_base_path / 'index.md', 'w') as top_page:
top_page.write(MKDOCS_SEARCH_PRIORITY)
top_page.write("# List of supported software\n\n")
top_page.write(generate_quick_links_line(letters, 0))
top_page.write(f"EasyBuild supports {pkg_cnt} different software packages (incl. toolchains, bundles):\n\n")

for letter in processed:
top_page.write(f" * [{letter}]({letter}/index.md)\n")

letter_dir = output_base_path / letter
letter_dir.mkdir()
with open(letter_dir / 'index.md', 'w') as letter_page:
letter_page.write(MKDOCS_SEARCH_PRIORITY)
letter_page.write(f"# List of supported software ({letter})\n\n")
letter_page.write(generate_quick_links_line(letters, 1, current=letter) + "\n\n")

for software in processed[letter]:
top_page.write(f" * [{software}]({letter}/{software}.md)\n")
letter_page.write(f" * [{software}]({software}.md)\n")

versionsuffix = any(v['versionsuffix'] for v in processed[letter][software])

with open(letter_dir / f'{software}.md', 'w') as software_page:
software_page.write(MKDOCS_SEARCH_PRIORITY)
software_page.write(f"# {software}\n\n")
software_page.write(f"{processed[letter][software][0]['description']}\n\n")
software_page.write(f"*homepage*: <{processed[letter][software][0]['homepage']}>\n\n")

if versionsuffix:
software_page.write("version | versionsuffix | toolchain\n")
software_page.write("--------|---------------|----------\n")
else:
software_page.write("version | toolchain\n")
software_page.write("--------|----------\n")

for version in processed[letter][software]:
software_page.write(f"``{version['version']}`` | ")
if versionsuffix:
if version['versionsuffix']:
software_page.write(f"``{version['versionsuffix']}``")
software_page.write(" | ")
software_page.write(f"``{version['toolchain']}``\n")

software_page.write("\n\n" + generate_quick_links_line(letters, 1))

letter_page.write("\n\n" + generate_quick_links_line(letters, 1, current=letter))

top_page.write("\n\n" + generate_quick_links_line(letters, 0))


def generate_markdown_pages(jsonfile, output_base, delete_existing):
"""
Generate markdown
:param jsonfile: input file (json file)
:param output_base: base directory for output files
:param delete_existing: delete the output directory (if it exists)
"""
if jsonfile is None:
sys.stderr.write("ERROR: No input JSON file specified, it is required!\n")
sys.exit(1)

with open(jsonfile) as f:
data = json.load(f)

processed = defaultdict(lambda: defaultdict(list))
for software in data:
initial = software['name'][0].lower()
if initial.isnumeric():
initial = '0'
processed[initial][software['name']].append(software)

output_base_path = Path(output_base)

if delete_existing and output_base_path.exists() and output_base_path.is_dir():
shutil.rmtree(output_base_path)

output_base_path.mkdir(parents=True)
output_markdown(processed, output_base_path)


if __name__ == "__main__":
parser = argparse.ArgumentParser(prog='Software Markdown Pages',
description='Generate Markdown pages of software from JSON file')
parser.add_argument('-j', '--jsonfile', default=None, help='Input JSON file')
parser.add_argument('-o', '--output-base', default='output', help='Base directory for output files')
parser.add_argument('--delete-existing-output', action='store_true',
help='Delete output base directory (if it exists)')
args = parser.parse_args()

generate_markdown_pages(args.jsonfile, args.output_base, args.delete_existing_output)
Loading

0 comments on commit f399e29

Please sign in to comment.