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

Add information about required CSS to the README #32

Closed
4 tasks done
IncPlusPlus opened this issue Jan 6, 2022 · 4 comments
Closed
4 tasks done

Add information about required CSS to the README #32

IncPlusPlus opened this issue Jan 6, 2022 · 4 comments
Labels
💪 phase/solved Post is done

Comments

@IncPlusPlus
Copy link

Initial checklist

Problem

While trying to use this package, I noticed that none of the expected GitHub styling was being applied to my markdown. I thought that the issue potentially was some styling inherited from the fact that my app uses Material UI. After doing some inspecting of my rendered markdown versus the example from the react-markdown repo, I realized I hadn't even checked if there was any CSS that the example was using. There was! I'm still a novice in terms of web development and had assumed that this package would manage the styling. While the HTML was ready for styling, there was no CSS to apply to it and I spent a long amount of time just to figure that out.

Naturally, after already figuring this out, I encounter this helpful comment and this note from the remark-rehype repo. Such is life, I suppose. 😅

Solution

To make this package a little more accessible, I'd like to propose adding a small section to the README.md which makes it clear that this package produces HTML that is ready for styling but requires user-provided CSS to do so. This would use language similar to that in the rehype-katex README's CSS section. I'd happily make a pull request to make this happen.

Alternatives

If adding this info directly to the README.md is undesirable and the maintainers feel it exceeds the scope of the document or makes it longer than necessary, a troubleshooting document could be made with common pitfalls, like the one I fell in, and their solutions.

@github-actions github-actions bot added 👋 phase/new Post is being triaged automatically 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Jan 6, 2022
@wooorm
Copy link
Member

wooorm commented Jan 6, 2022

This package doesn’t handle HTML. Did you see https://github.com/remarkjs/remark-rehype#css

@IncPlusPlus
Copy link
Author

Right. This package is merely responsible for adding GFM support to remark-rehype, which is what actually transforms the syntax tree into HTML. However, features this package adds, like support for GitHub's tables syntax, will show up without so much as borders when rendered without the right CSS to complement it. I figured it couldn't hurt to mention it in the REAMDE.

@wooorm
Copy link
Member

wooorm commented Jan 7, 2022

Somewhat, yes! More correct terminology would be:

  • remark-gfm adds support for GFM to markdown (in the remark/unified ecosystem)
  • remark-rehype turns a markdown syntax tree into an HTML syntax tree

This would use language similar to that in the rehype-katex README's CSS section.
(from your OG post)

The thing is, that package requires CSS for visual users. It’s an HTML project whose result would otherwise be unreadable garbage. It’s a package that’s meant for browsers.

This plugin has nothing to do with CSS. Markdown has nothing to do with CSS. It doesn’t need browsers. Even when used with remark-rehype, without CSS, the final result is still usable.

This plugin doesn’t have “results” to style. No HTML. No browsers. So I’m not sure how to word this section you propose while being true, useful, but without sounding passive aggressive:

## CSS

Markdown has nothing to do with CSS.

Or:

## HTML & CSS

This package deals with markdown syntax.
It has nothing to do with how markdown is turned into HTML or how that shows up
in browsers.

What wording were you thinking of?

@wooorm
Copy link
Member

wooorm commented Sep 18, 2023

done!

@wooorm wooorm closed this as completed Sep 18, 2023
@wooorm wooorm added the 💪 phase/solved Post is done label Sep 18, 2023
@github-actions github-actions bot removed the 🤞 phase/open Post is being triaged manually label Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💪 phase/solved Post is done
Development

No branches or pull requests

2 participants