diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b3b7b0..99080d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ - Add id to headers to allow anchor linking - Make relative link work with anchors - Add option to render an anchor link automatically next to headers +- Only copy the static files that changed, not the whole directory in `gutenberg serve` +- Use summary if available in RSS feed +- Add tables and footnotes support in markdown ## 0.0.3 (2017-04-05) - Add some colours in console diff --git a/src/markdown.rs b/src/markdown.rs index f432179..b02940d 100644 --- a/src/markdown.rs +++ b/src/markdown.rs @@ -2,7 +2,7 @@ use std::borrow::Cow::Owned; use std::collections::HashMap; use pulldown_cmark as cmark; -use self::cmark::{Parser, Event, Tag}; +use self::cmark::{Parser, Event, Tag, Options, OPTION_ENABLE_TABLES, OPTION_ENABLE_FOOTNOTES}; use regex::Regex; use slug::slugify; use syntect::dumps::from_binary; @@ -138,8 +138,12 @@ pub fn markdown_to_html(content: &str, permalinks: &HashMap, ter find_anchor(anchors, name, level + 1) } + let mut opts = Options::empty(); + opts.insert(OPTION_ENABLE_TABLES); + opts.insert(OPTION_ENABLE_FOOTNOTES); + { - let parser = Parser::new(content).map(|event| match event { + let parser = Parser::new_ext(content, opts).map(|event| match event { Event::Text(text) => { // if we are in the middle of a code block if let Some(ref mut highlighter) = highlighter { diff --git a/src/templates/rss.xml b/src/templates/rss.xml index bc787d8..ace8dbf 100644 --- a/src/templates/rss.xml +++ b/src/templates/rss.xml @@ -13,7 +13,7 @@ {{ page.date | date(format="%a, %d %b %Y %H:%M:%S %z") }} {{ page.permalink }} {{ page.permalink }} - {{ page.content }} + {% if page.summary %}{{ page.summary }}{% else %}{{ page.content }}{% endif %} {% endfor %}