Skip to content

Conversation

@extern-c
Copy link

@extern-c extern-c commented Dec 8, 2025

This PR resolves #1335.

@extern-c extern-c temporarily deployed to fork-preview-protection December 8, 2025 16:26 — with GitHub Actions Inactive
@matzbot
Copy link
Collaborator

matzbot commented Dec 8, 2025

🚀 Preview deployment available at: https://9374ed67.rdoc-6cd.pages.dev (commit: 0837c66)

Copy link
Member

@st0012 st0012 left a comment

Choose a reason for hiding this comment

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

Thanks!

@st0012 st0012 added the bug label Dec 8, 2025
</div>
<div class="method-source-code" id="<%= method.html_name %>-source">
<pre class="<%= method.source_language %>" data-language="<%= method.source_language %>"><%= method.markup_code %></pre>
</div>
Copy link
Member

Choose a reason for hiding this comment

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

Moving this will change this HTML structure:

<div class="method-heading"></div>
<div class="method-controls"></div>
<div class="method-description"></div>

How about moving the whole <%- if method.token_stream %> method controls <% -end %> to

<%- unless method.skip_description? then %>
(HERE)
<div class="method-description">
  ...
</div>
...
<%- end %>

Copy link
Member

Choose a reason for hiding this comment

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

I'm aware of this but it also feels like source code div actually shouldn't be placed under description, if we want their display to be separate?

Copy link
Member

@tompng tompng Dec 8, 2025

Choose a reason for hiding this comment

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

if we want their display to be separate

I think there is no need to separate. If there's a reason to skip description, (example: it's an alias and the description/source are both visible in the original method), we don't need to show method source.
This will reduce generated HTML size especially when many aliases are defined. (edited. this part seems wrong)

For Hash#has_value?, it shouldn't skip description. #1491 will fix it from the backend side.

Copy link
Member

Choose a reason for hiding this comment

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

Looks like method.skip_description? and method.token_stream.nil? is almost identical (especially after some bug fixes of backend),
I reconsidered it's OK moving method-description outside of <%- unless method.skip_description? then %> 👍

Copy link
Author

Choose a reason for hiding this comment

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

Hi @st0012 and @tompng,

Thanks for the code review! For my own understanding, would you mind confirming when method.skip_description? is supposed to return true?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Source link does not work for Hash@has_value?

4 participants