Skip to content

Commit

Permalink
create initial docs content from examples
Browse files Browse the repository at this point in the history
  • Loading branch information
ianhi committed Aug 31, 2020
1 parent cf12307 commit bae6821
Show file tree
Hide file tree
Showing 30 changed files with 25,789 additions and 169 deletions.
4 changes: 3 additions & 1 deletion docs/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ dependencies:
- sphinx_rtd_theme
- sphinx-autobuild
- jupyter-sphinx>=0.2.4
- sphinx-copybutton
- sphinx-copybutton
- nbsphinx
- nbsphinx-link
7 changes: 6 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
'sphinx.ext.napoleon',
'jupyter_sphinx',
'sphinx_copybutton',
'nbsphinx',
'nbsphinx_link',
]

# Ensure our extension is available:
Expand All @@ -47,10 +49,13 @@
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'

# The master toctree document.
master_doc = 'index'

# ensure widget output is not duplicated
# see https://github.com/spatialaudio/nbsphinx/issues/378
nbsphinx_widgets_path = ''

# General information about the project.
project = 'ipycytoscape'
copyright = '2020, Mariana Meireles'
Expand Down
71 changes: 71 additions & 0 deletions docs/source/contributing.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
============
Contributing
============

Thanks for thinking of a way to help improve this library! Remember that contributions come in all
shapes and sizes beyond writing bug fixes. Contributing to documentation, opening new `issues <https://github.com/quantstack/ipycytoscape/issues>`_ for bugs, asking for clarification
on things you find unclear, and requesting new features, are all super valuable contributions.

Code Improvements
-----------------

All development for this library happens on Github at `mpl_interactions <https://github.com/quantstack/ipycytoscape>`_.

Seeing your changes
^^^^^^^^^^^^^^^^^^^

If you are working in a Jupyter Notebook, then in order to see your code changes you will need to either:

* Restart the Kernel every time you make a change to the code.
* **Or:** Make the function reload from the source file every time you run it by using `autoreload <https://ipython.readthedocs.io/en/stable/config/extensions/autoreload.html>`_.

.. code-block:: python
%load_ext autoreload
%autoreload 2
from mpl_interactions import ....
Working with Git
^^^^^^^^^^^^^^^^

Using Git/Github can confusing (https://xkcd.com/1597/) so if you're new to Git, you may find
it helpful to use a program like `Github Desktop <desktop.github.com>`_ and to follow
a `guide <https://github.com/firstcontributions/first-contributions#first-contributions>`_.

Also feel free to ask for help/advice on the relevant Github `issue <https://github.com/quantstack/ipycytoscape/issues>`_.

Documentation
-------------

Following changes to the source files, you can view recent adjustments by building the documentation.

1. Make sure you have installed the requirements for building the documentation:

.. code-block:: bash
cd ipycytoscape
pip install -e.[docs]
2. Run the following commands:

.. code-block:: bash
cd docs
make html
If you open the ``index.html`` file in your browser you should now be able to see the rendered documentation.

Autobuild the documentation
^^^^^^^^^^^^^^^^^^^^^^^^^^^

Alternatively, you can use `sphinx-autobuild <https://github.com/GaretJax/sphinx-autobuild>`_ to continuously watch the documentation for changes and rebuild it for you.
Sphinx-autobuild will be installed automatically by the above ``pip`` command, and we've added it to the ``Makefile``. All you need to do is:

.. code-block:: bash
cd docs
make watch
In a few seconds your web browser should open up the documentation. Now whenever you save a file
the documentation will automatically regenerate and the webpage will refresh for you!
169 changes: 169 additions & 0 deletions docs/source/examples/DAGData.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
{
"nodes":[
{
"data":{
"id":"n0"
}
},
{
"data":{
"id":"n1"
}
},
{
"data":{
"id":"n2"
}
},
{
"data":{
"id":"n3"
}
},
{
"data":{
"id":"n4"
}
},
{
"data":{
"id":"n5"
}
},
{
"data":{
"id":"n6"
}
},
{
"data":{
"id":"n7"
}
},
{
"data":{
"id":"n8"
}
},
{
"data":{
"id":"n9"
}
},
{
"data":{
"id":"n10"
}
},
{
"data":{
"id":"n11"
}
},
{
"data":{
"id":"n12"
}
},
{
"data":{
"id":"n13"
}
},
{
"data":{
"id":"n14"
}
},
{
"data":{
"id":"n15"
}
},
{
"data":{
"id":"n16"
}
}
],
"edges":[
{
"data":{
"source":"n0",
"target":"n1"
}
},
{
"data":{
"source":"n1",
"target":"n2"
}
},
{
"data":{
"source":"n1",
"target":"n3"
}
},
{
"data":{
"source":"n4",
"target":"n5"
}
},
{
"data":{
"source":"n4",
"target":"n6"
}
},
{
"data":{
"source":"n6",
"target":"n7"
}
},
{
"data":{
"source":"n6",
"target":"n8"
}
},
{
"data":{
"source":"n8",
"target":"n9"
}
},
{
"data":{
"source":"n8",
"target":"n10"
}
},
{
"data":{
"source":"n11",
"target":"n12"
}
},
{
"data":{
"source":"n12",
"target":"n13"
}
},
{
"data":{
"source":"n13",
"target":"n14"
}
},
{
"data":{
"source":"n13",
"target":"n15"
}
}
]
}
Loading

0 comments on commit bae6821

Please sign in to comment.