Skip to content

Commit

Permalink
fix(pkgdown): Update R6 autolinking sed command
Browse files Browse the repository at this point in the history
  • Loading branch information
RasmusSkytte committed Oct 29, 2024
1 parent 3dda1f3 commit d429047
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,16 @@ jobs:
# <a href="../reference/FeatureHandler.html">?FeatureHandler</a>
# We remove the question mark to make the link cleaner
# regex: <a href="\.\.\/([\/\w]+.html)">\?(\w+)<\/a>
find docs -type f -exec sed -i 's/<a href="\.\.\/\([\/\w]\+\.html\)">\?\(\w\+\)<\/a>/<a href="\1">\2<\/a>/g' {} +
find docs -name *.html -exec sed -ri 's/(<a href=\"\.{2}.+\.html">)\?(.+<\/a>)/\1\2/g' {} +
# Fixing "?R6class$function()"
# pkgdown does not generate links for this type of reference, so we need to create the link fully manually
# The code has the following format when generated by pkgdown
# <code>?DiseasystoreBase$available_observables</code>
# We need to manually create the link to the function
# regex: <code>\?(\w+)\$()(\w+\(\))<\/code>
# regex: <code>\?(\w+)\$()(\w+)[\(\)]+<\/code>
# Target: <a href="../reference/DiseasystoreBase.html#method-DiseasystoreBase-get_feature"><code>get_feature()</code></a>
find docs -type f -exec sed -i 's/<code>\?\(\w\+\)\$\(\w\+\(\)\)<\/code>/<a href="\.\.\/reference\/\1.html#method-\1-\2"><code>\2<\/code><\/a>/g' {} +
find docs -name *.html -exec sed -ri 's/<code>\?(\w+)\$(\w+)<\/code>/<a href="..\/reference\/\1.html#method-\1-\2">\2<\/a><\/code>/g' {} +
- name: Upload artifact
uses: actions/upload-artifact@v4
Expand Down

0 comments on commit d429047

Please sign in to comment.