From 83b0b276beb7584a14eaa2f49262f2abf0cdd042 Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Wed, 10 Dec 2025 12:19:20 -0800 Subject: [PATCH 1/3] add product neutral guides --- toys/release/build-rad.rb | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/toys/release/build-rad.rb b/toys/release/build-rad.rb index 7d37d07..bf93c32 100644 --- a/toys/release/build-rad.rb +++ b/toys/release/build-rad.rb @@ -14,6 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +require "yaml" + desc "Build cloud-rad yardoc" flag :bundle @@ -38,6 +40,10 @@ def run gem "yard", "~> 0.9", ">= 0.9.26" gem "redcarpet", "~> 3.5", ">= 3.5.1" end + + if gem_name == "help" + return build_help + end yardopts_content = File.read yardopts cmd = ["yard", "doc", "--no-yardopts"] + build_options(yardopts_content) cmd = ["bundle", "exec"] + cmd if bundle @@ -73,8 +79,38 @@ def build_options yardopts_content final_options end +def build_help + mkdir "doc" + custom_names = { + "index.md" => "Getting started", + "occ_for_iam.md" => "OCC for IAM" + } + guides = { + "./../README.md" => "index.md" + } + Dir.glob("*.md").each do |file| + guides[file] = File.basename(file).downcase + end + toc_items = [] + guides.each do |path, filename| + cp path, "doc/" + filename + toc_items << { + "name" => custom_names[filename] || File.basename(filename, ".*").tr("_-", " ").capitalize, + "href" => filename + } + end + toc_data = [ + { + "uid" => "product-neutral-guides", + "name" => "Client library help", + "items" => toc_items + } + ] + File.write "doc/toc.yaml", YAML.dump(toc_data) + sanity_check +end + def sanity_check - require "yaml" Dir.glob "doc/*.yml" do |path| YAML.load_file path end From 6e843f508ee88ff5fb473fceb60c95ca57e12815 Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Wed, 10 Dec 2025 13:07:21 -0800 Subject: [PATCH 2/3] skip publish_gem for client library help --- toys/release/perform.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toys/release/perform.rb b/toys/release/perform.rb index bbe629d..347b858 100644 --- a/toys/release/perform.rb +++ b/toys/release/perform.rb @@ -361,7 +361,7 @@ def run force_republish: false, end transformation_info = transform_links begin - publish_gem dry_run: dry_run + publish_gem dry_run: dry_run unless @gem_name == "help" publish_docs dry_run: dry_run if enable_docs publish_rad dry_run: dry_run if enable_rad ensure From 87f2607b7606f44482db007b56722eea28a7d20b Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Wed, 10 Dec 2025 13:17:18 -0800 Subject: [PATCH 3/3] fix cs --- toys/release/build-rad.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toys/release/build-rad.rb b/toys/release/build-rad.rb index bf93c32..a45df7c 100644 --- a/toys/release/build-rad.rb +++ b/toys/release/build-rad.rb @@ -93,7 +93,7 @@ def build_help end toc_items = [] guides.each do |path, filename| - cp path, "doc/" + filename + cp path, "doc/#{filename}" toc_items << { "name" => custom_names[filename] || File.basename(filename, ".*").tr("_-", " ").capitalize, "href" => filename