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

docs: Enable drop-downs in the API #1095

Closed
sylvaincom opened this issue Jan 13, 2025 · 3 comments · Fixed by #1325
Closed

docs: Enable drop-downs in the API #1095

sylvaincom opened this issue Jan 13, 2025 · 3 comments · Fixed by #1325
Assignees
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed
Milestone

Comments

@sylvaincom
Copy link
Contributor

sylvaincom commented Jan 13, 2025

Follow-up of #1077, originally posted by @sylvaincom in #1077 (comment)

Which part of the documentation needs improvement?

API documentation

Describe the problem found in the documentation

The EstimatorReport uses some methods (accessors) that exist only in some cases (whether classification or regression for example). So it's complicated with the Sphinx API. @glemaitre found a sphinx_autosummary_accessors Sphinx plug-in that is currently used by skore. Otherwise, Sphinx sees accessors as properties and is not able to build an API. Hence, all accessors exist. However, the list is currently too long:

2025-01-13T12_14_04_screenshot

Suggested improvement

As done in Pandas, we should use drop-downs:

Enregistrement.de.l.ecran.2025-01-10.a.15.20.05.mov

Additional context

No response

@sylvaincom sylvaincom added documentation Improvements or additions to documentation needs-triage This has been recently submitted and needs attention and removed needs-triage This has been recently submitted and needs attention labels Jan 13, 2025
@MarieSacksick MarieSacksick added this to the Skore 0.6 milestone Jan 20, 2025
@auguste-probabl
Copy link
Contributor

With @rouk1 we looked at this for a bit with our limited knowledge of sphinx/rst.
We also looked into how pandas and sklearn achieve this.

Here are the two ideas we had:

Change file structure of the generated/ directory

sphinx-pydata-theme knows to add dropdowns for nested pages as shown in this example, but our API docs are all laid out flatly in the generated/ directory. In sklearn, a special script is used to enforce a nested structure. We don't know how we could achieve this, and the accessor mechanic seems to make it yet more complicated.

Rely on show_nav_level option

As detailed here, the show_nav_level setting can be used to collapse sections that have a :caption: (sections without a caption are hidden). However we can't get the hierarchy of headings right yet. This is the most promising idea IMO.

ps: sphinx is hard 😢

@auguste-probabl auguste-probabl added the help wanted Extra attention is needed label Jan 21, 2025
@lesteve
Copy link

lesteve commented Jan 22, 2025

From a quick look at it, the thing I would try 1 is to try to mirror pandas structure:

This may be possible to do it in a single file, but I have to admit I never managed to understand the sphinx toctree and how this relates to the left-hand-side navbar ...

Footnotes

  1. I am not a sphinx expert far from it, so this could be sending you down the wrong path

@auguste-probabl
Copy link
Contributor

@glemaitre Maybe you have an idea? The accessor documentation logic makes this harder it seems. I'd be happy to pair on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed
Projects
None yet
4 participants