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

feat(sidebars): add depth option to listSubPages[Grouped] #74

Closed
wants to merge 3 commits into from

Conversation

caugner
Copy link
Contributor

@caugner caugner commented Jan 3, 2025

Description

Allows to listSubPages recursively.

Motivation

Some CSS functions like color-mix() are nested, so they currently no longer appear in the sidebar, because depth defaults to 1.

Additional details

To test this, apply this change in content:

diff --git a/files/sidebars/cssref.yaml b/files/sidebars/cssref.yaml
index 3f2b20e1f8..a6b0e741d6 100644
--- a/files/sidebars/cssref.yaml
+++ b/files/sidebars/cssref.yaml
@@ -96,6 +96,7 @@ sidebar:
     path: /Web/CSS
     title: Functions
     tags: css-function
+    depth: 2
     details: closed
   - type: listSubPages
     path: /Web/CSS

Related issues and pull requests

Fixes #73.

@caugner caugner force-pushed the recursive-list-sub-pages branch from 03e0070 to c93dcde Compare January 3, 2025 11:22
@caugner caugner changed the title feat(sidebars): add recursive listSubPages[Grouped] option feat(sidebars): add depth option to listSubPages[Grouped] Jan 3, 2025
@caugner caugner marked this pull request as draft January 3, 2025 14:44
@caugner
Copy link
Contributor Author

caugner commented Jan 3, 2025

Unfortunately, this approach doesn't work, because the list_subpages_internal() implementation currently always renders a tree structure, and skips intermediate nodes that don't match the filtered page type.

It doesn't seem trivial to extend the behavior of this function, because it mixes querying and displaying, e.g. sub-trees are individually sorted, so we cannot easily display nested pages in a flat list.

@caugner caugner closed this Jan 3, 2025
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.

CSSRef is missing functions with nested slugs
1 participant