From 4854af5f3822356216a549dda801b5a4d20b91f9 Mon Sep 17 00:00:00 2001 From: Adam Ruzicka Date: Mon, 4 May 2026 15:42:04 +0200 Subject: [PATCH 1/3] wip: TOC checking CI --- .github/workflows/linkchecker.yml | 50 +++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/.github/workflows/linkchecker.yml b/.github/workflows/linkchecker.yml index bcdc2bcb465..97916ed02bd 100644 --- a/.github/workflows/linkchecker.yml +++ b/.github/workflows/linkchecker.yml @@ -47,3 +47,53 @@ jobs: - name: Check HTML links of all builds run: | make linkchecker-tryer + + theme-link-check: + runs-on: ubuntu-24.04 + defaults: + run: + shell: bash + working-directory: guides + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ env.RUBY_VERSION }} + bundler-cache: true + + - name: Build satellite docs + run: | + bundle exec make -j ${{ env.MAKE_J }} html BUILD=satellite LINKS=local + + - name: Extract TOC + run: | + mkdir -p build/ci-toc + bundle exec ruby scripts/extract_links_toc \ + --f2l upstream_filename_to_satellite_link.json \ + --output-toc-file build/ci-toc/toc.json \ + --output-aliases-file build/ci-toc/aliases.json \ + build/**/index-satellite.html + + - name: Stage documentation TOC for CI artifact + run: | + mkdir -p "${GITHUB_WORKSPACE}/toc-artifact" + cp build/ci-toc/toc.json build/ci-toc/aliases.json "${GITHUB_WORKSPACE}/toc-artifact/" + + - name: Upload documentation TOC + uses: actions/upload-artifact@v7 + with: + name: documentation-toc + path: toc-artifact + if-no-files-found: error + + foreman-theme-satellite-plugin: + needs: theme-link-check + # TODO + # uses: theforeman/foreman_theme_satellite/.github/workflows/toc-check.yml@develop + uses: adamruzicka/foreman_theme_satellite/.github/workflows/toc-check.yml@ci + secrets: inherit + with: + documentation_toc_artifact: documentation-toc From 9b44a1e6dc183150293b37262dde598a7aafea18 Mon Sep 17 00:00:00 2001 From: Adam Ruzicka Date: Wed, 6 May 2026 09:07:24 +0200 Subject: [PATCH 2/3] wip: include one more level in toc --- guides/scripts/extract_links_toc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guides/scripts/extract_links_toc b/guides/scripts/extract_links_toc index 4af66f5d4bf..3d3f2f85f91 100755 --- a/guides/scripts/extract_links_toc +++ b/guides/scripts/extract_links_toc @@ -48,7 +48,7 @@ files.each do |file| document = Nokogiri::HTML.parse(File.open(file)) file_toc = document.css('h2').to_h do |chapter| - subchapters = (chapter.parent.css('h3') + chapter.parent.css('div[id]')) + subchapters = (chapter.parent.css('h3') + chapter.parent.css('div[id]') + chapter.parent.css('h4')) ([chapter] + subchapters).each do |element| element_auxiliary_ids(element).each do |aux_id| id = element['id'] From cf3e753718a1eb131e499e8d25827d6365650086 Mon Sep 17 00:00:00 2001 From: Adam Ruzicka Date: Wed, 6 May 2026 10:12:26 +0200 Subject: [PATCH 3/3] wip: Check with redhatsatellite/foreman_theme_satellite#325 --- .github/workflows/linkchecker.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/linkchecker.yml b/.github/workflows/linkchecker.yml index 97916ed02bd..1fd8b1fffc5 100644 --- a/.github/workflows/linkchecker.yml +++ b/.github/workflows/linkchecker.yml @@ -97,3 +97,5 @@ jobs: secrets: inherit with: documentation_toc_artifact: documentation-toc + plugin_repository: adamruzicka/foreman_theme_satellite + plugin_version: registration-docs