[pull] master from ruby:master#110
Merged
pull[bot] merged 6 commits intosysfce2:masterfrom Dec 24, 2025
Merged
Conversation
https://github.com/ruby/ruby/actions/runs/20486207381/job/58869094401#step:14:641 > /home/runner/work/ruby/ruby/src/gems/src/rdoc/lib/rdoc/generator/template/aliki/_sidebar_pages.rhtml:38: warning: statement not reached https://github.com/ruby/ruby/actions/runs/20486207381/job/58869094401#step:14:689 > /home/runner/work/ruby/ruby/src/gems/src/rdoc/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml:16: warning: statement not reached
I noticed that Markup elements are currently not standardized in any way - even though the code does make some assumptions. For example, there are visitors that depend on all elements implementing `accept`, but no parent class or interface that will help guarantee every element implements it. Some elements are implemented as structs, while other are classes. Some have parent classes for shared functionality and APIs and others don't. I propose that we standardize the markup elements a bit more, so that we can have a common interface for them. It will make it easier for the RDoc to Markdown translator if we can enforce that every markup element has to be able to print itself in Markdown - and I believe the code will be easier to understand too. This PR creates a base `Markup::Element` class and I standardized `Heading` and `Table` as an example. I'm also finding it challenging to understand the logic with no clue about what types are and what is expected from each method, so I also propose we annotate some of these as documentation - even if we're not adopting type checking. If folks agree, I will continue to standardize more markup elements. I'm trying to document what each element represents along the way.
Continuing the work from #1389. This PR standardizes the `HardBreak` element to a consistent style and starts inheriting from `Element`.
Continuing the work from #1389. This PR standardizes the `BlankLine` element to a consistent style and starts inheriting from `Element`.
Continuing the work from #1389. This PR standardizes the `Raw` element to a consistent style and starts inheriting from `Element`.
Add a mention in both contributing and agents about the style of type annotations we're using to help navigate the codebase and lower the barrier to new contributors.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )