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 related examples #111

Merged
merged 10 commits into from
Jan 26, 2023
Merged

Conversation

jacobtomlinson
Copy link
Member

@jacobtomlinson jacobtomlinson commented Jan 24, 2023

Closes #107

High level changes:

  • Adds a Sphinx extension that generates a mapping of tags to notebooks
  • Adds a relatedexamples directive for use on pages to show related notebooks
  • Added tags to the Sagemaker example notebook
  • Added the related examples section to the sagemaker page
  • Added ruff for linting (Split out into Add ruff to the repo linters #113)

By adding cell metadata tags to the first cell of a notebook those tags get added to the Sphinx notebook tag mapping. For example I added a cloud/aws/sagemaker tag to the Sagemaker notebook.

Then when you use the relatedexamples directive on a page it checks for any tags that match the page name. So using it in source/cloud/aws/sagemaker.md means it will find the Sagemaker notebook and link to it.

image

There are a few outstanding issues with the PR, but I'm keen to keep moving forwards and open separate issues to track those:

  • The example link currently uses the doc name rather than the example title because Sphinx hasn't parsed the titles yet at the point I'm processing the directive Fixed in 9e37293.
  • When you edit a notebook it should mark all the related pages for rebuild, but for some reason, this isn't happening

@jacobtomlinson jacobtomlinson added the sphinx Related to the Sphinx theme powering these docs label Jan 24, 2023
Copy link
Member

@betatim betatim left a comment

Choose a reason for hiding this comment

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

LGTM, modulo that one comment

source/examples/rapids-sagemaker-higgs/notebook.ipynb Outdated Show resolved Hide resolved
@betatim
Copy link
Member

betatim commented Jan 26, 2023

There is no way to access the site that the CI built right? Just asking because it would be convenient but not required.

@jacobtomlinson
Copy link
Member Author

Thanks for the review!

There is no way to access the site that the CI built right?

Not currently. I opened https://github.com/rapidsai/ops/issues/2413 a while back to ask Ops to set this up but they haven't gotten to it yet.

@jacobtomlinson jacobtomlinson merged commit d53055c into rapidsai:main Jan 26, 2023
@jacobtomlinson jacobtomlinson deleted the add-related-examples branch January 26, 2023 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sphinx Related to the Sphinx theme powering these docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add related examples section
2 participants