0.4.0 • Published 11 years ago

markx v0.4.0

Weekly downloads
122
License
-
Repository
github
Last release
11 years ago

markx

markx converts markdown with code snippets into html. It also has options to pass in a template file and data. It is great for building github pages and creating blog posts from markdown files.

##Installation

Inside a project:

npm install markx --save

Globally:

npm install markx -g

##CLI Usage

markx input.md [opts]

Options:

Options:
  -t, --template   HTML template file                                        
  -l, --highlight  Enable or disable syntax highlighting 
  -d, --data       JSON|YAML data file that gets passed to input and template
  -h, --help       Show help info  

##API Usage

var markx = require('markx');

markx({
	input: 'input.md', //can be either a filepath or a source string
	template: 'layout.html', //can either be filepath or source string
	highlight: true, //parse code snippets for syntax highlighters, default: true
	data: {} //data that gets passed into template
}, function(err, html) {
});

##Example

###Command

markx.js readme-example.md --template readme-example-template.html --data readme-example.json 

###Markdown

###Template

<!DOCTYPE html>
<html lang="en">
  <meta charset="utf-8" />
  <head>
    <title><%= pageTitle %></title>
  </head>
  <body>
    <header>Logo</header>
    <section>
      <%- body %>
    </section>
    <footer>Footer</footer>
  </body>
</html>

###Data

{
  "pageTitle": "This is the page title"
}

###Output

<!DOCTYPE html>
<html lang="en">
  <meta charset="utf-8" />
  <head>
    <title>This is the page title</title>
  </head>
  <body>
    <header>Logo</header>
    <section>
      <h1>This is a heading</h1>
<p>This is a paragraph

</p>
<pre><code class="lang-javascript"><span class="keyword">var</span> a = <span class="string">'123'</span>;
<span class="keyword">var</span> f = <span class="keyword">function</span>() {
    <span class="keyword">return</span> <span class="number">4</span>;
}</code></pre>

    </section>
    <footer>Footer</footer>
  </body>
</html>

##History

View History

##Development and Tests

npm install
./node_modules/.bin/grunt
0.4.0

11 years ago

0.3.4

12 years ago

0.3.3

12 years ago

0.3.2

12 years ago

0.3.1

12 years ago

0.3.0

12 years ago

0.2.1

13 years ago

0.2.0

13 years ago

0.1.0alpha5

13 years ago

0.1.0alpha4

13 years ago

0.1.0alpha3

13 years ago

0.1.0alpha2

13 years ago

0.1.00alpha1

13 years ago

0.0.17

13 years ago

0.0.16

13 years ago

0.0.15

13 years ago

0.0.14

13 years ago

0.0.13

13 years ago

0.0.12

13 years ago

0.0.11

13 years ago

0.0.10

13 years ago

0.0.9

13 years ago

0.0.8

13 years ago

0.0.7

13 years ago

0.0.6

13 years ago

0.0.5

13 years ago

0.0.4

13 years ago

0.0.3

13 years ago

0.0.2

13 years ago

0.0.1

13 years ago