title: Grunt pre-compile inline markdown
body: <p>I've been on the hunt for a method of pre-compiling inline markdown with grunt. I chose markdown because, I'm dealing with lots of plain text with simple formatting, but I would not be completely opposed to JSON (or similar).</p>
  
  <p>Here is an example: what I'm looking for:</p>
  
  <pre><code>&lt;body&gt;
  
      &lt;div id="content"&gt;
          &lt;div class="text"&gt;
              ## Markdown Headline
              markdown Paragraph 1
          &lt;/div&gt;
          &lt;div class="text"&gt;
              ## Markdown Headline
              Markdown Paragraph 2
          &lt;/div&gt;
      &lt;/div&gt;
  
  &lt;/body&gt;
  </code></pre>
  
  <p>Even better would be something like:</p>
  
  <pre><code>&lt;body&gt;
  
      &lt;div id="content"&gt;
          &lt;div class="text"&gt;
              {include: /path/to/markdown_file_1.md:block_1}
          &lt;/div&gt;
          &lt;div class="text"&gt;
              {include: /path/to/markdown_file_1.md:block_2}
          &lt;/div&gt;
      &lt;/div&gt;
  
  &lt;/body&gt;
  </code></pre>
  
  <p>I'm not looking to create templates from markdown, merely a way of including text, which is then rendered/compiled into html using "grunt build" (or in the case of yeoman, also for "grunt server").</p>
  
  <p>Meaning the above example would compile to something such as...</p>
  
  <pre><code>&lt;body&gt;
  
      &lt;div id="content"&gt;
          &lt;div class="text"&gt;
              &lt;h1&gt;Markdown Headline&lt;/h1&gt;&lt;/p&gt;
              Lorem ipsum &lt;b&gt;dolar&lt;/b&gt; set &lt;a href="http://amet.com/"&gt;amet&lt;/a&gt;.
          &lt;/div&gt;
          &lt;div class="text"&gt;
              &lt;h1&gt;Markdown Headline&lt;/h1&gt;&lt;/p&gt;
              Integer &lt;i&gt;posuere erat a ante&lt;/i&gt; venenatis dapibus posuere velit aliquet.
          &lt;/div&gt;
      &lt;/div&gt;
  
  &lt;/body&gt;
  </code></pre>
  
  <p>Each html page, will be different thus making templates not possible and since I am receiving copy (as markdown files), I thought it would be great if I could "include" markdown in the html and have grunt compile it for me.</p>
  
  <p>I've looked across stackoverflow for a solution and found nothing (perhaps, I'm searching wrong)</p>
  
  <p>I've also looked into the following:</p>
  
  <ul>
  <li><p><a href="http://github.com/evilstreak/markdown-js" rel="nofollow">github.com/evilstreak/markdown-js</a> - close, but seems to work "on-the-fly" which for my purposes is unncessary.</p></li>
  <li><p><a href="http://github.com/chjj/marked" rel="nofollow">github.com/chjj/marked</a> - same as above</p></li>
  <li><p><a href="http://github.com/treasonx/grunt-markdown" rel="nofollow">github.com/treasonx/grunt-markdown</a> - appears to only compile <code>markdown</code> files into <code>html</code> files</p></li>
  <li><p><a href="http://assemble.io/docs/Markdown.html" rel="nofollow">assemble.io/docs/Markdown.html</a> - I was really hopeful for assemble, but could not figure out how to implement it</p></li>
  <li><p><a href="http://github.com/wycats/handlebars.js" rel="nofollow">github.com/wycats/handlebars.js</a> - Handlebars are exactly how I would love to be able to include <code>markdown</code>, but how can I read <code>handlebars</code> within an HTML file and have it rendered (pre-compiled) with grunt.</p></li>
  </ul>