From 0064d4b2c59885f0b0a324384e5a61d8af211c2f Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 1 Feb 2022 15:01:58 +0200 Subject: [PATCH] Docs: remove deprecated links to "boards" page --- docs | 2 +- scripts/docspregen.py | 60 +++++++++++++++++++------------------------ 2 files changed, 28 insertions(+), 34 deletions(-) diff --git a/docs b/docs index 920ac922..f4169a1c 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 920ac922028b140ebe9a91b1c8e07c7d838c5069 +Subproject commit f4169a1cebcf94694e96b2b9085118ada7fd21ec diff --git a/scripts/docspregen.py b/scripts/docspregen.py index 0e945d18..113bfa93 100644 --- a/scripts/docspregen.py +++ b/scripts/docspregen.py @@ -42,12 +42,12 @@ RST_COPYRIGHT = """.. Copyright (c) 2014-present PlatformIO `_ + * You can list pre-configured boards by :ref:`cmd_boards` command * For more detailed ``board`` information please scroll the tables below by horizontally. """ @@ -500,21 +499,20 @@ Boards def update_platform_docs(): - for manifest in PLATFORM_MANIFESTS: - name = manifest["name"] - platforms_dir = join(DOCS_ROOT_DIR, "platforms") - rst_path = join(platforms_dir, "%s.rst" % name) + platforms_dir = join(DOCS_ROOT_DIR, "platforms") + for pkg in PlatformPackageManager().get_installed(): + rst_path = join(platforms_dir, "%s.rst" % pkg.metadata.name) with open(rst_path, "w") as f: - f.write(generate_platform(name, platforms_dir)) + f.write(generate_platform(pkg.metadata.name, platforms_dir)) -def generate_framework(type_, data, rst_dir=None): +def generate_framework(type_, framework, rst_dir=None): print("Processing framework: %s" % type_) compatible_platforms = [ - m - for m in PLATFORM_MANIFESTS - if is_compat_platform_and_framework(m["name"], type_) + pkg + for pkg in PlatformPackageManager().get_installed() + if is_compat_platform_and_framework(pkg.metadata.name, type_) ] compatible_boards = [board for board in BOARDS if type_ in board["frameworks"]] @@ -524,19 +522,19 @@ def generate_framework(type_, data, rst_dir=None): lines.append(".. _framework_%s:" % type_) lines.append("") - lines.append(data["title"]) - lines.append("=" * len(data["title"])) + lines.append(framework["title"]) + lines.append("=" * len(framework["title"])) lines.append("") lines.append(":Configuration:") lines.append(" :ref:`projectconf_env_framework` = ``%s``" % type_) lines.append("") - lines.append(data["description"]) - if data["url"]: + lines.append(framework["description"]) + if framework["url"]: lines.append( """ For more detailed information please visit `vendor site <%s>`_. """ - % campaign_url(data["url"]) + % campaign_url(framework["url"]) ) lines.append( @@ -571,13 +569,13 @@ Examples -------- """ ) - for manifest in compatible_platforms: - p = PlatformFactory.new(manifest["name"]) + for pkg in compatible_platforms: + p = PlatformFactory.new(pkg) lines.append( "* `%s for %s <%s>`_" % ( - data["title"], - manifest["title"], + framework["title"], + p.title, campaign_url("%s/tree/master/examples" % p.repository_url[:-4]), ) ) @@ -585,7 +583,7 @@ Examples # Platforms lines.extend( generate_platforms_contents( - [manifest["name"] for manifest in compatible_platforms] + [pkg.metadata.name for pkg in compatible_platforms] ) ) @@ -604,8 +602,7 @@ Boards ------ .. note:: - * You can list pre-configured boards by :ref:`cmd_boards` command or - `PlatformIO Boards Explorer `_ + * You can list pre-configured boards by :ref:`cmd_boards` command * For more detailed ``board`` information please scroll the tables below by horizontally. """ ) @@ -640,11 +637,10 @@ def update_boards(): """ Rapid Embedded Development, Continuous and IDE integration in a few steps with PlatformIO thanks to built-in project generator for the most -popular embedded boards and IDE. +popular embedded boards and IDEs. .. note:: - * You can list pre-configured boards by :ref:`cmd_boards` command or - `PlatformIO Boards Explorer `_ + * You can list pre-configured boards by :ref:`cmd_boards` command * For more detailed ``board`` information please scroll tables below by horizontal. """ ) @@ -677,8 +673,6 @@ popular embedded boards and IDE. # individual board page for data in BOARDS: - # if data['id'] != "m5stack-core-esp32": - # continue rst_path = join( DOCS_ROOT_DIR, "boards", data["platform"], "%s.rst" % data["id"] ) @@ -1018,8 +1012,8 @@ def update_project_examples(): embedded = [] desktop = [] - for manifest in PLATFORM_MANIFESTS: - p = PlatformFactory.new(manifest["name"]) + for pkg in PlatformPackageManager().get_installed(): + p = PlatformFactory.new(pkg) github_url = p.repository_url[:-4] # Platform README @@ -1054,7 +1048,7 @@ def update_project_examples(): framework_examples_md_lines[framework["name"]] = [] lines = [] lines.append("- [%s](%s)" % (p.title, github_url)) - lines.extend(" %s" % l for l in examples_md_lines) + lines.extend(" %s" % line for line in examples_md_lines) lines.append("") framework_examples_md_lines[framework["name"]].extend(lines)