You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The 'Edit this page' button is not functioning for the API docs pages as it redirects to a non-existent Github URL. This is because these pages are dynamically generated and do not reside in the repository. I simply want to hide that button on those specific pages. To accomplish this, I have attempted to use a short JavaScript snippet in my _static/custom.js file. However, the snippet doesn't seem to work as expected. Here's the code I'm currently using:
var githubPath = document.querySelector("div.tocsection.editthispage a").href;
var dirNames = githubPath.split('/');
if (dirNames.includes('apidoc') == true ) {
var tocSection = document.querySelector("div.tocsection.editthispage");
tocSection.style.display = "none";
}
I would appreciate any assistance in resolving this issue.
The text was updated successfully, but these errors were encountered:
The 'Edit this page' button is not functioning for the API docs pages as it redirects to a non-existent Github URL
already reported in #1237 (which will be fixed by #1246).
This is because these pages are dynamically generated and do not reside in the repository.
not exactly. It's because the commits for those pages aren't at the tip of a branch in the git history, and GitHub only allows the edit interface at branch tips. (try switching edit to blob in the URL and you'll see the pages exist on GitHub).
I simply want to hide that button on those specific pages. To accomplish this, I have attempted to use a short JavaScript snippet
I'll leave this issue open in case someone has time to help with the Javascript (I'm swamped at the moment, sorry). Would you be OK if the links just worked and pointed to an edit interface of the page on current main instead? If so I'll mark this to be closed by #1246
Thanks @drammock.
My case was a little different (my bad. I didn't give enough details, sorry). The API docs pages I'm referring to are generated from a Python script in conf.py. So those pages do not reside in the repository, that's why the edit button is not needed there.
I'll close this because the Javascript code worked for me. It wasn't working because I forgot to add the path in conf.py.
The 'Edit this page' button is not functioning for the API docs pages as it redirects to a non-existent Github URL. This is because these pages are dynamically generated and do not reside in the repository. I simply want to hide that button on those specific pages. To accomplish this, I have attempted to use a short JavaScript snippet in my
_static/custom.js
file. However, the snippet doesn't seem to work as expected. Here's the code I'm currently using:I would appreciate any assistance in resolving this issue.
The text was updated successfully, but these errors were encountered: