only creates the feed
[www.git] / asciidoctor / src / main / java / Main.java
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