gem.sh icon indicating copy to clipboard operation
gem.sh copied to clipboard

Improve README content rendering and styles

Open marcoroth opened this issue 2 years ago • 2 comments

For some gems on gem.sh the show page renders very weird and broken looking READMEs, we should look into what's causing it and see if there might be a more relaxed Markdown parser which can also better recover from a malformed markdown file.

It might also be that some of our styles are leaking into the rendered markdown content, maybe we need to better scope the selectors.

Example: https://gem.sh/gems/activerecord/v7.0.6

marcoroth avatar Aug 02 '23 15:08 marcoroth

One such issue seems to be related to code blocks with a language specified. I was reviewing a simple gem I wrote and found the readme was looking in disarray.

For example, when the following codeblocks specifying ruby are encountered:

image

it renders as

image

and

image

Link to my example:

  • https://gem.sh/gems/output_attributes/v1.0.1
  • https://github.com/ttilberg/output_attributes/

I believe the ActiveRecord example is currently suffering the same issue. Fixing the language detection for code blocks might go a long way to resolving the output.

ttilberg avatar Aug 15 '23 19:08 ttilberg

@ttilberg improved this a bit in #44, but I think there are still some thing we can improve, like:

  • the character escaping mentioned in #44
  • code highlighting in code blocks
  • styles of the stylesheet itself

Also some more advanced features could be cool:

  • the ability to copy code from code blocks and the
  • Auto-reference constants to the docs page when they are mentioned in the README

marcoroth avatar Aug 18 '23 15:08 marcoroth