Deploy pages from branches

When translating the docs of a repo, it is natural to write codes in different branch. Documenter.jl provides two ways to deploy docs from different sources: Hosting Documentation · Documenter.jl

  1. Deploy by version number

  2. Deploy from devbranch

Below is my code for docs of binarybuilder.

# make.jl
deploydocs(
    repo = "github.com/RexWzh/BinaryBuilder.jl.git",
    devurl = "dev",
    devbranch = "zh_CN",
    versions = ["dev" => "dev", "stable" => "v^"], # use git tag to track other language(dumb way)
    # forcepush = true,
)

My question is

Q: Can I specify more branches?

Then I can

  • use en to track the original branch
  • use zh to track the translated version
  • use mix to store the mixed-language docs

Also,

Q2: Is there someway to overwrite the gh-pages branch rather than merge?

I’ve tried the keyword forcepush but old folders are not removed.

Thanks for your time!

Q: Can I specify more branches?

I think your best option here is to set devbranch and devurl dynamically, by checking the relevant CI variables yourself in make.jl. Documenter itself doesn’t have any support for multiple dev branches.

Although if you are going for translations, maybe you can dynamically set dirname? That way you could deploy something like /en/dev/, /en/v0.1.0, /zh_CN/dev/, /zh_CN/v0.1.0?

Q2: Is there someway to overwrite the gh-pages branch rather than merge?

So, the short answer is no. Reason, of course, being that that would remove your versioned docs, which you generally don’t want to happen.

1 Like