Skip to content

tutorial index page with filterable list #3276

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

Open
wants to merge 54 commits into
base: main
Choose a base branch
from
Open

Conversation

lordy5
Copy link
Collaborator

@lordy5 lordy5 commented Mar 26, 2025

Custom sphinx directives for filterable lists

Created custom sphinx directives which can be used to create a filterable list of cards, and used these directives to create a filterable list of tutorial cards for the tutorials index page.

These directives could also be used to create similar filterable lists easily if needed in other parts of the documentation.

customcard

The first custom directive is customcard which is used to create, in this case, a card displaying information about a single scvi-tools tutorial. It has path parameter for specifying the path in the documentation to the tutorial, and a tags parameter for the tags describing that tutorial, which will be used for filtering in the list. The description for the tutorial goes in the directive's content.

This directive automatically generates the title, description, and group name that will be displayed on the card, as long as the correct path has been provided. The customcard directive should be placed a model group's index file (such as index_scrna.md).

Example:

\```{customcard}
:path: notebooks/scrna/harmonization
:tags: Analysis, Integration, Transfer-learning, Dimensionality-reduction, Removal-of-variance

This is a test description. Put the description as the main content of the customcard directive.
\```

customlist

The second custom directive is customlist which creates a filterable list from all of the customcard directives. During the documentation build process, this list will be generated in the markdown file where customlist is placed, such as index.md. No parameters are needed for this directive and it automatically retrieves all of the cards placed throughout the documentation files and adds them. It also generates buttons for filtering tutorials based on all found tags, and generates tabs for selecting the tutorial group to filter by (scRNA-seq, scATAC-seq, Quick Start...).

Example:

\```{customlist}
\```

Tutorial List

I've used these directives to create a list for the tutorials, which can be seen in the docs build preview on the tutorials page.

Copy link

codecov bot commented Mar 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.14%. Comparing base (7f2c8a2) to head (ec8dd16).

❗ There is a different number of reports uploaded between BASE (7f2c8a2) and HEAD (ec8dd16). Click for more details.

HEAD has 8 uploads less than BASE
Flag BASE (7f2c8a2) HEAD (ec8dd16)
11 3
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3276      +/-   ##
==========================================
- Coverage   86.15%   80.14%   -6.01%     
==========================================
  Files         193      193              
  Lines       17121    17121              
==========================================
- Hits        14750    13722    -1028     
- Misses       2371     3399    +1028     

see 26 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lordy5 lordy5 marked this pull request as ready for review April 9, 2025 03:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant