Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

DOC add dropdown header permalink #26872

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

Closed
wants to merge 6 commits into from

Conversation

greyisbetter
Copy link
Contributor

@greyisbetter greyisbetter commented Jul 20, 2023

as discussed in #26617

  • It will inject an id="xxx" in the <details> tag
  • if url have .html#xxx then it will add open to <details id="xxx"> tag

example:

it will change from:

<details>
  <summary class="btn btn-light">
    <strong>Custom Kernels</strong>

to:

<details id="custom-kernels" open>
  <summary class="btn btn-light">
    <strong>Custom Kernels<a class="headerlink" href="#custom-kernels" title="Custom Kernels">¶</a></strong>  

result:

dropdown result

cc @lucyleeow
cc @glemaitre @GaelVaroquaux

@github-actions
Copy link

github-actions bot commented Jul 20, 2023

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: b8e7448. Link to the linter CI: here

@lucyleeow
Copy link
Member

lucyleeow commented Jul 21, 2023

Would it be possible to enable getting a link to a the header via clicking next to it, e.g.: (you can't see the mouse in the screenshot but it's next to the header)

image

I am not very familiar with javascript, potentially @glemaitre or @thomasjpfan would have better guidance on the best approach? Potentially there is a Sphinx way to do this as suggested in: #26617 (comment) ?

@greyisbetter
Copy link
Contributor Author

No it will not add that permalink icon to header but you go that section via https://scikit-learn.org/stable/modules/svm.html#custom-kernels

@lucyleeow
Copy link
Member

lucyleeow commented Jul 21, 2023

It's not so much the icon, but clicking on it will update the URL to append '#<section_name>', so you don't have to manually do this.

@greyisbetter
Copy link
Contributor Author

It's not so much the icon, but clicking on it will update the URL to append '#<section_name>', so you don't have to manually do this.

Now it will work as expected

@greyisbetter greyisbetter deleted the header-permalink branch August 8, 2023 20:07
@lucyleeow
Copy link
Member

Sorry I know this is closed now but would this be an acceptable solution to being able to easily get hyperlinks to headers where a dropdown has been added? Maybe @glemaitre @thomasjpfan ?

@glemaitre
Copy link
Member

@lucyleeow I'm still in favor of having the feature that you requested. I did not get time to review PR lately but I should be back to business soonish.

If we can find an alternative solution to javascript, it would be better.

@glemaitre
Copy link
Member

@lucyleeow Would you mind opening a proper issue to be sure that we track properly this feature request?

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

Successfully merging this pull request may close these issues.

3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.