LoginSignup
4
4

More than 5 years have passed since last update.

Generate gh-pages with sphinx

Posted at

Generate gh-pages

$ cd repo
$ git checkout --orphan gh-pages
$ git rm -rf .
$ echo "First commit" > index.html
$ git add .
$ git commit -m "Just to create the branch."
$ git push origin gh-pages

Run sphinx-quickstart

$ git checkout master
$ sphinx-quickstart # in second option you should say yes

Add build target

Add below in Makefile.

GH_PAGES_SOURCES = source code wiki Makefile

...

gh-pages:
    git checkout gh-pages
    rm -rf build _sources _static
    git checkout master $(GH_PAGES_SOURCES)
    git reset HEAD
    make html
    mv -fv build/html/* ./
    rm -rf $(GH_PAGES_SOURCES) build
    git add -A
    git ci -m "Generated gh-pages for `git log master -1 --pretty=short --abbrev-commit`" && git push origin gh-pages ; git checkout master

Add documents

$ vim source/expert_python.rst
$ make gh-pages

Reference

4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4