Uploaded image for project: 'Jenkins Website'
  1. Jenkins Website
  2. WEBSITE-651

Honor anchors inside GitHub README when rendering on plugins.jenkins.io

    Details

    • Type: Improvement
    • Status: Done (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: plugin-site
    • Labels:
      None
    • Similar Issues:

      Description

      Documentation for certain plugins (git plugin, configuration as code plugin, etc.) can be quite lengthy. Navigation can be assisted by a table of contents at the top of the documentation page. That navigation can be implemented with the GitHub markdown convention which creates anchor names based on the heading text.

      For example, the git plugin extensions section is linked from the contents section and works in the README on GitHub. The same links do not work on the plugins.jenkins.io site.

        Attachments

          Issue Links

            Activity

            Hide
            zbynek Zbynek Konecny added a comment -

            I guess the reason GitHub uses the prefix is to avoid collisions with UI elements defined by GitHub itself. So a foolproof solution would be to keep the anchors and call scrolntoView from some event listeners (load, link clicked). But Tim's fix is good in 99%+ of cases, so maybe close this and wait until we run into actual collision?

            Show
            zbynek Zbynek Konecny added a comment - I guess the reason GitHub uses the prefix is to avoid collisions with UI elements defined by GitHub itself. So a foolproof solution would be to keep the anchors and call scrolntoView from some event listeners (load, link clicked). But Tim's fix is good in 99%+ of cases, so maybe close this and wait until we run into actual collision?
            Hide
            markewaite Mark Waite added a comment -

            I've confirmed that the links inside the git plugin documentation now work from my Chrome browser. Steps I took to verify it:

            • Open the git plugin page at https://plugins.jenkins.io/git in Chrome, Edge, and Internet Explorer
            • Click links from the table of contents
            • Confirm the page navigates to the correct location

            Thanks very much for the fix!

            Show
            markewaite Mark Waite added a comment - I've confirmed that the links inside the git plugin documentation now work from my Chrome browser. Steps I took to verify it: Open the git plugin page at https://plugins.jenkins.io/git in Chrome, Edge, and Internet Explorer Click links from the table of contents Confirm the page navigates to the correct location Thanks very much for the fix!
            Hide
            timja Tim Jacomb added a comment -

            I assumed there would be more edge cases with the other fix and from reading the GitHub issue GitHub have hit a few issues with it, especially on mobile. The 99% fix should work fine for us

            Show
            timja Tim Jacomb added a comment - I assumed there would be more edge cases with the other fix and from reading the GitHub issue GitHub have hit a few issues with it, especially on mobile. The 99% fix should work fine for us
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            I confirm, it works like a charm. 99% is probably good enough, but we can have a follow-up ticket to get to 100% if needed

            Show
            oleg_nenashev Oleg Nenashev added a comment - I confirm, it works like a charm. 99% is probably good enough, but we can have a follow-up ticket to get to 100% if needed

              People

              • Assignee:
                timja Tim Jacomb
                Reporter:
                markewaite Mark Waite
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: