Tension between wanting to use `{.run }` over `style_hyperlink()` but not wanting backticks in fallback mode
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Review the existing style_hyperlink() and {.run } fallback behavior, using the snapshots that show the added backticks as the starting point. Compare plain-text messages, visible code links, and nested {.path } cases. Done means the project has a decided fallback behavior that avoids inappropriate formatting without breaking code-oriented links.
Written by the indexing model from the issue text.
Description
In https://github.com/r-lib/pkgdown/commit/52d696dfec4ab529f24f3243a00709256f341707 we went from style_hyperlink() to the more ergonomic {.run } syntax.
Notice how in this case the text we show the user is not code, it is just some text that happens to run code behind the scenes. In fallback mode when we don't have hyperlink support, with style_hyperlink() this just showed the text as is, which worked quite well. Now with {.run } it gets styled as {.code } in fallback mode, which in practice adds backticks around the text (as seen in the snapshots) which is pretty odd.
i.e. we went from
Writing articles/index.html
to
Writing `articles/index.html`
That was also an issue here https://github.com/r-lib/roxygen2/pull/1604 where I wanted to switch to {.run }, but the thing we show the user is actually a path so naturally we wrap it in {.path } too, i.e. it would end up like a nested {.path {.run [foo.R](code)}} call. In fallback mode this gets super weird, we get single quotes from the .path plus backticks from the .run, so something like '`foo.R`'
Ideally in this scenario the fallback for {.run } would not have used {.code } and would just show the text as is. However, I get that we often do show the user visible code, and that's what they click on, so the code fallback makes sense in that case (like the rlang::last_trace() hyperlink in error messages). Maybe we need a slightly different .run variant or something?
- Dominant language
- R
- Stars
- 726
- Forks
- 94
- Avg merge
- 3h 35m
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from r-lib/cli
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
-
feature
Difficulty 3/5 1-2 days Newbie friendliness 68/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
r-lib/pkgdepends#485 · 3 comments ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
beginners blocker
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enviPathR OpenBuild Error Build OK Build Warning policies-accepted pre-review precheck-passed
Difficulty 1/5 Under an hour Newbie friendliness 84/100
Bioconductor/BiocContributions#207 · 6 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
datacarpentry/semester-biology#1255 ·