Skip to content

Commit

Permalink
Revert "Documentation fixes poliastro#337 poliastro#420 poliastro#418"
Browse files Browse the repository at this point in the history
This reverts commit 104e0f1.
  • Loading branch information
shreyasbapat committed Aug 5, 2018
1 parent 289e35e commit 691e2c4
Show file tree
Hide file tree
Showing 4 changed files with 194 additions and 69 deletions.
4 changes: 2 additions & 2 deletions docs/source/_static/custom.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
@import url("alabaster.css");

body {
.body {
min-width: 100px;
}

div.body{
.div.body{
min-width: 100px;
}
231 changes: 185 additions & 46 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,35 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# poliastro documentation build configuration file, created by
# sphinx-quickstart on Sat May 24 11:02:03 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys
import os
from os.path import join, dirname, abspath
from datetime import datetime

import alabaster
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))

# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
needs_sphinx = '1.3'

# Alabaster theme + mini-extension
html_theme_path = [alabaster.get_path()]
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'alabaster',
'sphinx.ext.autodoc',
'sphinx.ext.napoleon',
'sphinx.ext.todo',
Expand All @@ -17,13 +38,85 @@
'nbsphinx',
'IPython.sphinxext.ipython_console_highlighting',
]

# Custom configuration
autodoc_member_order = 'bysource'

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# The suffix of source filenames.
source_suffix = '.rst'

#Warning suppresses
suppress_warnings = ['image.nonlocal_uri']

# The encoding of source files.
#source_encoding = 'utf-8-sig'

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = 'poliastro'
copyright = u'2013-2017, Juan Luis Cano Rodríguez and the poliastro development team'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '0.11'
# The full version, including alpha/beta/rc tags.
release = '0.11.dev0'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['_build', '**.ipynb_checkpoints']

# The reST default role (used for this markup: `text`) to use for all
# documents.
#default_role = None

# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True

# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#add_module_names = True

# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'

# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []

# If true, keep warnings as "system message" paragraphs in the built documents.
#keep_warnings = False

#Intersphinx configuration
intersphinx_mapping = {
'python': ('https://docs.python.org/3', None),
'astropy': ('http://docs.astropy.org/en/stable/', None),
'numpy': ('https://docs.scipy.org/doc/numpy/', None),
'scipy': ('https://docs.scipy.org/doc/scipy/reference', None),
'matplotlib': ('http://matplotlib.org', None)
}

#Nbsphinx configuration
if os.environ.get('READTHEDOCS') == 'True':
nbsphinx_execute = 'never'
Expand All @@ -33,47 +126,93 @@
# Controls when a cell will time out (defaults to 30; use -1 for no timeout):
nbsphinx_timeout = 60

# -- Options for HTML output ----------------------------------------------

# Paths relative to invoking conf.py - not this shared file
html_static_path = [join("..", "_static")]
html_theme = "alabaster"
html_favicon = 'favicon.ico'
html_theme_options = {
'logo': 'logo_trans.png',
'logo_name': True,
'logo_text_align': 'center',
'travis_button' : True,
'codecov_button': True,
'description':'Astrodynamics in Python',
'body_text_align': 'left',
'github_user': 'poliastro',
'github_repo': 'poliastro',
'show_relbars': True,
'show_powered_by': False,
'page_width': '80%',
'github_banner': True,
'extra_nav_links' : { 'Benchmarks': 'https://blog.poliastro.space/poliastro-benchmarks/',
'Blog': 'https://blog.poliastro.space/',
},

html_sidebars = {
"**": ["about.html", "navigation.html", "searchbox.html", "donate.html"]
}
# Regular settings
pygments_style = 'sphinx'
project = "poliastro"
year = datetime.now().year
copyright = "2013 - %d, Juan Luis Cano Rodríguez and the poliastro development team" % year
master_doc = "index"
templates_path = ["_templates"]
exclude_trees = ["_build"]
exclude_patterns = ['_build', '**.ipynb_checkpoints']
source_suffix = ".rst"
default_role = "obj"
version = '0.11'
release = '0.11.dev0'
autodoc_member_order = 'bysource'
suppress_warnings = ['image.nonlocal_uri']
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
import sphinx_rtd_theme
html_theme = "sphinx_rtd_theme"

# 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
# documentation.
#html_theme_options = {}

# Add any paths that contain custom themes here, relative to this directory.
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
#html_title = None

# HTML style
html_style = os.path.join("css", "custom.css")

# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None

# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#html_logo = None

# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#html_favicon = None

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
# directly to the root of the documentation.
#html_extra_path = []

# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
#html_last_updated_fmt = '%b %d, %Y'

# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True

# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}

# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}

# If false, no module index is generated.
#html_domain_indices = True

# If false, no index is generated.
#html_use_index = True

# If true, the index is split into individual pages for each letter.
#html_split_index = False

# If true, links to the reST sources are added to the pages.
#html_show_sourcelink = True

# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#html_show_sphinx = True

# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#html_show_copyright = True

# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''

# This is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = None

# Output file base name for HTML help builder.
htmlhelp_basename = 'poliastrodoc'


# -- Options for LaTeX output ---------------------------------------------
Expand Down
19 changes: 1 addition & 18 deletions docs/source/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,23 +72,6 @@ you find any, please open an issue in the `issue tracker`_.
.. _`virtualenv`: http://pypi.python.org/pypi/virtualenv
.. _`local installations`: http://stackoverflow.com/a/4325047/554319

Using poliastro with latest JupyterLab
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

For using poliastro on JupyterLab, you must have NodeJS and npm installed in your system.

plotly 3.0 has provided an amazing support for JupyterLab and for using it properly,
you must first install all the extensions required (two).

plotly extension for JupyterLab (needs NodeJS and npm to be present locally):

$ jupyter labextension install @jupyterlab/plotly-extension

and

$ jupyter labextension install @jupyter-widgets/jupyterlab-manager


Testing
-------

Expand All @@ -98,7 +81,7 @@ If installed correctly, the tests can be run using pytest::
Running unit tests for poliastro
[...]
OK
$
$

If for some reason any test fails, please report it in the `issue tracker`_.

Expand Down
9 changes: 6 additions & 3 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ poliastro - Astrodynamics in Python
===================================

.. image:: _static/logo_text.png
:width: 90%
:width: 675px
:align: center

**poliastro** is an open source (MIT) collection of Python functions useful
Expand Down Expand Up @@ -33,7 +33,7 @@ and `chat`_.

.. figure:: _static/molniya.png
:align: right
:figwidth: 50%
:figwidth: 300
:alt: Molniya orbit

Plot of a `Molniya orbit`_ around the Earth
Expand All @@ -56,9 +56,12 @@ the MIT license, hence allowing commercial use of the library.

.. code-block:: python
import matplotlib.pyplot as plt
plt.ion()
from poliastro.examples import molniya
from poliastro.plotting import plot
plot(molniya)
.. include:: success.rst
Expand Down

0 comments on commit 691e2c4

Please sign in to comment.