diff options
author | Prashanth Pai <ppai@redhat.com> | 2016-06-10 15:47:47 +0530 |
---|---|---|
committer | Prashanth Pai <ppai@redhat.com> | 2016-06-10 15:47:47 +0530 |
commit | 759471ddcd76306b952bb2ee28f211afc9e24f3a (patch) | |
tree | 74234f6dbc010fa436c2f2f9387169ceedabd38e | |
parent | 2de0f31c04b588098eaaabe8dc19b961bfd83d0b (diff) |
Improve sphinx rendering on RTD
Change-Id: I646b5d26bca6d4f0123c1b2140f80f24d268568e
Signed-off-by: Prashanth Pai <ppai@redhat.com>
-rw-r--r-- | README.md | 38 | ||||
-rw-r--r-- | doc/_static/ant.png | bin | 0 -> 38316 bytes | |||
-rw-r--r-- | doc/conf.py | 20 | ||||
-rw-r--r-- | doc/contact.rst | 10 | ||||
-rw-r--r-- | doc/index.rst | 20 | ||||
-rw-r--r-- | doc/install.rst | 16 |
6 files changed, 46 insertions, 58 deletions
@@ -6,44 +6,6 @@ This is the official python bindings for the Complete API reference and documentation can be found at [ReadTheDocs](http://libgfapi-python.readthedocs.io/) -### Installation - -``` -$ git clone https://review.gluster.org/libgfapi-python -$ cd libgfapi-python -$ sudo python setup.py install -``` - -### Example Usage - -```python -from gluster import gfapi - -# Create virtual mount -volume = gfapi.Volume('10.7.1.99', 'datavolume') -volume.mount() - -# Create directory -volume.mkdir('dir1', 0755) - -# List directories -volume.listdir('/') - -# Create new file and write to it -with volume.fopen('somefile.txt', 'w+') as f: - f.write("Winter is coming.") - -# Open and read file -with volume.fopen('somefile.txt', 'r') as f: - print f.read() - -# Delete file -volume.unlink('somefile.txt') - -# Unmount the volume -volume.umount() -``` - ### TODOs * Submit to pypy to enable installing using pip diff --git a/doc/_static/ant.png b/doc/_static/ant.png Binary files differnew file mode 100644 index 0000000..c560523 --- /dev/null +++ b/doc/_static/ant.png diff --git a/doc/conf.py b/doc/conf.py index 4f3d8e0..38e9814 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -47,7 +47,7 @@ templates_path = ['_templates'] # You can specify multiple suffix as a list of string: # # source_suffix = ['.rst', '.md'] -source_suffix = '.rst' +source_suffix = ['.rst'] # The encoding of source files. # @@ -129,6 +129,14 @@ todo_include_todos = False # a list of builtin themes. # html_theme = 'alabaster' +html_theme_options = { + 'logo': 'ant.png', + 'github_user': 'gluster', + 'github_repo': 'libgfapi-python', + 'github_button': True, + 'github_type': 'star', + 'fixed_sidebar': True, +} # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the @@ -142,7 +150,7 @@ html_theme = 'alabaster' # The name for this set of Sphinx documents. # "<project> v<release> documentation" by default. # -# html_title = u'libgfapi-python v0' +html_title = u'libgfapi-python' # A shorter title for the navigation bar. Default is the same as html_title. # @@ -183,7 +191,13 @@ html_static_path = ['_static'] # Custom sidebar templates, maps document names to template names. # -# html_sidebars = {} +html_sidebars = { + '**': [ + 'about.html', + 'navigation.html', + 'searchbox.html' + ] +} # Additional templates that should be rendered to pages, maps page names to # template names. diff --git a/doc/contact.rst b/doc/contact.rst new file mode 100644 index 0000000..b4e4590 --- /dev/null +++ b/doc/contact.rst @@ -0,0 +1,10 @@ +======= +Contact +======= + +You can get in touch with the developer & user community in any of the +following ways: + +* IRC: ``#gluster-dev`` on Freenode +* Mailing list: ``gluster-devel@gluster.org`` (see the `gluster-devel homepage + <https://www.gluster.org/mailman/listinfo/gluster-devel>`_ for usage details) diff --git a/doc/index.rst b/doc/index.rst index bae2632..9d0b605 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -4,17 +4,6 @@ libgfapi-python This is the official python bindings for `GlusterFS <http://www.gluster.org>`_ libgfapi C library interface. -Installation ------------- - -Install from source: - -.. code-block:: console - - $ git clone https://review.gluster.org/libgfapi-python - $ cd libgfapi-python - $ sudo python setup.py install - Example Usage ------------- @@ -46,11 +35,8 @@ Example Usage # Unmount the volume volume.umount() - -API Reference -------------- - .. toctree:: - :maxdepth: 2 + :hidden: + :glob: - api-reference + * diff --git a/doc/install.rst b/doc/install.rst new file mode 100644 index 0000000..cbe7c7d --- /dev/null +++ b/doc/install.rst @@ -0,0 +1,16 @@ +Installation +------------ + +Install glusterfs: + +.. code-block:: console + + $ yum install glusterfs-api + +Install libgfapi-python from source: + +.. code-block:: console + + $ git clone https://review.gluster.org/libgfapi-python + $ cd libgfapi-python + $ sudo python setup.py install |