<NME> Writers.jl
<BEF> ADDFILE
<MSG> Merge pull request #116 from mortenpi/split-writers

Split Writers.jl into multiple files
<DFF> @@ -0,0 +1,43 @@
+"""
+Provides a rendering function, [`render`](@ref), for writing each supported
+[`Formats.Format`](@ref) to file.
+
+Note that currently `Formats.Markdown` is the **only** supported format.
+
+"""
+module Writers
+
+import ..Documenter:
+    Anchors,
+    Builder,
+    Documents,
+    Expanders,
+    Formats,
+    Documenter,
+    Utilities
+
+using Compat
+
+# Driver method for document rendering.
+# -------------------------------------
+
+"""
+Writes a [`Documents.Document`](@ref) object to `build` directory in specified file format.
+"""
+function render(doc::Documents.Document)
+    mime = Formats.mimetype(doc.user.format)
+    for (src, page) in doc.internal.pages
+        open(Formats.extension(doc.user.format, page.build), "w") do io
+            for elem in page.elements
+                node = page.mapping[elem]
+                render(io, mime, node, page, doc)
+            end
+        end
+    end
+end
+
+include("MarkdownWriter.jl")
+include("HTMLWriter.jl")
+include("LaTeXWriter.jl")
+
+end

Merge pull request #116 from mortenpi/split-writers