-
Notifications
You must be signed in to change notification settings - Fork 110
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
sphinx-codeautolink improvements #281
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,4 +54,5 @@ jobs: | |
timeout-minutes: 5 | ||
if: always() | ||
run: | | ||
jupyter-book clean ./ | ||
jupyter-book build ./ --builder linkcheck |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,15 @@ | ||
.bd-header-announcement { | ||
background-color: var(--pst-color-info-bg); | ||
} | ||
|
||
.sphinx-codeautolink-a:link { | ||
border-bottom-color: lightgray; | ||
border-bottom-style: dotted; | ||
border-bottom-width: 1px; | ||
} | ||
|
||
.sphinx-codeautolink-a:hover { | ||
border-bottom-color: rgb(255, 139, 139); | ||
border-bottom-style: dotted; | ||
border-bottom-width: 1px; | ||
} | ||
Comment on lines
+5
to
+15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dcherian @zmoon I think a subtle dotted underline is nice, personally I think the thick underlines (https://scikit-image.org/docs/stable/auto_examples/segmentation/plot_regionprops.html) are a bit distracting and distinct from the jupyterlab experience, but open to other opinions! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I concur! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A little darker would be nicer to me. It's also convention that solid lines are clickable links, so perhaps just a thin darker line? |
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.
@felix-hilden, I realize this issue (felix-hilden/sphinx-codeautolink#131 (comment) ) has been closed for a while, but curious based on your comment if it does seems straightforward to implement a simplification of (
"xarray.core.dataarray.DataArray": "xarray.DataArray"
) to avoid having to enumerate every method?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.
Would setting
__module__
fix this? (pydata/xarray#4279)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.
Based on the above issue, if I add
toconf.py
before building I'm gettingHandler <bound method SphinxCodeAutoLink.create_references of <sphinx_codeautolink.extension.SphinxCodeAutoLink object at 0x145730710>> for event 'env-updated' threw an exception (exception: maximum recursion depth exceeded)
...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.
Can you try adding it to xarrays init.py?
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.
Hi! Yeah I'm not at all opposed to having the feature that was discussed in the issue, I've just been out of the game for a while focusing on other things and I have personally no need for that. But I'm very open to contributions 👌
Personally I've opted for changing module attributes like so and it's worked well for me.
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.
actually it does look like chaning either
conf.py
orxarray/__init__.py
works, I think the recursion error was coming from some issue with my local settings/cache...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.
kind of a pain to modify conf.py via jupyter book (jupyter-book/jupyter-book#858,
jupyter-book/jupyter-book#1673 (comment)) but that is probably the way to go...
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.
Let's do it upstream? I think we'd like this in Xarray too.