Skip to main content

Copy your docs directly to the gh-pages branch.

Project description

GitHub Pages Import
===================

As part of gunicorn_, me and `Benoit Chesneau`_ have been starting to look at
how to host documentation. There's the obvious method of using GitHub_'s
post-update hooks to trigger doc builds and rsync to a webserver, but we ended
up wanting to try out github's hosting to make the whole interface a bit more
robust.

`GitHub Pages`_ is a pretty awesome service that GitHub provides for hosting
project documentation. The only thing is that it requires a ``gh-pages`` branch
that is the site's document root. This means that keeping documentation sources
in the branch with code is a bit difficult. And it really turns into a head
scratcher for things like Sphinx_ that want to access documentation sources and
code sources at the same time.

Then I stumbled across an interesting looking package called `github-tools`_
that looked almost like what I wanted. It was a tad complicated and more
involved than I wanted but it gave me an idear. Why not just write a script that
can copy a directory to the ``gh-pages`` branch of the repository. This saves me
from even having to think about the branch and everything becomes magical.

This is what ``ghp-import`` was written for.

.. _gunicorn: http://www.gunicorn.com/
.. _`Benoit Chesneau`: http://github.com/benoitc
.. _GitHub: http://github.com/
.. _`GitHub Pages`: http://pages.github.com/
.. _Sphinx: http://sphinx.pocoo.org/

Usage
=====

::

Usage: ghp-import [OPTIONS] DIRECTORY

Options:
-m MESG The commit message to use on the gh-pages branch.
-p Push the branch to origin/gh-pages after committing.
-r REMOTE The name of the remote to push to. [origin]
-h, --help show this help message and exit

Its pretty simple. Inside your repository just run ``ghp-import $DOCS_DIR``
where ``$DOCS_DIR`` is the path to the *built* documentation. This will write a
commit to your ``gh-pages`` branch with the current documents in it.

If you specify ``-p`` it will also attempt to push the ``gh-pages`` branch to
GitHub. By default it'll just run ``git push origin gh-pages``. You can specify
a different remote using the ``-r`` flag.

License
=======

ghp-import is distributed under the Tumbolia Public License. See the LICENSE
file for more information.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ghp-import-0.1.tar.gz (3.4 kB view details)

Uploaded Source

File details

Details for the file ghp-import-0.1.tar.gz.

File metadata

  • Download URL: ghp-import-0.1.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for ghp-import-0.1.tar.gz
Algorithm Hash digest
SHA256 76eba6e9f0ba8cabe5644408d3e830f34bc079980d1ef2f0ab3bb69fefa4329e
MD5 551bb41ac7623e16c715ddb149789c6c
BLAKE2b-256 c7c52b3f9a5bb4609a33433033e0df1fbce284a04e30b06cb13437351651a47e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page