Skip to content

Commit

Permalink
feat(pkgdown): Fix references (S3 class w. spaces)
Browse files Browse the repository at this point in the history
  • Loading branch information
RasmusSkytte committed Feb 13, 2024
1 parent c65d2a7 commit 54c4fd0
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,19 @@ 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/<code><a href="\(\w\+\)\.html">\1<\/a><\/code>/<code><a href="\1.html">\1()<\/a><\/code>/g' docs/reference/index.html
# We also remove the surplus entry for the classes with spaces
sed -i 's/<code><a href="\(\w\+\)\.html">\w\+\.\w\+ [a-zA-Z_ ]\+<\/a><\/code>//g' docs/reference/index.html
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
Expand Down

0 comments on commit 54c4fd0

Please sign in to comment.