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

GitHub Flavored Markdown Examples #1

Closed
mojombo opened this Issue Apr 21, 2009 · 65 comments

Comments

Projects
None yet
@mojombo
Owner

mojombo commented Apr 21, 2009

GitHub Flavored Markdown

View the source of this content.

Let's get the whole "linebreak" thing out of the way. The next paragraph contains two phrases separated by a single newline character:

Roses are red
Violets are blue

The next paragraph has the same phrases, but now they are separated by two spaces and a newline character:

Roses are red
Violets are blue

Oh, and one thing I cannot stand is the mangling of words with multiple underscores in them like perform_complicated_task or do_this_and_do_that_and_another_thing.

A bit of the GitHub spice

In addition to the changes in the previous section, certain references are auto-linked:

These are dangerous goodies though, and we need to make sure email addresses don't get mangled:

My email addy is tom@github.com.

Math is hard, let's go shopping

In first grade I learned that 5 > 3 and 2 < 7. Maybe some arrows. 1 -> 2 -> 3. 9 <- 8 <- 7.

Triangles man! a^2 + b^2 = c^2

We all like making lists

The above header should be an H2 tag. Now, for a list of fruits:

  • Red Apples
  • Purple Grapes
  • Green Kiwifruits

Let's get crazy:

  1. This is a list item with two paragraphs. Lorem ipsum dolor
    sit amet, consectetuer adipiscing elit. Aliquam hendrerit
    mi posuere lectus.

Vestibulum enim wisi, viverra nec, fringilla in, laoreet
vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
sit amet velit.
2. Suspendisse id sem consectetuer libero luctus adipiscing.

What about some code in a list? That's insane, right?

  1. In Ruby you can map like this:

    ['a', 'b'].map { |x| x.uppercase }
    
  2. In Rails, you can do a shortcut:

    ['a', 'b'].map(&:uppercase)
    

Some people seem to like definition lists

Lower cost
The new version of this product costs significantly less than the previous one!
Easier to use
We've changed the product so that it's much easier to use!

I am a robot

Maybe you want to print robot to the console 1000 times. Why not?

def robot_invasion
  puts("robot " * 1000)
end

You see, that was formatted as code because it's been indented by four spaces.

How about we throw some angle braces and ampersands in there?

<div class="footer">
    &copy; 2004 Foo Corporation
</div>

Set in stone

