Skip to content

Commit

Permalink
ix(pkgdown): Update R6 autolinking for active bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
RasmusSkytte committed Oct 29, 2024
1 parent 1e5430c commit 59ec1b8
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,26 @@ jobs:
# regex: <a href="\.\.\/([\/\w]+.html)">\?(\w+)<\/a>
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$get_feature()</code>
# We need to manually create the link to the function
# regex: <code>\?(\w+)\$(\w+)\(\)<\/code>
# Target: <a href="../reference/DiseasystoreBase.html#method-DiseasystoreBase-get_feature"><code>$get_feature()</code></a>
find docs -name *.html -exec sed -ri 's/<code>\?(\w+)\$(\w+)\(\)<\/code>/<code><a href="..\/reference\/\1.html#method-\1-\2">\$\2\(\)<\/a><\/code>/g' {} +
# Fixing "?R6class$active_binding"
# 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>
# Target: <a href="../reference/DiseasystoreBase.html#method-DiseasystoreBase-get_feature"><code>get_feature()</code></a>
find docs -name *.html -exec sed -ri 's/<code>\?(\w+)\$(\w+(:?\(\))?)<\/code>/<code><a href="..\/reference\/\1.html#method-\1-\2">\$\2<\/a><\/code>/g' {} +
# regex: <code>\?(\w+)\$(\w+)<\/code>
# Target: <a href="../reference/DiseasystoreBase.html#active-bindings"><code>$available_observables</code></a>
find docs -name *.html -exec sed -ri 's/<code>\?(\w+)\$(\w+)<\/code>/<code><a href="..\/reference\/\1.html#active-bindings">\$\2<\/a><\/code>/g' {} +
- name: Upload artifact
uses: actions/upload-artifact@v4
Expand Down

0 comments on commit 59ec1b8

Please sign in to comment.