From: Jean-Philippe Orsini Date: Wed, 29 Jun 2016 15:49:32 +0000 (+0200) Subject: only creates the feed X-Git-Url: http://git.wpitchoune.net/gitweb/?p=www.git;a=commitdiff_plain;h=f28773f87995602e5471e92a3324f3de65a48e5e only creates the feed --- diff --git a/asciidoctor/asciidoctorfeed.props b/asciidoctor/asciidoctorfeed.props index b43f4af..d227ba4 100644 --- a/asciidoctor/asciidoctorfeed.props +++ b/asciidoctor/asciidoctorfeed.props @@ -1,3 +1,3 @@ feed.title=The feed title feed.description=The description of the feed -feed.link=http://wpitchoune.net/news/rss_2.0.xml \ No newline at end of file +feed.link=http://wpitchoune.net/news/feed.xml \ No newline at end of file diff --git a/asciidoctor/src/main/java/Main.java b/asciidoctor/src/main/java/Main.java index 228935d..cfb5591 100644 --- a/asciidoctor/src/main/java/Main.java +++ b/asciidoctor/src/main/java/Main.java @@ -4,6 +4,7 @@ import java.util.*; import org.asciidoctor.Asciidoctor; import org.asciidoctor.Asciidoctor.Factory; import org.asciidoctor.Options; +import org.asciidoctor.ast.Document; import org.asciidoctor.ast.DocumentHeader; import com.rometools.rome.feed.synd.*; @@ -60,18 +61,11 @@ public class Main { for (File adoc: adocs) { if (!adoc.getName().endsWith(".adoc")) - continue; - + continue; sw = new StringWriter(); html = toHTMLFile(outDir, adoc); - System.out.println(adoc + " => " + html); - - opts = new Options(); - opts.setToFile(html.getAbsolutePath()); - - asciidoctor.renderFile(adoc, opts); - + h = asciidoctor.readDocumentHeader(adoc); asciidoctor.convert(new FileReader(adoc), sw, Collections.emptyMap()); @@ -92,6 +86,6 @@ public class Main { feed.setFeedType("rss_2.0"); SyndFeedOutput output = new SyndFeedOutput(); - System.out.println("" + output.outputString(feed)); + output.output(feed, new File(outDir, "feed.xml")); } } \ No newline at end of file