Skip to content

Commit 454d8a6

Browse files
authored
Merge pull request #88 from QuantStack/docs
Improve documentation
2 parents b5edd29 + dcb16b7 commit 454d8a6

File tree

7 files changed

+311
-235
lines changed

7 files changed

+311
-235
lines changed

docs/source/api.rst

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,41 @@
1-
API docs
2-
========
1+
API reference
2+
=============
33

4-
Note that ipyvolume.easy and ipyvolume.sheet are imported in the ipysheet namepsace, to you can access ipysheet.sheet instead of ipyvolume.easy.sheet.
4+
Note that everything is accessible from the ipysheet namespace.
5+
For example, you can do ``from ipysheet import sheet, from_dataframe``
56

67

78
ipysheet.easy
8-
---------------
9+
-------------
910

1011
.. automodule:: ipysheet.easy
11-
:members:
12+
:members:
1213
:undoc-members:
1314
:show-inheritance:
1415

16+
17+
ipysheet.pandas_loader
18+
----------------------
19+
20+
.. automodule:: ipysheet.pandas_loader
21+
:members: from_dataframe, to_dataframe
22+
:undoc-members:
23+
:show-inheritance:
24+
25+
26+
ipysheet.numpy_loader
27+
---------------------
28+
29+
.. automodule:: ipysheet.numpy_loader
30+
:members: from_array, to_array
31+
:undoc-members:
32+
:show-inheritance:
33+
34+
1535
ipysheet.sheet
16-
-----------------
36+
--------------
1737

1838
.. automodule:: ipysheet.sheet
1939
:members: Sheet, Cell, Range
2040
:undoc-members:
2141
:show-inheritance:
22-

docs/source/conf.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
#
2929
# needs_sphinx = '1.0'
3030

31+
from ipysheet._version import __version__, __version_tuple__
32+
3133
# Add any Sphinx extension module names here, as strings. They can be
3234
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3335
# ones.
@@ -39,7 +41,8 @@
3941
'sphinx.ext.ifconfig',
4042
'sphinx.ext.viewcode',
4143
'nbsphinx',
42-
'jupyter_sphinx.embed_widgets'
44+
'jupyter_sphinx.embed_widgets',
45+
'sphinx.ext.napoleon'
4346
]
4447

4548
# Add any paths that contain templates here, relative to this directory.
@@ -64,9 +67,9 @@
6467
# built documents.
6568
#
6669
# The short X.Y version.
67-
version = '0.1'
70+
version = '.'.join([str(__version_tuple__[0]), str(__version_tuple__[1])])
6871
# The full version, including alpha/beta/rc tags.
69-
release = '0.1'
72+
release = __version__
7073

7174
# The language for content autogenerated by Sphinx. Refer to documentation
7275
# for a list of supported languages.
@@ -103,7 +106,7 @@
103106
# Add any paths that contain custom static files (such as style sheets) here,
104107
# relative to this directory. They are copied after the builtin static files,
105108
# so a file named "default.css" will overwrite the builtin "default.css".
106-
html_static_path = ['_static']
109+
# html_static_path = ['_static']
107110

108111
# Custom sidebar templates, must be a dictionary that maps document names
109112
# to template names.

docs/source/index.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@
467467
"nbsphinx-toctree": {}
468468
},
469469
"source": [
470-
"[api](api.rst)"
470+
"[API Reference](api.rst)"
471471
]
472472
}
473473
],
@@ -488,7 +488,7 @@
488488
"name": "python",
489489
"nbconvert_exporter": "python",
490490
"pygments_lexer": "ipython3",
491-
"version": "3.7.2"
491+
"version": "3.7.1"
492492
},
493493
"widgets": {
494494
"application/vnd.jupyter.widget-state+json": {

ipysheet/docutils.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Copyright (c) Jupyter Development Team.
2+
# Distributed under the terms of the Modified BSD License.
3+
4+
# This file is copied from ipywidgets
5+
6+
7+
def doc_subst(snippets):
8+
""" Substitute format strings in class or function docstring """
9+
def decorator(cls):
10+
# Strip the snippets to avoid trailing new lines and whitespace
11+
stripped_snippets = {
12+
key: snippet.strip() for (key, snippet) in snippets.items()
13+
}
14+
cls.__doc__ = cls.__doc__.format(**stripped_snippets)
15+
return cls
16+
return decorator

0 commit comments

Comments
 (0)