Skip to content

Commit

Permalink
fix some stuff up
Browse files Browse the repository at this point in the history
  • Loading branch information
mojombo committed Apr 10, 2009
1 parent e0d601e commit 16c999e
Show file tree
Hide file tree
Showing 7 changed files with 380 additions and 21 deletions.
26 changes: 18 additions & 8 deletions _site/index.html
Expand Up @@ -37,7 +37,7 @@ <h1>GitHub Flavored Markdown</h1>
<p>If you prefer to learn by example, see the following source and result:</p>

<ul>
<li><a href="http://tom.preston-werner.com/github-flavored-markdown/sample_content.gfm">Source</a></li>
<li><a href="sample_content.html">Source</a></li>
<li><a href="http://github.com/mojombo/github-flavored-markdown/issues/#issue/1">Result</a></li>
</ul>

Expand All @@ -61,7 +61,7 @@ <h3>Newlines</h3>

<h3>Multiple underscores in words</h3>

<p>It is not reasonable to italicize just <em>part</em> of a word, especially when you're dealing with code and names often appear with multiple underscores. Therefor, GFM ignores multiple underscore in words.</p>
<p>It is not reasonable to italicize just <em>part</em> of a word, especially when you're dealing with code and names often appear with multiple underscores. Therefore, GFM ignores multiple underscores in words.</p>

<pre><code>perform_complicated_task
do_this_and_do_that_and_another_thing
Expand All @@ -76,13 +76,23 @@ <h2>A bit of the GitHub spice</h2>

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

<pre><code>* SHA: be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
* User@SHA ref: mojombo@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
* User/Project@SHA: mojombo/god@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
* \#Num: #1
* User/#Num: mojombo#1
* User/Project#Num: mojombo/god#1
</code></pre>

<p>becomes</p>

<ul>
<li>SHA: be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2</li>
<li>User@SHA ref: mojombo@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2</li>
<li>User/Project@SHA: mojombo/god@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2</li>
<li>#Num: #1</li>
<li>User/#Num: mojombo#1</li>
<li>User/Project#Num: mojombo/god#1</li>
<li>SHA: <a href="/mojombo/github-flavored-markdown/commit/be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2">be6a8cc</a></li>
<li>User@SHA ref: <a href="/mojombo/github-flavored-markdown/commit/be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2">mojombo@be6a8cc</a></li>
<li>User/Project@SHA: <a href="/mojombo/god/commit/be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2">mojombo/god@be6a8cc</a></li>
<li>#Num: <a href="/mojombo/github-flavored-markdown/issues/#issue/1" class="internal">#1</a></li>
<li>User/#Num: <a href="/mojombo/github-flavored-markdown/issues/#issue/1">mojombo#1</a></li>
<li>User/Project#Num: <a href="/mojombo/god/issues/#issue/1">mojombo/god#1</a></li>
</ul>


Expand Down
169 changes: 169 additions & 0 deletions _site/sample_content.html
@@ -0,0 +1,169 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Example Source</title>
</head>
<body>
<pre>GitHub Flavored Markdown
================================

