only creates the feed
authorJean-Philippe Orsini <orsinije@fr.ibm.com>
Wed, 29 Jun 2016 15:49:32 +0000 (17:49 +0200)
committerJean-Philippe Orsini <orsinije@fr.ibm.com>
Wed, 29 Jun 2016 15:49:32 +0000 (17:49 +0200)
asciidoctor/asciidoctorfeed.props
asciidoctor/src/main/java/Main.java

index b43f4af..d227ba4 100644 (file)
@@ -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
index 228935d..cfb5591 100644 (file)
@@ -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