Skip to content

[RFC]: add link elements to README section headings to allow linking to that section #32

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
3 tasks done
kgryte opened this issue Sep 10, 2021 · 1 comment · May be fixed by #74
Open
3 tasks done

[RFC]: add link elements to README section headings to allow linking to that section #32

kgryte opened this issue Sep 10, 2021 · 1 comment · May be fixed by #74

Comments

@kgryte
Copy link
Member

kgryte commented Sep 10, 2021

Description

This RFC proposes adding link elements to README section headings to allow linking to that section.

This would be similar to how GitHub displays a link icon on hover which supports creating a link to that specific section.

One issue, however, is that package README HTML fragments are generated outside of the React application, so we'd need to either

a. add <a> tags before all headings in the original Markdown files. We do this for some READMEs now, in order to cross-reference particular sections within the same Markdown file.
b. modify the fragment generation process to insert <a> tags before headings and assigning headings unique ids.
c. manipulate the DOM on fragment load from within the React app.

From a runtime performance perspective, my preference would be for (a) or (b).

Our practice for (a) is somewhat problematic as we rely on the deprecated name attribute.

For (b), we'd need to perform some processing of the generated HTML, which could be beneficial as we could generate readable heading ids for function signatures and methods.

Accordingly, I think I'd lean toward approach (b).

Related Issues

No.

Questions

No.

Other

No.

Checklist

  • I have read and understood the Code of Conduct.
  • Searched for existing issues and pull requests.
  • The issue name begins with RFC:.
@rahulptl165
Copy link

rahulptl165 commented Mar 10, 2025

Hi @kgryte, I have created a pull request that resolve this issue. pls review the changes and let me know if any further modification needed.

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

Successfully merging a pull request may close this issue.

2 participants