dev_guide icon indicating copy to clipboard operation
dev_guide copied to clipboard

Always use explicit anchors

Open eliocamp opened this issue 1 year ago • 7 comments

In reviewing the Spanish translation I've found this instance of a section without explicit anchor. An earlier section links to this one using the implicit anchor created by rmarkdown/quarto, but the link broke in the Spanish version because the name of the implicit anchor is now different.

https://github.com/ropensci/dev_guide/blob/6bee2f778e219a533a91887167c2ac13bdaed592/softwarereview_intro.Rmd#L52

Before sending a PR to address this particular case, perhaps it might be better to do a holistic revision to add explicit anchors to every section in one single PR.

eliocamp avatar Apr 21 '23 15:04 eliocamp

Even better would be a workflow file that ensured that every section and sub-section had an explicit anchor. That could be integrated as part of the general PR workflow. @maelle How about i write a script for that, let you know when that's done, and you can plug it in to the workflow?

mpadge avatar Apr 24 '23 07:04 mpadge

Oh good catch @eliocamp!

@mpadge Yep but first I'll make a bigger PR ensuring current content has such explicit references.

For my own reference: https://quarto.org/docs/authoring/cross-references.html#sections

maelle avatar May 02 '23 08:05 maelle

I've done some work on this, right now I have one (last?) blocker which is that titles à la Ajustar la fecha límite de la revisión {.unnumbered} {#tweak-review-due-date} don't work, even if I change the order of the curly braces thingies. The second one is rendered as is, not used.

maelle avatar May 09 '23 10:05 maelle

https://community.rstudio.com/t/quarto-how-to-cross-reference-unnumbered-book-chapter/136279

maelle avatar May 09 '23 10:05 maelle

this is only a problem for the bot cheatsheet. Maybe we don't need explicit cross-references for it, or maybe it wouldn't be horrible to have numbers there.

maelle avatar May 09 '23 10:05 maelle

  1. Add explicit anchors
  2. Check existing internal links
  3. PR workflow

maelle avatar May 11 '23 11:05 maelle

@mpadge note that I need to be working on a PR workflow anyway. For each PR,

  • if change in a doc in a language,
  • transform to XML and translate the same node in the other languages.

this works if all languages have the same XML structure (header, paragraphs) -- which this work on anchors helped check.

maelle avatar May 11 '23 11:05 maelle