Skip to content

Fix broken link #241

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Fix broken link #241

wants to merge 2 commits into from

Conversation

adit-0132
Copy link

@adit-0132 adit-0132 commented Aug 17, 2025

Description

  • Added anchors of the form {#sec-...} to all chapter headings
  • Updated links in the introduction and elsewhere to point to the new anchors
  • Standardised link text to match the corresponding chapter titles
  • Ran Lychee on the built guide to confirm, and also manually checked the guide for broken links

This ensures consistent internal navigation, enables cross-references,
and improves maintainability of the R Dev Guide.

Broken link for #MessageTranslations
@adit-0132 adit-0132 changed the title Fix broken links Fix broken link Aug 17, 2025
@hturner
Copy link
Member

hturner commented Aug 18, 2025

Thanks for picking up this issue. What we actually want to do here is link to different chapters of the guide, so the link should go to https://contributor.r-project.org/rdevguide/chapters/message_translations.html. However, to do this properly, we need to add anchors to all the chapters.

For example, the header in the Message Translations chapter (L7) could be updated to

# Message Translations {#sec-message-translations}

and then when we want to reference it, e.g. in the introduction, we use this new anchor, e.g.

2. Contributing to translations: Refer to [Translations](#sec-message-translations).

Using the sec prefix will also allow us to use cross-references, which might be useful, though I think it is more helpful to link the chapter title rather than the chapter number, even though the link text can then get out of sync.

So this is a bigger issue than it first appears and it would be great if you could work on this as follows:

  • Add anchors to all chapter headings of the form {#sec-message-translations}
  • Check and update any links to chapters, updating both the link text (which should match the chapter title) and the link (to your new anchor). This will be somewhat manual, I would review the whole of the introduction and use search tools to find old links elsewhere (e.g. #ReviewBugs). Be careful to check the context - is the target a different chapter, or a section of the same chapter? You should create a fork of the rdevguide repo and check it out locally.
  • For a through check, install Lychee (from the Assets of the latest release), build the dev guide locally (running quarto render from the terminal at the root of the repo) and then run the built HTML through Lychee to check for broken links:
lychee --verbose '_book/**/*.html'

Hopefully you'll be able to work out how to fix any broken links discovered by Lychee, but you can ask here if you're unsure about anything.

We could add Lychee to GitHub actions to check for broken links, but we still need to fix them, so I think it's worth fixing everything first, then adding Lychee to GitHub actions to catch broken links in later changes to the guide.

@adit-0132
Copy link
Author

Thanks for the detailed explanation. I'd love to work out this whole issue and get started now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants