<NME> Writers.jl
<BEF> """
A module that provides several renderers for `Document` objects. The supported
formats are currently:

  * `:html` -- generates a complete HTML site with navigation and search included.
  * `:latex` -- generates a PDF using LuaLaTeX.

"""
module Writers

import ..Documenter:
    Anchors,
    Builder,
    Documents,
    Expanders,
    Documenter,
    Utilities

import .Utilities: Selectors

#
# Format selector definitions.
#

# Format selector definitions.
#

abstract FormatSelector <: Selectors.AbstractSelector

abstract MarkdownFormat <: FormatSelector
abstract LaTeXFormat    <: FormatSelector
abstract HTMLFormat     <: FormatSelector

Selectors.order(::Type{MarkdownFormat}) = 1.0
Selectors.order(::Type{LaTeXFormat})    = 2.0
Selectors.runner(::Type{LaTeXFormat},    fmt, doc) = LaTeXWriter.render(doc, fmt)
Selectors.runner(::Type{HTMLFormat},     fmt, doc) = HTMLWriter.render(doc, fmt)

"""
Writes a [`Documents.Document`](@ref) object to `.user.build` directory in
the formats specified in the `.user.format` vector.

Adding additional formats requires adding new `Selector` definitions as follows:

```julia
abstract type CustomFormat <: FormatSelector end

Selectors.order(::Type{CustomFormat}) = 4.0 # or a higher number.
Selectors.matcher(::Type{CustomFormat}, fmt, _) = fmt === :custom
Adding additional formats requires adding new `Selector` definitions as follows:

```julia
abstract CustomFormat <: FormatSelector

Selectors.order(::Type{CustomFormat}) = 4.0 # or a higher number.
Selectors.matcher(::Type{CustomFormat}, fmt, _) = fmt === :custom
    # well as their own rendering methods in a separate module.
    for each in doc.user.format
        Selectors.dispatch(FormatSelector, each, doc)
    end
end

include("HTMLWriter.jl")
include("LaTeXWriter.jl")

end

<MSG> Fix deprecations.

More deprecation fixes.

Fix all remaining "_ as an rvalue" warnings.

Fix last remaining deprecation.

Fix REQUIRE.

<DFF> @@ -25,11 +25,11 @@ using Compat
 # Format selector definitions.
 #
 
-abstract FormatSelector <: Selectors.AbstractSelector
+@compat abstract type FormatSelector <: Selectors.AbstractSelector end
 
-abstract MarkdownFormat <: FormatSelector
-abstract LaTeXFormat    <: FormatSelector
-abstract HTMLFormat     <: FormatSelector
+@compat abstract type MarkdownFormat <: FormatSelector end
+@compat abstract type LaTeXFormat    <: FormatSelector end
+@compat abstract type HTMLFormat     <: FormatSelector end
 
 Selectors.order(::Type{MarkdownFormat}) = 1.0
 Selectors.order(::Type{LaTeXFormat})    = 2.0
@@ -50,7 +50,7 @@ the formats specified in the `.user.format` vector.
 Adding additional formats requires adding new `Selector` definitions as follows:
 
 ```julia
-abstract CustomFormat <: FormatSelector
+abstract type CustomFormat <: FormatSelector end
 
 Selectors.order(::Type{CustomFormat}) = 4.0 # or a higher number.
 Selectors.matcher(::Type{CustomFormat}, fmt, _) = fmt === :custom

Fix deprecations.