Skip to content

Commit

Permalink
README file
Browse files Browse the repository at this point in the history
  • Loading branch information
benmills committed Sep 23, 2011
1 parent 8d0128e commit 9a3e8ab
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 52 deletions.
24 changes: 24 additions & 0 deletions README
@@ -0,0 +1,24 @@
Propaganda
=============================

A well designed project page is a great way to get your open source project publicity. Some examples are [Pow](http://pow.cx/), [Backbone.js](http://documentcloud.github.com/backbone/) and [Vows](http://vowsjs.org/). Propaganda's goal is to make generating these sites easily from a README file written in markdown.

Get it
-----------------------------

You can install propaganda using [npm](http://npmjs.org/)

```bash
npm install propaganda
```

Use it
----------------------------

The basic usage is as easy as it gets.

```bash
propaganda README
```

This will output an `index.html` file in the directory you're currently in. This file should have all the CSS enbeded in the HTML, so all you need to deploy is that file.
61 changes: 9 additions & 52 deletions index.html
Expand Up @@ -368,70 +368,27 @@

<body>
<div class="center" id="main">
<h1>Robotskirt</h1>
<h1>Propaganda</h1>

<p>Robotskirt is a simple node binding for the <a href="https://github.com/tanoku/sundown">sundown</a> markdown parser. It was inspired by the redcarpet gem <a href="https://github.com/blog/832-rolling-out-the-redcarpet">released by github</a>. Eventually robotskirt should mirror the feature set of redcarpet, currently it is lacking flags.</p>
<p>A well designed project page is a great way to get your open source project publicity. Some examples are <a href="http://pow.cx/">Pow</a>, <a href="http://documentcloud.github.com/backbone/">Backbone.js</a> and <a href="http://vowsjs.org/">Vows</a>. Propaganda's goal is to make generating these sites easily from a README file written in markdown.</p>

<h2>Install</h2>
<h2>Get it</h2>

<p>The best way to install robotskirt is by using <a href="https://github.com/isaacs/npm">npm</a>. If you want to install it globally, remember to include the -g flag.</p>
<p>You can install propaganda using <a href="http://npmjs.org/">npm</a></p>

<div class="highlight"><pre>npm install robotskirt
<div class="highlight"><pre>npm install propaganda
</pre></div>


<p>If you would like to compile it, you can use node's WAF wapper. Read more about how node C/C++ addons work in the <a href="http://nodejs.org/docs/v0.4.7/api/addons.html">node docs</a>.</p>
<h2>Use it</h2>

<div class="highlight"><pre>node-waf configure build
</pre></div>


<h2>Usage</h2>

<p>Currently robotskirt has one main function, <code>toHtml</code>, that will take a string of markdown and a callback that will be passed the parsed HTML. </p>

<div class="highlight"><pre><span class="kd">var</span> <span class="nx">markdown</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">'robotskirt'</span><span class="p">);</span>
<span class="nx">markdown</span><span class="p">.</span><span class="nx">toHtml</span><span class="p">(</span><span class="s1">'# Hello World'</span><span class="p">,</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">html</span><span class="p">)</span> <span class="p">{</span>
<span class="nx">sys</span><span class="p">.</span><span class="nx">puts</span><span class="p">(</span><span class="nx">html</span><span class="p">);</span>
<span class="p">});</span>
<span class="c1">// '&lt;h1&gt;Hello World&lt;/h1&gt;\n'</span>
</pre></div>


<p>A common use case might be opening a markdown file and then parsing it into HTML.</p>

<div class="highlight"><pre><span class="kd">var</span> <span class="nx">fs</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">'fs'</span><span class="p">);</span>
<span class="kd">var</span> <span class="nx">sys</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">'sys'</span><span class="p">);</span>
<span class="kd">var</span> <span class="nx">markdown</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">'robotskirt'</span><span class="p">);</span>
<p>The basic usage is as easy as it gets.</p>

<span class="nx">fs</span><span class="p">.</span><span class="nx">readFile</span><span class="p">(</span><span class="s1">'README.mkd'</span><span class="p">,</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">err</span><span class="p">,</span> <span class="nx">data</span><span class="p">)</span> <span class="p">{</span>
<span class="nx">markdown</span><span class="p">.</span><span class="nx">toHtml</span><span class="p">(</span><span class="nx">data</span><span class="p">.</span><span class="nx">toString</span><span class="p">(),</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">html</span><span class="p">)</span> <span class="p">{</span>
<span class="nx">sys</span><span class="p">.</span><span class="nx">puts</span><span class="p">(</span><span class="nx">html</span><span class="p">);</span>
<span class="p">});</span>
<span class="p">});</span>
<div class="highlight"><pre>propaganda README
</pre></div>


<p>If you would like to parse your markdown synchronously you can use the <code>toHtmlSync</code> function.</p>

<div class="highlight"><pre><span class="kd">var</span> <span class="nx">html</span> <span class="o">=</span> <span class="nx">markdown</span><span class="p">.</span><span class="nx">toHtmlSync</span><span class="p">(</span><span class="s2">&quot;*sync!*&quot;</span><span class="p">);</span>
</pre></div>


<h2>Contributors</h2>

<ul>
<li><a href="https://github.com/phinze">Phinze</a> </li>
<li><a href="https://github.com/tbranyen">Tim Branyen</a> </li>
</ul>

<h2>License</h2>

<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the &quot;Software&quot;), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</p>

<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p>

<p>THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
<p>This will output an <code>index.html</code> file in the directory you're currently in. This file should have all the CSS enbeded in the HTML, so all you need to deploy is that file.</p>

</div>
</body>
Expand Down

0 comments on commit 9a3e8ab

Please sign in to comment.