Skip to content

Fix rendering with sort #5

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

Merged
merged 3 commits into from
Jul 25, 2025
Merged

Fix rendering with sort #5

merged 3 commits into from
Jul 25, 2025

Conversation

LuizMacedo
Copy link
Contributor

This pull request refactors the logic for grouping and displaying exercises by topic in the index.md file. The changes improve clarity and maintainability by introducing a new sorted_groups variable to handle the ordering of grouped exercises.

Refactoring of exercise grouping logic:

  • Updated the topic_order variable to use capitalized topic names ("Basic,Intermediate,Advanced,Expert") for consistency.
  • Introduced a sorted_groups variable to store pre-sorted groups, replacing the inline filtering and sorting logic in multiple loops. This simplifies the code and avoids redundant operations.
  • Adjusted the loops to iterate over sorted_groups instead of dynamically filtering grouped_exercises during each iteration.
  • Removed unused or redundant conditional checks and lines for improved readability.

@LuizMacedo LuizMacedo requested a review from Copilot July 25, 2025 05:31
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request refactors the exercise grouping and sorting logic in index.md to improve code clarity and maintainability. The changes eliminate redundant filtering operations and introduce a more structured approach to handling sorted exercise groups.

  • Standardized topic naming by capitalizing topic names in topic_order
  • Introduced sorted_groups variable to pre-sort groups once instead of filtering repeatedly
  • Simplified loop logic by removing redundant conditional checks and inline filtering

Co-authored-by: Copilot <[email protected]>
@LuizMacedo LuizMacedo merged commit 3e33a2c into main Jul 25, 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.

1 participant