motyl

Opinionated blog-aware static site generator written in Ruby
Log | Files | Refs | README | LICENSE

commit 185cbaa73e9e286fdf42415038b5fa4043586eed
parent 1d4a197948fdb4481d4f3ececaa9ee90366a674e
Author: Frederic Cambus <fred@statdns.com>
Date:   Sun,  9 Oct 2016 23:57:03 +0200

Switch to 'lunamark' for rendering Markdown, as it's faster and more flexible

Diffstat:
MREADME.md | 4++--
Msrc/motyl.lua | 8+++++---
2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/README.md b/README.md @@ -23,16 +23,16 @@ Motyl requires Lua 5.1+ and Make. Motyl requires the following Lua modules : - LuaFileSystem +- lunamark - lustache - lyaml -- markdown Installing via LuaRocks : luarocks install luafilesystem + luarocks install lunamark luarocks install lustache luarocks install lyaml - luarocks install markdown Alternatively, those modules can be installed directly using binary packages. diff --git a/src/motyl.lua b/src/motyl.lua @@ -7,7 +7,7 @@ # http://www.cambus.net/motyl/ # # # # Created: 2016-02-16 # -# Last Updated: 2016-10-03 # +# Last Updated: 2016-10-09 # # # # Motyl is released under the BSD 2-Clause license. # # See LICENSE file for details. # @@ -17,8 +17,8 @@ local lfs = require "lfs" local lyaml = require "lyaml" +local lunamark = require "lunamark" local lustache = require "lustache" -local markdown = require "markdown" -- Read data from file local function readFile(path) @@ -45,7 +45,9 @@ end -- Load and process Markdown file local function loadMD(path) - return markdown(readFile(path)) + local writer = lunamark.writer.html.new() + local parse = lunamark.reader.markdown.new(writer) + return parse(readFile(path)) end -- Render a mustache template