Preformatted blocks are useful for ASCII art:

             ,-. 
    ,     ,-.   ,-. 
   / \   (   )-(   ) 
   \ |  ,.>-(   )-< 
    \|,' (   )-(   ) 
     Y ___`-'   `-' 
     |/__/   `-' 
     | 
     | 
     |    -hrr- 
  ___|_____________ 

Playing the blame game

If you need to blame someone, the best way to do so is by quoting them:

I, at any rate, am convinced that He does not throw dice.

Or perhaps someone a little less eloquent:

I wish you'd have given me this written question ahead of time so I
could plan for it... I'm sure something will pop into my head here in
the midst of this press conference, with all the pressure of trying to
come up with answer, but it hadn't yet...

I don't want to sound like
I have made no mistakes. I'm confident I have. I just haven't - you
just put me under the spot here, and maybe I'm not as quick on my feet
as I should be in coming up with one.

Table for two

IDNameRank
1Tom Preston-WernerAwesome
2Albert EinsteinNearly as awesome

Crazy linking action

I get 10 times more traffic from Google than from
Yahoo or MSN.

Also, shoop.

@kennethreitz

This comment has been minimized.

kennethreitz commented Dec 17, 2009

I want this in php!!!

@mojombo

This comment has been minimized.

Owner

mojombo commented Dec 17, 2009

Easy enough. Here's the Ruby code that we use. It should be simple to port to PHP.

http://gist.github.com/118964

@fgnass

This comment has been minimized.

fgnass commented Jan 21, 2010

Looks like the arrows/math example doesn't work.

@fgnass

This comment has been minimized.

fgnass commented Jan 21, 2010

Oh, therefore HTML (a subset?) seems to be supported in comments ;-)

@fgnass

This comment has been minimized.

fgnass commented Jan 22, 2010

Sorry my fault, I wasn't aware that Markdown also supports regular HTML tags.
Anyway, the a^2 and arrow -> syntax mentioned in the example doesn't seem to work.

@perj

This comment has been minimized.

perj commented Mar 17, 2010

Doesn't seem to parse valgrind reports very well, eg. http://github.com/facebook/hiphop-php/issues/#issue/50 a bit down. Nor gdb tracebacks for that matter.

@snoldak924

This comment has been minimized.

snoldak924 commented Aug 6, 2010

a^2 works for me, but not ->

Fedora 12, FF 3.5.11

@Archeleus

This comment has been minimized.

Archeleus commented Nov 7, 2010

Yeah, arrows don't work.

@najamelan

This comment has been minimized.

najamelan commented Nov 23, 2010

any chance on images? Being able to upload a screenshot in an issue tracker is quite useful

@paradoxxxzero

This comment has been minimized.

@cjxgm

This comment has been minimized.

cjxgm commented Jan 8, 2011

I like this feeling...

Maybe there's something wrong in the page.

Under Set in stone.

And -> doesn't work on my computer, too.

Yeah, I like to try these.

f(x) = sin(ax^2 ) + bx + c

OK

That's it!

  1. abcdef
    ghijklmnopq
  2. cdefg
  • abc
  • cde
@ekd123

This comment has been minimized.

ekd123 commented Feb 1, 2011

B

I

_BI_

What is this?

xxx is same as xxx?

@woomla

This comment has been minimized.

woomla commented Mar 7, 2011

And this is ?
@Rosuav

This comment has been minimized.

Rosuav commented Mar 20, 2011

Something seems to be wrong with the ASCII art example; I think it's coming out as code but not pre.

@carlosalexsander

This comment has been minimized.

carlosalexsander commented Jul 28, 2011

[testing]

@carlosalexsander

This comment has been minimized.

carlosalexsander commented Jul 28, 2011

 teste 
@klickverbot

This comment has been minimized.

klickverbot commented Sep 14, 2011

Isn't the above rendering pretty much broken?

@ghost

This comment has been minimized.

ghost commented Oct 13, 2011

This Api's Tester

@sanek83

This comment has been minimized.

sanek83 commented Nov 17, 2011

logo

@SethMilliken

This comment has been minimized.

SethMilliken commented Mar 15, 2012

Given that this page is offered as the primary example linked from the GitHub Flavored Markdown page, it would be great if it rendered correctly. So thanks to the wonderful fact that comments themselves use this very markdown, I've included a c&p of the corresponding referenced source (with the exception of the following minor fix, s/</&lt;/, in the <pre> example which appears to be indicative of what is arguably a bug in the <pre> parsing code):

Begin Example Source of Corrected <pre> Section


<pre>
             ,-. 
    ,     ,-.   ,-. 
   / \   (   )-(   ) 
   \ |  ,.>-(   )-&lt; 
    \|,' (   )-(   ) 
     Y ___`-'   `-' 
     |/__/   `-' 
     | 
     | 
     |    -hrr- 
  ___|_____________ 
</pre>

Begin Full Rendered Source


GitHub Flavored Markdown

View the source of this content.

Let's get the whole "linebreak" thing out of the way. The next paragraph contains two phrases separated by a single newline character:

Roses are red
Violets are blue

The next paragraph has the same phrases, but now they are separated by two spaces and a newline character:

Roses are red
Violets are blue

Oh, and one thing I cannot stand is the mangling of words with multiple underscores in them like perform_complicated_task or do_this_and_do_that_and_another_thing.

A bit of the GitHub spice

In addition to the changes in the previous section, certain references are auto-linked:

These are dangerous goodies though, and we need to make sure email addresses don't get mangled:

My email addy is tom@github.com.

Math is hard, let's go shopping

In first grade I learned that 5 > 3 and 2 < 7. Maybe some arrows. 1 -> 2 -> 3. 9 <- 8 <- 7.

Triangles man! a^2 + b^2 = c^2

We all like making lists

The above header should be an H2 tag. Now, for a list of fruits:

  • Red Apples
  • Purple Grapes
  • Green Kiwifruits

Let's get crazy:

  1. This is a list item with two paragraphs. Lorem ipsum dolor
    sit amet, consectetuer adipiscing elit. Aliquam hendrerit
    mi posuere lectus.

Vestibulum enim wisi, viverra nec, fringilla in, laoreet
vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
sit amet velit.
2. Suspendisse id sem consectetuer libero luctus adipiscing.

What about some code in a list? That's insane, right?

  1. In Ruby you can map like this:

    ['a', 'b'].map { |x| x.uppercase }
    
  2. In Rails, you can do a shortcut:

    ['a', 'b'].map(&:uppercase)
    

Some people seem to like definition lists

Lower cost
The new version of this product costs significantly less than the previous one!
Easier to use
We've changed the product so that it's much easier to use!

I am a robot

Maybe you want to print robot to the console 1000 times. Why not?

def robot_invasion
  puts("robot " * 1000)
end

You see, that was formatted as code because it's been indented by four spaces.

How about we throw some angle braces and ampersands in there?

<div class="footer">
    &copy; 2004 Foo Corporation
</div>

Set in stone

Preformatted blocks are useful for ASCII art:

             ,-. 
    ,     ,-.   ,-. 
   / \   (   )-(   ) 
   \ |  ,.>-(   )-< 
    \|,' (   )-(   ) 
     Y ___`-'   `-' 
     |/__/   `-' 
     | 
     | 
     |    -hrr- 
  ___|_____________ 

Playing the blame game

If you need to blame someone, the best way to do so is by quoting them:

I, at any rate, am convinced that He does not throw dice.

Or perhaps someone a little less eloquent:

I wish you'd have given me this written question ahead of time so I
could plan for it... I'm sure something will pop into my head here in
the midst of this press conference, with all the pressure of trying to
come up with answer, but it hadn't yet...

I don't want to sound like
I have made no mistakes. I'm confident I have. I just haven't - you
just put me under the spot here, and maybe I'm not as quick on my feet
as I should be in coming up with one.

Table for two

IDNameRank
1Tom Preston-WernerAwesome
2Albert EinsteinNearly as awesome

Crazy linking action

I get 10 times more traffic from Google than from
Yahoo or MSN.

@panzi

This comment has been minimized.

panzi commented Jul 1, 2012

The table feature seems to be broken. At least the tables here do not work:
https://github.com/panzi/SocialSharePrivacy

I'll test some things here:

Character Replacement
< &lt;
> &gt;
& &amp;
" &quot;
' &#39;
Character Replacement
< &lt;
> &gt;
& &amp;
" &quot;
' &#39;
@panzi

This comment has been minimized.

panzi commented Jul 1, 2012

Character Replacement
< &lt;
Character Replacement
< &lt;
Character Replacement
Foo Bar
@panzi

This comment has been minimized.

panzi commented Jul 1, 2012

Nope, completely broken.

@panzi

This comment has been minimized.

panzi commented Jul 1, 2012

Last try:

Foo Bar
Egg Spam
@panzi

This comment has been minimized.

panzi commented Jul 1, 2012

Or do all <td>s need to be in one line?

FooBar
FooBar
FooBar
FooBar
@FichteFoll

This comment has been minimized.

FichteFoll commented Jul 1, 2012

https://github.com/FichteFoll/sublimetext-insertdate/blob/master/README.md

Seems to be similar to the "MultiMarkDown" thing but I'm not sure about that and it just works. The alignments do not, apparently (the :----, :-----: ------: thing).

Edit: Plugin for Sublime Tex 2.

@panzi

This comment has been minimized.

panzi commented Jul 1, 2012

Ok, then let me try this here:

Foo Bar
Egg Spam

... interestingly it shows the exact same problems as the <table> version. My guess is that sometime in the last few days some update wrecked table support on github and that old files are cached rendered and thus still look right.

When you click on "Edit" and then on "Preview" in the README.md you linked you see the exact same thing.

@FichteFoll

This comment has been minimized.

FichteFoll commented Jul 24, 2012

Yeah, seems to be fixed now.

@tsatalos

This comment has been minimized.

tsatalos commented Aug 18, 2012

It seems that un-necessary parsing happens within preformatted blocks < pre > ...< /pre >
For example the existance of a single '&' in the preformated block causes a parse error to be generated and the whole pre formatted block to become pink....

To avoid that you need to replace all your ampersands within pre with & amp ; ...
I am assuming that this is a parsing bug of the markdown library and not a standard behavior, correct?

odysseas

@yatharth

This comment has been minimized.

yatharth commented Aug 19, 2012

Broken

This soo doesn't work properly. And they still don't allow HTML inside <del>code<del> tags (which is probably a feature, not a bug). And as a previous commenter said:

Given that this page is offered as the primary example linked from the GitHub Flavored Markdown page, it would be great if it rendered correctly.

So I decided to try it on my own :)

GitHub Flavored Markdown

View the source of this content.

Let's get the whole "linebreak" thing out of the way. The next paragraph contains two phrases separated by a single newline character:

Roses are red
Violets are blue

The next paragraph has the same phrases, but now they are separated by two spaces and a newline character:

Roses are red
Violets are blue

Oh, and one thing I cannot stand is the mangling of words with multiple underscores in them like perform_complicated_task or do_this_and_do_that_and_another_thing.

A bit of the GitHub spice

In addition to the changes in the previous section, certain references are auto-linked:

These are dangerous goodies though, and we need to make sure email addresses don't get mangled:

My email addy is tom@github.com.

Math is hard, let's go shopping

In first grade I learned that 5 > 3 and 2 < 7. Maybe some arrows. 1 -> 2 -> 3. 9 <- 8 <- 7.

Triangles man! a^2 + b^2 = c^2

We all like making lists

The above header should be an H2 tag. Now, for a list of fruits:

  • Red Apples
  • Purple Grapes
  • Green Kiwifruits

Let's get crazy:

  1. This is a list item with two paragraphs. Lorem ipsum dolor
    sit amet, consectetuer adipiscing elit. Aliquam hendrerit
    mi posuere lectus.

Vestibulum enim wisi, viverra nec, fringilla in, laoreet
vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
sit amet velit.
2. Suspendisse id sem consectetuer libero luctus adipiscing.

What about some code in a list? That's insane, right?

  1. In Ruby you can map like this:

    ['a', 'b'].map { |x| x.uppercase }
    
  2. In Rails, you can do a shortcut:

    ['a', 'b'].map(&:uppercase)
    

Some people seem to like definition lists

Lower cost
The new version of this product costs significantly less than the previous one!
Easier to use
We've changed the product so that it's much easier to use!

I am a robot

Maybe you want to print robot to the console 1000 times. Why not?

def robot_invasion
  puts("robot " * 1000)
end

You see, that was formatted as code because it's been indented by four spaces.

How about we throw some angle braces and ampersands in there?

<div class="footer">
    &copy; 2004 Foo Corporation
</div>

Set in stone

Preformatted blocks are useful for ASCII art:

             ,-. 
    ,     ,-.   ,-. 
   / \   (   )-(   ) 
   \ |  ,.>-(   )-< 
    \|,' (   )-(   ) 
     Y ___`-'   `-' 
     |/__/   `-' 
     | 
     | 
     |    -hrr- 
  ___|_____________ 

Playing the blame game

If you need to blame someone, the best way to do so is by quoting them:

I, at any rate, am convinced that He does not throw dice.

Or perhaps someone a little less eloquent:

I wish you'd have given me this written question ahead of time so I
could plan for it... I'm sure something will pop into my head here in
the midst of this press conference, with all the pressure of trying to
come up with answer, but it hadn't yet...

I don't want to sound like
I have made no mistakes. I'm confident I have. I just haven't - you
just put me under the spot here, and maybe I'm not as quick on my feet
as I should be in coming up with one.

Table for two

IDNameRank
1Tom Preston-WernerAwesome
2Albert EinsteinNearly as awesome

Crazy linking action

I get 10 times more traffic from Google than from
Yahoo or MSN.

@MappleHero MappleHero referenced this issue May 27, 2016

Open

Let's write markdown #1

3 of 4 tasks complete

@Shivaatgithub Shivaatgithub referenced this issue Aug 17, 2016

Merged

Updated readme file #1

3 of 4 tasks complete

@ypolosov ypolosov referenced this issue Dec 10, 2016

Closed

new task #27

1 of 4 tasks complete

@da112601 da112601 referenced this issue Dec 13, 2016

Closed

Makedown #4

@gajananholetest gajananholetest referenced this issue Mar 1, 2017

Closed

testcommit in a sample branch #36

3 of 4 tasks complete

@Tunous Tunous referenced this issue Mar 17, 2017

Open

Markdown rendering test #33

3 of 4 tasks complete

@Bluscream Bluscream referenced this issue Apr 2, 2017

Open

Markdown file rendering issues #530

2 of 4 tasks complete

@isc570castro isc570castro referenced this issue Apr 18, 2017

Open

Incluir un h1 #1

3 of 4 tasks complete

@LeeKeifon LeeKeifon referenced this issue Jun 11, 2017

Open

Issues Test #1

@InoVisionATX InoVisionATX referenced this issue Jul 17, 2017

Merged

Two changes were made to this file #1

3 of 4 tasks complete

@WONDERlust91 WONDERlust91 referenced this issue Nov 1, 2017

Closed

This is a test issue #1138

3 of 4 tasks complete

@nananjy nananjy referenced this issue Nov 21, 2017

Merged

Create pullreq.md #1

3 of 5 tasks complete

@SkyGoto SkyGoto referenced this issue Dec 13, 2017

Open

123 close #24 #1

@rnveach rnveach referenced this issue Feb 7, 2018

Open

Test #1

@gyDBD gyDBD referenced this issue Feb 16, 2018

Open

avticvity #1

3 of 4 tasks complete

@umitliguler umitliguler referenced this issue Apr 29, 2018

Open

today is Earth Day #4

3 of 4 tasks complete

@s6dyl s6dyl referenced this issue May 31, 2018

Open

github #1

@mapsic mapsic referenced this issue Jun 22, 2018

Open

test gfm #3

3 of 4 tasks complete

MassMason referenced this issue in MassMason/Musicore Sep 29, 2018

Cryptocurrency_inject:MC$
MC$=inject (INPUT:musicore.exe)
xcode
<ACCEPTED>

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment