Skip to content
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

Add support for adding/generating ids for sphinx-panels elements, to allow direct linking #56

Open
CAM-Gerlach opened this issue Nov 28, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@CAM-Gerlach
Copy link

CAM-Gerlach commented Nov 28, 2020

Is your feature request related to a problem? Please describe.

The Sphinx-Panels components, particularly dropdown, are very useful for constructing pages like FAQs, where linking directly to the resulting elements would be very useful. For example, we use Sphinx-Panels several places on the new docs site for the Spyder IDE, including the FAQ, where we want to be able to link users directly to specific questions.

Describe the solution you'd like

If an :id: property was added, that would allow us to either link directly to a question by id, or at least use the id to uniquely identify the element, such that we can more easily use a bit of JS to scroll to and open a specified dropdown by id. In addition, an option to to statically generate a displayed link anchor (see mockup below) to allow easy copy/pasting of the link elsewhere would be useful (though I'm not sure how you would want to style it by default; our current plan is to use a FA link icon).

Describe alternatives you've considered

For now, we're in the process of implementing by adding a unique class to each element as a "pseudo-id" and then using JS add the ids and the link anchors, but that's a crude hack that misuses HTML properties, Ultimately, in our particular application we're still going to need JS to reposition the scroll position to avoid the navbar and automatically open the linked question, but for most use cases adding an id and an anchor will be sufficient, and this will still simplify things for us considerably. Thanks.

Additional context

Example of link anchor (style, or implementation to begin with may be out of scope for sphinx-panels, but wanted to mention it just in case).

image

@CAM-Gerlach CAM-Gerlach added the enhancement New feature or request label Nov 28, 2020
@welcome
Copy link

welcome bot commented Nov 28, 2020

Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.

If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).

Welcome to the EBP community! 🎉

@chrisjsewell
Copy link
Member

Thanks @CAM-Gerlach, yep that sounds like it should be quite possible 👍

@junngo
Copy link

junngo commented Mar 26, 2021

Hello @chrisjsewell :)
I have a question. I don't think this function is made yet.
Is there any alternative method or plan to make this function?

Thank you for making a great library.

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

No branches or pull requests

3 participants