Deploy Documenter docs locally

documentation
documenter
git

#1

As I understand it, the function deploydocs in Documenter.jl is designed to work with travis only. I have a private repository I would like to generate documentation for, and would like a deploydocs function that could deploy my generated documentation when run on my local machine. Anyone having accomplished this before and have some insight/experiences on a nice approach?


#2

If you’re using MkDocs (the default, instead of native HTML), you can simply run the following in the docs directory:

julia make.jl
mkdocs serve

This is assuming you have MkDocs installed, as well as any Python packages you’ve listed in your deploydocs call. Actually, you can keep the server running and only run julia make.jl, as the server will detect the changes and auto-reload and refresh your browser.

If you’re using native HTML, simply open the generated HTML files.


#3

Thanks! That seems to be working well.
I would also be interested in automatic deployment to a git branch, e.g., gh-pages as deploydocs does.


#4

I created a short julia script to set the environment variables the way travis would set them. Need to keep this outside the repository since it contains the deploy key.

ENV["TRAVIS_REPO_SLUG"] = "github.com/cstook/LTspice.jl.git"
ENV["TRAVIS_PULL_REQUEST"] = "false"
ENV["TRAVIS_OS_NAME"] = "linux"
ENV["TRAVIS_JULIA_VERSION"] = "0.6"
ENV["TRAVIS_TAG"] = "master"
ENV["DOCUMENTER_KEY"] = key not shown

Then modify the make.jl file to include this script is it exists.

if "deploy" in ARGS
  fake_travis = "C:/Users/Chris/fake_travis_LTspice.jl"
  if isfile(fake_travis)
    include(fake_travis)
  end
  deploydocs(
    repo = "github.com/cstook/LTspice.jl.git",
    target = "site",
    branch = "gh-pages",
    latest = "master",
    osname = "linux",
    julia  = "0.6",
    deps = nothing,
    make = nothing,
  )
end

Documenter.jl travis.genkeys "which which" error on Windows?
#5

Haven’t tried this, but in theory mkdocs gh-deploy should work.