jupyter-book / mystmd

Command line tools for working with MyST Markdown.
https://mystmd.org/guide
MIT License
219 stars 64 forks source link

Add a button for call to action and noticeable links #1654

Open choldgraf opened 6 days ago

choldgraf commented 6 days ago

Sometimes it's useful for authors to put a button on a page to draw more attention to it. For example, a "Get started" button on a documentation landing page, or a "Donate" button to direct users to a donation page.

Currently the closest thing you can get is manually defining an HTML element like:

<a href="/start">
  <div style="border-radius: 1em; background-color: #e07330; width: 8em; height: 3em; margin: .5em auto; color: white;">
  Get started
  </div>
</a>

However this has a few shortcomings:

It would be much easier if we either:

  1. Supported native button syntax, like:

    :::{button} Button text
    :style: some ways to style the button, center it, etc
    :::
  2. Fixed #1617 so that you could style the <div> as you wished with classes from tailwind (and make this work for <a> as well)