diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2021-06-04 16:04:52 -0400 |
---|---|---|
committer | Xavier Claessens <xavier.claessens@collabora.com> | 2021-06-05 17:01:34 -0400 |
commit | 769fd5037304e03d11852b47a77bec4b70d8fd8a (patch) | |
tree | 4d9e673f22641b651282d7a6a1fa2b1750170ffb | |
parent | 62c53b834dbee366104dc8a32927f1b7da028922 (diff) | |
download | meson-769fd5037304e03d11852b47a77bec4b70d8fd8a.zip meson-769fd5037304e03d11852b47a77bec4b70d8fd8a.tar.gz meson-769fd5037304e03d11852b47a77bec4b70d8fd8a.tar.bz2 |
docs: Generate a table of all wrapdb releases
wrapdb CI will trigger Meson's CI to regenerate the list when
releases.json is updated.
-rw-r--r-- | docs/markdown/Wrapdb-projects.md | 16 | ||||
-rw-r--r-- | docs/sitemap.txt | 1 | ||||
-rwxr-xr-x | tools/regenerate_docs.py | 19 |
3 files changed, 36 insertions, 0 deletions
diff --git a/docs/markdown/Wrapdb-projects.md b/docs/markdown/Wrapdb-projects.md new file mode 100644 index 0000000..64f3cb6 --- /dev/null +++ b/docs/markdown/Wrapdb-projects.md @@ -0,0 +1,16 @@ +# Meson WrapDB packages + +This is a list of projects that have either an upstream Meson build system, or a +port maintained by the Meson team. [They can be used by your project to provide +its dependencies](Wrap-dependency-system-manual.md). + +Use the command line `meson wrap install <project>` to install the wrap file of +any of those projects into your project's `subprojects/` directory. +See [Meson command line documentation](Using-wraptool.md). + +If you wish to add your own project into this list, please submit your wrap file +in a [Pull Request](https://github.com/mesonbuild/wrapdb). +See [Meson documentation](Adding-new-projects-to-wrapdb.md) +for more details. + +{{ wrapdb-table.md }} diff --git a/docs/sitemap.txt b/docs/sitemap.txt index 938596e..d942aa4 100644 --- a/docs/sitemap.txt +++ b/docs/sitemap.txt @@ -75,6 +75,7 @@ index.md FAQ.md Reproducible-builds.md howtox.md + Wrapdb-projects.md Wrap-dependency-system-manual.md Adding-new-projects-to-wrapdb.md Using-the-WrapDB.md diff --git a/tools/regenerate_docs.py b/tools/regenerate_docs.py index 2765836..f5ce77b 100755 --- a/tools/regenerate_docs.py +++ b/tools/regenerate_docs.py @@ -25,8 +25,10 @@ import re import subprocess import sys import textwrap +import json import typing as T from pathlib import Path +from urllib.request import urlopen PathLike = T.Union[Path,str] @@ -115,6 +117,22 @@ def generate_hotdoc_includes(root_dir: Path, output_dir: Path) -> None: with open(output_dir / (cmd+'_'+typ+'.inc'), 'w') as f: f.write(parsed[typ]) +def generate_wrapdb_table(output_dir: Path) -> None: + url = urlopen('https://wrapdb.mesonbuild.com/v2/releases.json') + releases = json.loads(url.read().decode()) + with open(output_dir / 'wrapdb-table.md', 'w') as f: + f.write('| Project | Versions | Provided dependencies | Provided programs |\n') + f.write('| ------- | -------- | --------------------- | ----------------- |\n') + for name, info in releases.items(): + versions = [f'[{v}](https://wrapdb.mesonbuild.com/v2/{name}_{v}/{name}.wrap)' for v in info['versions']] + # Highlight latest version. + versions_str = f'<big>**{versions[0]}**</big><br/>' + ', '.join(versions[1:]) + dependency_names = info.get('dependency_names', []) + dependency_names_str = ', '.join(dependency_names) + program_names = info.get('program_names', []) + program_names_str = ', '.join(program_names) + f.write(f'| {name} | {versions_str} | {dependency_names_str} | {program_names_str} |\n') + def regenerate_docs(output_dir: PathLike, dummy_output_file: T.Optional[PathLike]) -> None: if not output_dir: @@ -126,6 +144,7 @@ def regenerate_docs(output_dir: PathLike, root_dir = Path(__file__).resolve().parent.parent generate_hotdoc_includes(root_dir, output_dir) + generate_wrapdb_table(output_dir) if dummy_output_file: with open(output_dir/dummy_output_file, 'w') as f: |