diff --git a/CHANGELOG.md b/CHANGELOG.md index 972e104..2af9409 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +0.1.1 / 2013-01-31 +------------------ +* add `genOutput()` method + 0.1.0 / 2013-01-23 ------------------ * Fixed null body bug. diff --git a/README.md b/README.md index ff59f52..88f7076 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Installation Example ------ -A bit unstable. See tests. +Very unstable API. See tests. diff --git a/lib/markdown-page.js b/lib/markdown-page.js index bcb149f..d785d50 100644 --- a/lib/markdown-page.js +++ b/lib/markdown-page.js @@ -21,6 +21,26 @@ }}); } + MarkdownPage.prototype.genOutput = function() { + var data = '\n\n\n' + + data += this.title + '\n' + data += S('=').repeat(this.title.length) + '\n\n' + + data += this.markdown + '\n' + return data; + } + //this is actually just a sync method, but in the future, may call out to other executables or services MarkdownPage.prototype.parse = function(callback) { this.metadata = mde.metadata(this.text, parseMetadata); @@ -40,23 +60,7 @@ } MarkdownPage.prototype.writeFile = function(file, callback) { - var data = '\n\n\n' - - data += this.title + '\n' - data += S('=').repeat(this.title.length) + '\n\n' - - data += this.markdown + '\n' - + var data = this.genOutput() fs.writeFile(file, data, callback) } diff --git a/package.json b/package.json index 51a9711..da3b224 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "markdown-page", - "version": "0.1.0", + "version": "0.1.1", "description": "Parse a markdown article or page.", "homepage": [ ""