-
Notifications
You must be signed in to change notification settings - Fork 115
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
Using custom edit link #2012
Using custom edit link #2012
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2012 +/- ##
==========================================
- Coverage 82.98% 79.51% -3.47%
==========================================
Files 44 45 +1
Lines 7932 7917 -15
==========================================
- Hits 6582 6295 -287
- Misses 1350 1622 +272 |
Fixing also main methods (from autosummary) links
Pinging @Revathyvenugopal162 and @jorgepiloto because I think the approach developed here can be useful to implement in the |
Mitigated Caveat 1 by replacing all the |
@germa89, I had struggled with this for a while and I really like how you implemented it. I also implemented it in pyvista/pyvista#4320, and was able to resolve the "hack" by resolving the location of the object within GitHub's path. This greatly simplified the code. I recommend you implement the following:
|
Co-authored-by: Alex Kaszynski <akascap@gmail.com>
…hub.com/pyansys/pymapdl into doc/fixing-edit-button-link-on-examples
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks!
Merging and ignoring |
Fixing links in examples.
I also added a hack where everytime you click on "edit on Github" button in a page generated using
_autosummary
directive, it will take you to a github search page which follow the following approach:Given
chain_commands
:https://mapdl.docs.pyansys.com/version/stable/api/_autosummary/ansys.mapdl.core.Mapdl.chain_commands.html#chain-commands
The button will generate the following github search query:
where:
repo%3Apyansys%2Fpymapdl
: is to search only in PyMAPDL repopath%3A**%2Fansys%2Fmapdl%2Fcore%2FMapdl.py
is to search in the filemapdl.py
inansys/mapdl/core
which is read from the object definitionansys.mapdl.core.mapdl.chain_commands
.chain_commands+def+class
: extra keywords to increase the possibilities to hit the definition line.type=code
: to specify to search in code onlyCaveats:
path
part is not very reliable. For example, it will fail withlaunch_mapdl
because it is defined inlauncher.py
but imported at the root level (__init__.py
).Fix #2006
References: