From 31fe3871ebdeb029d6b5cff6d7ef731b4da6f73b Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Fri, 24 Aug 2018 09:15:58 +0200 Subject: [PATCH] Add simple Project.toml file to generate(). --- src/DocumenterTools.jl | 4 ++++ src/Generator.jl | 12 ++++++++++++ test/generate.jl | 1 + 3 files changed, 17 insertions(+) diff --git a/src/DocumenterTools.jl b/src/DocumenterTools.jl index e51f4af..1a1a422 100644 --- a/src/DocumenterTools.jl +++ b/src/DocumenterTools.jl @@ -21,6 +21,7 @@ but can be given with the `name` keyword argument. src/index.md make.jl mkdocs.yml +Project.toml ``` # Arguments @@ -89,6 +90,9 @@ function generate(path::AbstractString; name::Union{AbstractString,Nothing}=noth Generator.savefile(path, "mkdocs.yml") do io write(io, Generator.mkdocs(name)) end + Generator.savefile(path, "Project.toml") do io + write(io, Generator.project()) + end # Create the default documentation source files Generator.savefile(path, "src/index.md") do io diff --git a/src/Generator.jl b/src/Generator.jl index d9c5716..fd818b5 100644 --- a/src/Generator.jl +++ b/src/Generator.jl @@ -57,6 +57,18 @@ function gitignore() """ end +""" +$(SIGNATURES) + +Contents of the default `Project.toml` file. +""" +function project() + """ + [deps] + Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" + """ +end + mkdocs_default(name, value, default) = value == nothing ? "#$name$default" : "$name$value" """ diff --git a/test/generate.jl b/test/generate.jl index 15c83a7..2091767 100644 --- a/test/generate.jl +++ b/test/generate.jl @@ -10,6 +10,7 @@ using Example @test isdir(path) @test isfile(joinpath(path, "mkdocs.yml")) @test isfile(joinpath(path, ".gitignore")) + @test isfile(joinpath(path, "Project.toml")) @test isfile(joinpath(path, "make.jl")) @test isdir(joinpath(path, "src")) @test isfile(joinpath(path, "src", "index.md"))