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 documentation labels #3085

Merged
merged 1 commit into from
Jan 21, 2023
Merged

Conversation

jlaehne
Copy link
Contributor

@jlaehne jlaehne commented Jan 20, 2023

Description of the change

Added labels to the documentation, particularly for chapter headings, to facilitate referencing from the LumiSpy documentation.

Some minor additions to documentation

Progress of the PR

  • Change implemented (can be split into several points),
  • update user guide (if appropriate),
  • add an changelog entry in the upcoming_changes folder (see upcoming_changes/README.rst),
  • Check formatting changelog entry in the readthedocs doc build of this PR (link in github checks)
  • ready for review.

@codecov
Copy link

codecov bot commented Jan 21, 2023

Codecov Report

Base: 80.60% // Head: 80.60% // No change to project coverage 👍

Coverage data is based on head (0828ee7) compared to base (5fd8636).
Patch has no changes to coverable lines.

Additional details and impacted files
@@                 Coverage Diff                 @@
##           RELEASE_next_major    #3085   +/-   ##
===================================================
  Coverage               80.60%   80.60%           
===================================================
  Files                     176      176           
  Lines                   24476    24476           
  Branches                 5383     5383           
===================================================
  Hits                    19729    19729           
  Misses                   3421     3421           
  Partials                 1326     1326           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@hakonanes
Copy link
Contributor

hakonanes commented Jan 21, 2023

I recently discovered this nice oneliner

> python -m sphinx.ext.intersphinx https://hyperspy.org/hyperspy-doc/current/objects.inv
py:attribute
	hyperspy._components.eels_cl_edge.EELSCLEdge.effective_angle api/hyperspy._components.eels_cl_edge.html#hyperspy._components.eels_cl_edge.EELSCLEdge.effective_angle
	hyperspy._components.eels_cl_edge.EELSCLEdge.fine_structure_active api/hyperspy._components.eels_cl_edge.html#hyperspy._components.eels_cl_edge.EELSCLEdge.fine_structure_active
# Skip to bottom
	zhou2011                                 [Zhou2011]                              : user_guide/bibliography.html#zhou2011
	zspy-format                              ZSpy - HyperSpys Zarr Specification    : user_guide/io.html#zspy-format

which lists all available links in HyperSpy's sphinx documentation. If you combine it with grep, you can search for a specific word in this list

> python -m sphinx.ext.intersphinx https://hyperspy.org/hyperspy-doc/current/objects.inv | grep bibliography
	user_guide/bibliography                  Bibliography                            : user_guide/bibliography.html
	[burdet2013]                             [Burdet2013]                            : user_guide/bibliography.html#burdet2013
# Skip to bottom
	zhou2011                                 [Zhou2011]                              : user_guide/bibliography.html#zhou2011

Thus, some of the added labels are already available for use with Intersphinx, like the one for the "Bibliography". In your reStructuedText, you can use this syntax:

:doc:`bibliography<hyperspy:user_guide/bibliography`

or just

:doc:`hyperspy:user_guide/bibliography`

to use the link from HyperSpy's documentation ("Bibliography").

For later quick reference you can copy the oneliner from the relevant code block in the kikuchipy docs.

Copy link
Member

@ericpre ericpre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is something that we should be using more and we will need to make sure to keep on top of the warnings for broken labels when building the documentation! :)

@ericpre ericpre merged commit b47d0ea into hyperspy:RELEASE_next_major Jan 21, 2023
@jlaehne jlaehne deleted the doc-labels branch January 21, 2023 22:22
@jlaehne jlaehne mentioned this pull request Mar 15, 2023
57 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants