From 8c55411dcf6d5c4f78954d1389727ec985597623 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rasmus=20Skytte=20Randl=C3=B8v?= Date: Tue, 13 Feb 2024 09:23:49 +0100 Subject: [PATCH] feat(pkgdown): Fix references (S3 class w. spaces) --- .github/workflows/pkgdown.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 99657578..afaa59a9 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -59,6 +59,18 @@ jobs: run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) shell: Rscript {0} + - name: Fix malformed formatting + run: | + # It seems pkgdown does not properly format the reference/index.html file when S3 methods for classes + # with spaces are used (such as "Microsoft SQL Server"). + + # Modify the index.html file to fix the formatting + # Using sed, we add missing parentheses to the function names + sed -i 's/\1<\/a><\/code>/\1()<\/a><\/code>/g' docs/reference/index.html + + # We also remove the surplus entry for the classes with spaces + sed -i 's/\(\w\+\.\w\+ [\w ]\+\)<\/a><\/code>//g' docs/reference/index.html + - name: Upload artifact uses: actions/upload-artifact@v4 with: