Skip to content

Commit

Permalink
Readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
rstacruz committed Feb 24, 2014
1 parent 239fe3a commit 5204819
Showing 1 changed file with 70 additions and 2 deletions.
72 changes: 70 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,74 @@ Tables have a class `.table`.
Differences from regular markdown
---------------------------------

Styledown works like Markdown: it merely transforms a document into HTML. In
fact, any and all Markdown documents will work as expected in Styledown.

With a few key extensions:

### Example blocks

Example blocks are regular code blocks that begin with `@example`. They're
rendered into HTML + source code blocks.

#### Input

``` markdown
Consider this example:

@example
<a class="button">Button</a>
<a class="button primary">Button</a>
```

#### Output

``` html
<p>Consider this example:</p>

<div class="sg-example">
<!-- Actual HTML code is rendered here in `.sg-canvas` -->
<div class="sg-canvas">
<a class="button">Button</a>
<a class="button primary">Button</a>
</div>

<!-- Syntax-highlighted source code here in `.sg-code` -->
<pre class="sg-code">
&lt;a class="button"&gt;...
</pre>
</div>
```

### Syntax highlighting

Syntax highlighting comes for free, without any client-side code. Simply
surround your code in a code fence, and it will be highlighted via
[highlight.js].

#### Input

See this code:

``` javascript
$(function() {
alert("Hello");
});
```

#### Output

``` html
<p>See this code:</p>

<pre class="sg-lang-javascript">
$(<span class='hljs-function'>function</span>() {
alert(<span class='hljs-string'>"hello"</span>);
</pre>
```

### Also

* Sections
* blocks
* Syntax highlighting
Expand All @@ -47,7 +115,7 @@ Differences from regular markdown
Installation
------------

``` sh
``` bash
$ npm install -g styledown
```

Expand All @@ -56,7 +124,7 @@ Usage

### Command line

``` sh
``` bash
$ styledown < Styles.md > index.html
```

Expand Down

0 comments on commit 5204819

Please sign in to comment.