*View the [source of this content](http://tom.preston-werner.com/github-flavored-markdown/sample_content.html).*

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:

* SHA: be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
* User@SHA ref: mojombo@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
* User/Project@SHA: mojombo/god@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
* \#Num: #1
* User/#Num: mojombo#1
* User/Project#Num: mojombo/god#1

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 &gt; 3 and 2 &lt; 7. Maybe some arrows. 1 -&gt; 2 -&gt; 3. 9 &lt;- 8 &lt;- 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

&lt;dl&gt;
&lt;dt&gt;Lower cost&lt;/dt&gt;
&lt;dd&gt;The new version of this product costs significantly less than the previous one!&lt;/dd&gt;
&lt;dt&gt;Easier to use&lt;/dt&gt;
&lt;dd&gt;We've changed the product so that it's much easier to use!&lt;/dd&gt;
&lt;/dl&gt;

I am a robot
------------

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

def robot_invasion
puts("robot " * 1000)

This comment has been minimized.

Copy link
@JohnLuck77

JohnLuck77 Jun 8, 2020

00

This comment has been minimized.

Copy link
@DanDar3nascie

DanDar3nascie Jul 3, 2020

  • 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?

&lt;div class="footer"&gt;
&amp;copy; 2004 Foo Corporation
&lt;/div&gt;

Set in stone
------------

Preformatted blocks are useful for ASCII art:

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

Playing the blame game
----------------------

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

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

Or perhaps someone a little less eloquent:

&gt; I wish you'd have given me this written question ahead of time so I
&gt; could plan for it... I'm sure something will pop into my head here in
&gt; the midst of this press conference, with all the pressure of trying to
&gt; come up with answer, but it hadn't yet...
&gt;
&gt; I don't want to sound like
&gt; I have made no mistakes. I'm confident I have. I just haven't - you
&gt; just put me under the spot here, and maybe I'm not as quick on my feet
&gt; as I should be in coming up with one.

Table for two
-------------

&lt;table&gt;
&lt;tr&gt;
&lt;th&gt;ID&lt;/th&gt;&lt;th&gt;Name&lt;/th&gt;&lt;th&gt;Rank&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;&lt;td&gt;Tom Preston-Werner&lt;/td&gt;&lt;td&gt;Awesome&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;&lt;td&gt;Albert Einstein&lt;/td&gt;&lt;td&gt;Nearly as awesome&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

Crazy linking action
--------------------

I get 10 times more traffic from [Google] [1] than from
[Yahoo] [2] or [MSN] [3].

[1]: http://google.com/ "Google"
[2]: http://search.yahoo.com/ "Yahoo Search"
[3]: http://search.msn.com/ "MSN Search"</pre>
</body>
</html>
2 changes: 1 addition & 1 deletion sample_content.gfm → _site/sample_content.md
@@ -1,7 +1,7 @@
GitHub Flavored Markdown
================================

*View the [source of this content]().*
*View the [source of this content](http://tom.preston-werner.com/github-flavored-markdown/sample_content.html).*

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

Expand Down
4 changes: 2 additions & 2 deletions _site/stylesheets/screen.css
@@ -1,7 +1,7 @@
.site {
width: 60em;
width: 45em;
}

#content.site {
width: 59em;
width: 44em;
}
27 changes: 19 additions & 8 deletions index.md
Expand Up @@ -13,7 +13,7 @@ If you're not already familiar with Markdown, you should spend 15 minutes and go

If you prefer to learn by example, see the following source and result:

* [Source](http://tom.preston-werner.com/github-flavored-markdown/sample_content.gfm)
* [Source](sample_content.html)
* [Result](http://github.com/mojombo/github-flavored-markdown/issues/#issue/1)

Differences from traditional Markdown
Expand All @@ -35,7 +35,7 @@ Violets are blue

### Multiple underscores in words

It is not reasonable to italicize just _part_ of a word, especially when you're dealing with code and names often appear with multiple underscores. Therefor, GFM ignores multiple underscore in words.
It is not reasonable to italicize just _part_ of a word, especially when you're dealing with code and names often appear with multiple underscores. Therefore, GFM ignores multiple underscores in words.

perform_complicated_task
do_this_and_do_that_and_another_thing
Expand All @@ -50,9 +50,20 @@ A bit of the GitHub spice

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

* SHA: be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
* User@SHA ref: mojombo@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
* User/Project@SHA: mojombo/god@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
* \#Num: #1
* User/#Num: mojombo#1
* User/Project#Num: mojombo/god#1
* SHA: be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
* User@SHA ref: mojombo@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
* User/Project@SHA: mojombo/god@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
* \#Num: #1
* User/#Num: mojombo#1
* User/Project#Num: mojombo/god#1

becomes

<ul>
<li>SHA: <a href="/mojombo/github-flavored-markdown/commit/be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2">be6a8cc</a></li>
<li>User@SHA ref: <a href="/mojombo/github-flavored-markdown/commit/be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2">mojombo@be6a8cc</a></li>
<li>User/Project@SHA: <a href="/mojombo/god/commit/be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2">mojombo/god@be6a8cc</a></li>
<li>#Num: <a href="/mojombo/github-flavored-markdown/issues/#issue/1" class="internal">#1</a></li>
<li>User/#Num: <a href="/mojombo/github-flavored-markdown/issues/#issue/1">mojombo#1</a></li>
<li>User/Project#Num: <a href="/mojombo/god/issues/#issue/1">mojombo/god#1</a></li>
</ul>

2 comments on commit 16c999e

@ml3344
Copy link

@ml3344 ml3344 commented on 16c999e Oct 7, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • a task list item
  • list syntax required
  • normal formatting, @mentions, #1234 refs
  • incomplete
  • completed

@Minhnghia04484
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


Please sign in to comment.