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
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.*;
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());
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