Skip to content

Support reverse order for glob pattern matching in table of content #2545

@rgaiacs

Description

@rgaiacs

This feature request will be used by JupyterHub's team-compass and possible Jupyter Book's team-compass.

Use case

MyST is used to archive notes of meetings, e.g.

  • January 2026 as 2026-01-01.md
  • February 2026 as 2026-02-01.md
  • March 2026 as 2026-03-01.md
  • ...

Visitors of the MyST powered web site are probably more interested in the latest meeting (e.g. 2026-03-01.md) instead of the first ever holding meeting (e.g. 2026-01-01.md). For this, it is nice to be able to list the archive notes in chronological reverse order.

Proposal

Expand Glob pattern matching to accept a option reverse. For example, the pattern-matching is

version: 1
project:
  toc:
    - file: root.md
    - pattern: '*.md'
      reverse: true

and the no pattern-matching is

version: 1
project:
  toc:
    - file: root.md
    - file: 2026-03-01.md
    - file: 2026-02-01.md
    - file: 2026-01-01.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions