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

Support GitHubs Markdown Alerts (or as they're called in this project: Callouts) #1483

Open
Plagiatus opened this issue Jun 17, 2024 · 2 comments
Labels
enhancement status: ready to implement Issues that can be actively worked on, and need an implementation!

Comments

@Plagiatus
Copy link

Is your feature request related to a problem? Please describe.
We're using https://github.com/orgs/community/discussions/16925 in our .md files. Now when trying to use just-the-docs, we'll need a different syntax, so it doesn't work on both github.com and github pages.

Describe the solution you'd like
I'd like for the github flavoured alerts/callouts to be natively supported by just-the-docs.

Describe alternatives you've considered
A very viable alternative could be that it supports the github callouts syntax while still requiring configuration (for colors etc) like they do for current callouts.

@mattxwang
Copy link
Member

Hi @Plagiatus,

Thanks for submitting an issue! To be upfront, I am not familiar with the specifics of how GitHub's feature works (it seems like they load a markdown extension that handles this, but I can't find source code for that extension). It also seems like it's controversial (see the discussion in your link).

I would certainly be open to an approach that either:

  • easy, but not ideal: allows for an alternate syntax to enable the existing callout feature
  • ideal, but potentially not easy: allows for users to easily add an extension/swap out to a markdown parser that supports GitHub-style callouts (I believe this is not a part of GFM, but I could be wrong; it's not in the spec)

The latter may already be possible - you might just need to install a markdown extension gem and enable it. However, I didn't find one with a quick Google.

Generally speaking, the approach should be:

  • backwards-compatible
  • opt-in
  • relatively localized in its scope (e.g. not rewriting the entire theme)
  • reasonably simple to do & well-documented

I am slowly chipping away at my personal backlog but will not get around to implementing this myself for many months. I'd be happy to review a PR if you're willing to contribute one!

@Plagiatus
Copy link
Author

I understand that this is fairly low priority, it is for me, too.

Unfortunately I don't have any ruby experience, so contributing will be difficult for me. And for me it's also not high priority enough to put aside all the other things I'm doing to learn ruby to implement this. It would also be waaay easier for me to just accept that it won't look good in github markdown anymore and exclusively use jtd's style. 😄

I just figured I'd let you know this is a thing in case you wanted to support it. I very much understand if it's not something quick or easy to fix / add 👍

@mattxwang mattxwang added the status: ready to implement Issues that can be actively worked on, and need an implementation! label Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement status: ready to implement Issues that can be actively worked on, and need an implementation!
Projects
None yet
Development

No branches or pull requests

2 participants