From 287fd8a82fa5e3fecf145fa210a79369c3ed08ad Mon Sep 17 00:00:00 2001 From: Christof Stocker Date: Fri, 25 Aug 2017 18:11:34 +0200 Subject: [PATCH] setup Documenter.jl --- .travis.yml | 4 +++- docs/.gitignore | 1 + docs/make.jl | 20 +++++++++++++++++++- src/utils.jl | 11 +++++++++-- 4 files changed, 32 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index ee597e1..23f9908 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,7 @@ git: ## (tests will run but not make your overall status red) matrix: allow_failures: - - julia: nightly + - julia: nightly ## uncomment and modify the following lines to manually install system packages #addons: @@ -31,5 +31,7 @@ matrix: after_success: # push coverage results to Coveralls - julia -e 'cd(Pkg.dir("ReferenceTests")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())' + - julia -e 'Pkg.add("Documenter")' + - julia -e 'cd(Pkg.dir("ReferenceTests")); include(joinpath("docs", "make.jl"))' # push coverage results to Codecov # - julia -e 'cd(Pkg.dir("ReferenceTests")); Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())' diff --git a/docs/.gitignore b/docs/.gitignore index 567609b..a303fff 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -1 +1,2 @@ build/ +site/ diff --git a/docs/make.jl b/docs/make.jl index 4b46a96..c80869b 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,3 +1,21 @@ using Documenter, ReferenceTests -makedocs() +makedocs( + modules = [ReferenceTests], + clean = false, + format = :html, + sitename = "ReferenceTests.jl", + authors = "Christof Stocker", + linkcheck = !("skiplinks" in ARGS), + pages = Any[ + "Home" => "index.md" + ], + html_prettyurls = !("local" in ARGS), +) + +deploydocs( + repo = "github.com/Evizero/ReferenceTests.jl.git", + target = "build", + deps = nothing, + make = nothing, +) diff --git a/src/utils.jl b/src/utils.jl index 017baad..699e8fa 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -12,6 +12,8 @@ common example of such would be a custom `Base.show` method. # Examples ```jldoctest +julia> using ReferenceTests + julia> @io2str print(::IO, "Hello World") "Hello World" @@ -64,8 +66,13 @@ Make sure that `ex` is evaluated while `Base.have_color` is set to `true`. The original value of `Base.have_color` will be restored afterwards. -This macro is particularily useful for CI, where `julia` is -executed without the `--color=yes` argument by default. +This macro is particularily useful for CI, where it is not +unusual that `julia` is executed without the `--color=yes` +argument by default. + +```julia +@withcolor print_with_color(:green, "foo") +``` """ macro withcolor(expr) :(withcolor(()->$(esc(expr))))