-
Notifications
You must be signed in to change notification settings - Fork 13
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
Link preview: allow customization of link query selector #554
Comments
We already discuss this in the past. My initial implementation supported this use case but we decided to not move forward with that and use auto-detection instead. There is a lot of discussion in #433 and readthedocs/readthedocs.org#11767 that we should review to understand our previous decisions and decided whether or not it makes sense now. |
I'm not describing the root selector described in those PRs, I'm describing the link selector, ie: Line 250 in 4600c99
The link selector Lines 247 to 250 in 4600c99
Is there a specific issue you are trying to describe with this approach? If we really needed to, All together: const rootSelector =
this.config.addons.options.root_selector || docTool.getRootSelector();
let selector = docTool.getLinkSelector();
if (this.config.addons.linkpreviews.selector) {
selector = `${rootSelector} ${this.config.addons.linkpreviews.selector}`
} |
Yes.
I would avoid this. If the user wants to change the CSS selector for the links preview, I would leave them to do it freely. This is an advance usage and I wouldn't like to be in middle. I'm sure there are going to be user that don't want use our heuristic because different reasons and they will be blocked by us. |
Allow for user customization of the query selector used for selecting link elements in the DOM. We already allow for link selector customization based on the underlying doc tool, so we're not far off. This would require a configuration option in the dashboard, and the default value could still be our automatic guess.
The text was updated successfully, but these errors were encountered: