Skip to content

Conversation

@Kerrick
Copy link

@Kerrick Kerrick commented Jan 27, 2026

Hello,

I noticed recently that RubygemsHelper has a simple_markup method that detects the presence of an RDoc h2+ in a gem specification's description. It only activates when there is an h2+ present in the gem__desc, so it only applies to gems that get simple_markup applied. (Edited: See next comment.)

def simple_markup(text)
if /^==+ [A-Z]/.match?(text)
options = RDoc::Options.new
options.pipe = true
sanitize RDoc::Markup.new.convert(text, RDoc::Markup::ToHtml.new(options))
else
tag.p(escape_once(sanitize(text.strip)))
end
end

This pull request adds styles based on @st0012's Aliki, the new default RDoc theme, combined with RubyGems.org's existing styles. It has the the same relative font sizes and weights, and the same relative margins and padding, as Aliki. It uses the same colors as RubyGems.org.

I know #5802 is coming eventually, but this can really elevate the gem info page in the mean time. Please see below for before & after screenshots.

Note

This hides image tags, because the current content security policy blocks them from being displayed.

Before

CleanShot 2026-01-26 at 21 29 10@2x CleanShot 2026-01-26 at 21 29 47@2x CleanShot 2026-01-26 at 21 32 26@2x CleanShot 2026-01-26 at 21 32 37@2x

After

CleanShot 2026-01-26 at 21 33 07@2x CleanShot 2026-01-26 at 21 33 05@2x CleanShot 2026-01-26 at 21 31 05@2x CleanShot 2026-01-26 at 21 31 02@2x

This pull request was created without any contribution from a generative AI. declare-ai.org

@Kerrick Kerrick force-pushed the simple_markup_style branch from 76ee421 to db8da45 Compare January 28, 2026 14:48
@Kerrick
Copy link
Author

Kerrick commented Jan 28, 2026

I added an optional second commit that flips the heuristic. Rather than only activating when there is an h2+ present in the gem__desc, it activates when there is anything but a single p present. That way if the RubygemsHelper#simple_markup heuristic ever changes, this will be more resilient.

In case the heuristic ever changes, this instead applies the Aliki-based
styles if there is any rich markup at all.
@Kerrick Kerrick force-pushed the simple_markup_style branch from db8da45 to 5d81518 Compare January 28, 2026 14:50
@codecov
Copy link

codecov bot commented Jan 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.48%. Comparing base (5b588b9) to head (5d81518).
⚠️ Report is 6 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6228      +/-   ##
==========================================
- Coverage   97.26%   94.48%   -2.79%     
==========================================
  Files         477      480       +3     
  Lines        9871    10059     +188     
==========================================
- Hits         9601     9504      -97     
- Misses        270      555     +285     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

1 participant