From 759471ddcd76306b952bb2ee28f211afc9e24f3a Mon Sep 17 00:00:00 2001 From: Prashanth Pai Date: Fri, 10 Jun 2016 15:47:47 +0530 Subject: Improve sphinx rendering on RTD Change-Id: I646b5d26bca6d4f0123c1b2140f80f24d268568e Signed-off-by: Prashanth Pai --- README.md | 38 -------------------------------------- doc/_static/ant.png | Bin 0 -> 38316 bytes doc/conf.py | 20 +++++++++++++++++--- doc/contact.rst | 10 ++++++++++ doc/index.rst | 20 +++----------------- doc/install.rst | 16 ++++++++++++++++ 6 files changed, 46 insertions(+), 58 deletions(-) create mode 100644 doc/_static/ant.png create mode 100644 doc/contact.rst create mode 100644 doc/install.rst diff --git a/README.md b/README.md index aadbcb1..1fa9fba 100644 --- a/README.md +++ b/README.md @@ -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 new file mode 100644 index 0000000..c560523 Binary files /dev/null and b/doc/_static/ant.png differ 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. # " v 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 + `_ 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 `_ 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 -- cgit