Skip to content

Commit

Permalink
Remove Documenter.generate() and Travis.genkeys()
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikekre committed Aug 15, 2018
1 parent 2cb0434 commit 8b82a37
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 227 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ notifications:
email: false

after_success:
- julia -e 'cd(Pkg.dir("Documenter", "test")); include("coverage.jl")'
- julia -e 'cd("test"); include("coverage.jl")'
3 changes: 0 additions & 3 deletions docs/src/lib/public.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ Documenter
makedocs
hide
deploydocs
Documenter.generate
Travis
Travis.genkeys
Deps
Deps.pip
```
14 changes: 11 additions & 3 deletions docs/src/man/hosting.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,18 @@ Deploy keys provide push access to a *single* repository, to allow secure deploy
They are `which`, `git`, and `ssh-keygen`. Make sure these are installed before you
begin this section.

Open a Julia REPL and import [`Documenter`](@ref).
SSH keys can be generated with the `Travis.genkeys` from the `DocumenterTools.jl` package.
DocumenterTools can be added using the Julia package manager. From the REPL, type `]`
to enter the Pkg REPL mode and run

```
pkg> add DocumenterTools
```

DocumenterTools can now be loaded as

```jlcon
julia> using Documenter
julia> using DocumenterTools
```

Then call the [`Travis.genkeys`](@ref) function as follows:
Expand Down Expand Up @@ -119,7 +127,7 @@ Add the following at the end of the file:
```julia
deploydocs(
repo = "github.com/USER_NAME/PACKAGE_NAME.jl.git",
julia = "0.6"
julia = "1.0"
)
```

Expand Down
101 changes: 10 additions & 91 deletions src/Documenter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ using DocStringExtensions
import Base64: base64decode
import Pkg

# Deprecations
# ------------
Base.@deprecate_moved generate "DocumenterTools" false
module Travis
Base.@deprecate_moved genkeys "DocumenterTools" false
end
export Travis

# Submodules
# ----------

Expand All @@ -34,15 +42,14 @@ include("DocChecks.jl")
include("Writers/Writers.jl")
include("Deps.jl")
include("Generator.jl")
include("Travis.jl")

import .Utilities: Selectors


# User Interface.
# ---------------

export Travis, Deps, makedocs, deploydocs, hide
export Deps, makedocs, deploydocs, hide

"""
makedocs(
Expand Down Expand Up @@ -591,92 +598,4 @@ function getenv(regex::Regex)
error("could not find key/iv pair.")
end

"""
$(SIGNATURES)
Creates a documentation stub for a package called `pkgname`. The location of
the documentation is assumed to be `<package directory>/docs`, but this can
be overriden with the keyword argument `dir`.
It creates the following files
```
docs/
.gitignore
src/index.md
make.jl
mkdocs.yml
```
# Arguments
**`pkgname`** is the name of the package (without `.jl`). It is used to
determine the location of the documentation if `dir` is not provided.
# Keywords
**`dir`** defines the directory where the documentation will be generated.
It defaults to `<package directory>/docs`. The directory must not exist.
# Examples
```jlcon
julia> using Documenter
julia> Documenter.generate("MyPackageName")
[ ... output ... ]
```
"""
function generate(pkgname::AbstractString; dir=nothing)
# TODO:
# - set up deployment to `gh-pages`
# - fetch url and username automatically (e.g from git remote.origin.url)

# Check the validity of the package name
if length(pkgname) == 0
error("Package name can not be an empty string.")
end
# Determine the root directory where we wish to generate the docs and
# check that it is a valid directory.
docroot = if dir === nothing
pkgdir = Pkg.dir(pkgname)
if !isdir(pkgdir)
error("Unable to find package $(pkgname).jl at $(pkgdir).")
end
joinpath(pkgdir, "docs")
else
dir
end

if ispath(docroot)
error("Directory $(docroot) already exists.")
end

# deploy the stub
try
@info("Deploying documentation to $(docroot)")
mkdir(docroot)

# create the root doc files
Generator.savefile(docroot, ".gitignore") do io
write(io, Generator.gitignore())
end
Generator.savefile(docroot, "make.jl") do io
write(io, Generator.make(pkgname))
end
Generator.savefile(docroot, "mkdocs.yml") do io
write(io, Generator.mkdocs(pkgname))
end

# Create the default documentation source files
Generator.savefile(docroot, "src/index.md") do io
write(io, Generator.index(pkgname))
end
catch
rm(docroot, recursive=true)
rethrow()
end
nothing
end

end
end # module
96 changes: 0 additions & 96 deletions src/Travis.jl

This file was deleted.

30 changes: 0 additions & 30 deletions test/generate.jl

This file was deleted.

3 changes: 0 additions & 3 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ println("="^50)

# A simple build outside of a Git repository
include("nongit/tests.jl")

# Tests for Documenter.generate().
include("generate.jl")
end

# Additional tests
Expand Down

0 comments on commit 8b82a37

Please sign in to comment.