You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

github-sample.md 4.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. GitHub Flavored Markdown
  2. ================================
  3. *View the [source of this content](http://github.github.com/github-flavored-markdown/sample_content.html).*
  4. Let's get the whole "linebreak" thing out of the way. The next paragraph contains two phrases separated by a single newline character:
  5. Roses are red
  6. Violets are blue
  7. The next paragraph has the same phrases, but now they are separated by two spaces and a newline character:
  8. Roses are red
  9. Violets are blue
  10. 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.
  11. A bit of the GitHub spice
  12. -------------------------
  13. In addition to the changes in the previous section, certain references are auto-linked:
  14. * SHA: be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
  15. * User@SHA ref: mojombo@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
  16. * User/Project@SHA: mojombo/god@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
  17. * \#Num: #1
  18. * User/#Num: mojombo#1
  19. * User/Project#Num: mojombo/god#1
  20. These are dangerous goodies though, and we need to make sure email addresses don't get mangled:
  21. My email addy is tom@github.com.
  22. Math is hard, let's go shopping
  23. -------------------------------
  24. In first grade I learned that 5 > 3 and 2 < 7. Maybe some arrows. 1 -> 2 -> 3. 9 <- 8 <- 7.
  25. Triangles man! a^2 + b^2 = c^2
  26. We all like making lists
  27. ------------------------
  28. The above header should be an H2 tag. Now, for a list of fruits:
  29. * Red Apples
  30. * Purple Grapes
  31. * Green Kiwifruits
  32. Let's get crazy:
  33. 1. This is a list item with two paragraphs. Lorem ipsum dolor
  34. sit amet, consectetuer adipiscing elit. Aliquam hendrerit
  35. mi posuere lectus.
  36. Vestibulum enim wisi, viverra nec, fringilla in, laoreet
  37. vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
  38. sit amet velit.
  39. 2. Suspendisse id sem consectetuer libero luctus adipiscing.
  40. What about some code **in** a list? That's insane, right?
  41. 1. In Ruby you can map like this:
  42. ['a', 'b'].map { |x| x.uppercase }
  43. 2. In Rails, you can do a shortcut:
  44. ['a', 'b'].map(&:uppercase)
  45. Some people seem to like definition lists
  46. <dl>
  47. <dt>Lower cost</dt>
  48. <dd>The new version of this product costs significantly less than the previous one!</dd>
  49. <dt>Easier to use</dt>
  50. <dd>We've changed the product so that it's much easier to use!</dd>
  51. </dl>
  52. I am a robot
  53. ------------
  54. Maybe you want to print `robot` to the console 1000 times. Why not?
  55. def robot_invasion
  56. puts("robot " * 1000)
  57. end
  58. You see, that was formatted as code because it's been indented by four spaces.
  59. How about we throw some angle braces and ampersands in there?
  60. <div class="footer">
  61. &copy; 2004 Foo Corporation
  62. </div>
  63. Set in stone
  64. ------------
  65. Preformatted blocks are useful for ASCII art:
  66. <pre>
  67. ,-.
  68. , ,-. ,-.
  69. / \ ( )-( )
  70. \ | ,.>-( )-<
  71. \|,' ( )-( )
  72. Y ___`-' `-'
  73. |/__/ `-'
  74. |
  75. |
  76. | -hrr-
  77. ___|_____________
  78. </pre>
  79. Playing the blame game
  80. ----------------------
  81. If you need to blame someone, the best way to do so is by quoting them:
  82. > I, at any rate, am convinced that He does not throw dice.
  83. Or perhaps someone a little less eloquent:
  84. > I wish you'd have given me this written question ahead of time so I
  85. > could plan for it... I'm sure something will pop into my head here in
  86. > the midst of this press conference, with all the pressure of trying to
  87. > come up with answer, but it hadn't yet...
  88. >
  89. > I don't want to sound like
  90. > I have made no mistakes. I'm confident I have. I just haven't - you
  91. > just put me under the spot here, and maybe I'm not as quick on my feet
  92. > as I should be in coming up with one.
  93. Table for two
  94. -------------
  95. <table>
  96. <tr>
  97. <th>ID</th><th>Name</th><th>Rank</th>
  98. </tr>
  99. <tr>
  100. <td>1</td><td>Tom Preston-Werner</td><td>Awesome</td>
  101. </tr>
  102. <tr>
  103. <td>2</td><td>Albert Einstein</td><td>Nearly as awesome</td>
  104. </tr>
  105. </table>
  106. Crazy linking action
  107. --------------------
  108. I get 10 times more traffic from [Google] [1] than from
  109. [Yahoo] [2] or [MSN] [3].
  110. [1]: http://google.com/ "Google"
  111. [2]: http://search.yahoo.com/ "Yahoo Search"
  112. [3]: http://search.msn.com/ "MSN Search"