Skip to content

Commit

Permalink
PR preview docs (#105)
Browse files Browse the repository at this point in the history
* PR preview docs

* add link to remind to clean up this code once less evil way is possible

* Update docs/make.jl

* fix typo

* .

* .

* fix docs badge links

* remove debug println

* =highlight readme
  • Loading branch information
oxinabox authored Sep 20, 2019
1 parent c8d01a3 commit 4240832
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

[![Travis](https://travis-ci.org/JuliaDiff/ChainRules.jl.svg?branch=master)](https://travis-ci.org/JuliaDiff/ChainRules.jl)
[![Coveralls](https://coveralls.io/repos/github/JuliaDiff/ChainRules.jl/badge.svg?branch=master)](https://coveralls.io/github/JuliaDiff/ChainRules.jl?branch=master)
[![](https://img.shields.io/badge/docs-latest-blue.svg)](https://JuliaDiff.github.io/ChainRules.jl/latest)

**Docs:*
[![](https://img.shields.io/badge/docs-master-blue.svg)](https://JuliaDiff.github.io/ChainRules.jl/dev)
[![](https://img.shields.io/badge/docs-stable-blue.svg)](https://JuliaDiff.github.io/ChainRules.jl/stable)

The ChainRules package provides a variety of common utilities that can be used by downstream automatic differentiation (AD) tools to define and execute forward-, reverse-, and mixed-mode primitives.

Expand Down
22 changes: 21 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,24 @@ makedocs(
],
)

deploydocs(repo="github.com/JuliaDiff/ChainRules.jl.git")
const repo="github.com/JuliaDiff/ChainRules.jl.git"
const PR = get(ENV, "TRAVIS_PULL_REQUEST", "false")
if PR == "false"
# Normal case, only deply docs if merging to master or release tagged
deploydocs(repo=repo)
else
@info "Deploying review docs for PR #$PR"
# TODO: remove most of this once https://github.com/JuliaDocs/Documenter.jl/issues/1131 is resolved

# Overwrite Documenter's function for generating the versions.js file
foreach(Base.delete_method, methods(Documenter.Writers.HTMLWriter.generate_version_file))
Documenter.Writers.HTMLWriter.generate_version_file(_, _) = nothing
# Overwrite necessary environment variables to trick Documenter to deploy
ENV["TRAVIS_PULL_REQUEST"] = "false"
ENV["TRAVIS_BRANCH"] = "master"

deploydocs(
devurl="preview-PR$(PR)",
repo=repo,
)
end

0 comments on commit 4240832

Please sign in to comment.