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

Refactor darkfish's classes sidebar implementation #1296

Merged
merged 4 commits into from
Feb 19, 2025

Conversation

st0012
Copy link
Member

@st0012 st0012 commented Feb 18, 2025

The current logic written in ERB template is super hard to read and understand. I think given its complexity is makes sense to implement those logic in pure Ruby methods instead of ERB code in a view.

Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

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

+1

Copy link

cloudflare-workers-and-pages bot commented Feb 19, 2025

Deploying rdoc with  Cloudflare Pages  Cloudflare Pages

Latest commit: 609cf83
Status: ✅  Deploy successful!
Preview URL: https://bef32db6.rdoc-6cd.pages.dev
Branch Preview URL: https://refactor-darkfish-implementa.rdoc-6cd.pages.dev

View logs

The current usage always respects the `klass.display?` value, so we don't
need to pass it to the proc.
Given the generation involves recursion and multiple conditions, it's
easier to follow if we move them out of ERB and into the Ruby code.
@st0012 st0012 force-pushed the refactor-darkfish-implementation branch from 8b259c2 to 88ae47f Compare February 19, 2025 10:51
@st0012 st0012 requested a review from tompng February 19, 2025 10:52
@st0012
Copy link
Member Author

st0012 commented Feb 19, 2025

BTW, I think we can later do the same refactor for _sidebar_pages, and it should be able to reuse some of the same logic we extracted out here.

@st0012 st0012 force-pushed the refactor-darkfish-implementation branch from 88ae47f to 609cf83 Compare February 19, 2025 15:34
@st0012 st0012 requested a review from tompng February 19, 2025 15:35
@st0012 st0012 merged commit 9b5ce6d into master Feb 19, 2025
52 checks passed
@st0012 st0012 deleted the refactor-darkfish-implementation branch February 19, 2025 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants