Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make a styled Markdown admonition box in a GitHub Gist?

I am trying to make a Markdown admonition box such as note box, warning box for GitHub Gist. I do some search on Google I find Python markdown admonition but these admonitions don't seem to work on GitHub Gist.

I have tried following Python warning admonition But this markdown syntax doesn't work on GitHub Gist.

!!! Hello Admonition 

I also tried bootstrap boxes like this but it does not have style as expected:

<div class="alert alert-danger" role="alert">     <div class="row vertical-align">         <div class="col-xs-1 text-center">             <i class="fa fa-exclamation-triangle fa-2x"></i>         </div>         <div class="col-xs-11">                 <strong>Error:</strong>                            </div>        </div>  </div> 

Is there any admonition syntax or HTML code method for GitHub Gist?

like image 811
my-lord Avatar asked May 26 '18 15:05

my-lord


People also ask

Does GitHub Gist support Markdown?

Most of you probably know and use Github Gists for sharing Code snippets. But did you know that Gists also support Markdown? Using Markdown makes it easy to create much richer code shareable code and even allows for an easy way to create self-contained Web content.

How do I embed a gist in GitHub Markdown?

Since markdown supports html, one can simply use the <script> tag to embed gist. ..and paste it in you markdown file.


2 Answers

Use emoji to call the user attention

> :warning: **If you are using mobile browser**: Be very careful here! 

Github example

Here is list of others emojis (just copy paste):

https://gist.github.com/roachhd/1f029bd4b50b8a524f3c

Or you can also use GitHub markdown:

https://gist.github.com/rxaviers/7360908

like image 122
Tiago Mendes Avatar answered Oct 09 '22 07:10

Tiago Mendes


You can make a box with some bold text in by using tables, like so:

| WARNING: be careful to baz the quux before initializing the retro encabulator! | | --- | 

This renders like this:

An image of a single-cell table, containing the text "WARNING: be careful to baz the quux before initializing the retro encabulator!"

It's a bit of an abuse of syntax, but it works. There's unfortunately no way to apply other formatting like colours, as Chris noted.

like image 28
ash Avatar answered Oct 09 '22 07:10

ash