Skip to content

adding simple docs site #54

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Nov 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
conda update conda
conda config --add channels conda-forge
# Install pandas + some optional dependencies
conda install pandas matplotlib ipython sphinx ipykernel jinja2 numpydoc nbconvert nbsphinx jupyter_client gitpython
pip install -r docs/requirements.txt
# install the theme package
pip install -e .
# Cache some files for a speedup in subsequent builds
Expand All @@ -41,11 +41,11 @@ jobs:
name: Build docs to store
command: |
export PATH="$HOME/miniconda/bin:$PATH"
cd pandas-docs
python make.py html
cd docs
make html
# Tell Circle to store the documentation output in a folder that we can access later
- store_artifacts:
path: pandas-docs/build/html/
path: docs/_build/html/
destination: html

# Tell CircleCI to use this workflow when it builds the site
Expand Down
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?= --keep-going
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
1 change: 1 addition & 0 deletions docs/_static/pandas.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
*********
Changelog
*********

master
======

New Features
-------------

* The theme now exists...
59 changes: 59 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# 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.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))


# -- Project information -----------------------------------------------------

project = 'Pandas Sphinx Theme'
copyright = '2019, PyData Community'
author = 'PyData Community'

# The full version, including alpha/beta/rc tags
release = '0.0.1dev0'


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

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.

extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary'
]

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

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']


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

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'pandas_sphinx_theme'
html_logo = '_static/pandas.svg'

# 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']
5 changes: 5 additions & 0 deletions docs/contributing.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
************
Contributing
************

TODO
159 changes: 159 additions & 0 deletions docs/demo/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
***************************************
API documentation and generated content
***************************************

This page contains general code elements that are common
for package documentation.

.. contents:: Table of Contents

Pandas DataFrame
================

.. currentmodule:: pandas

.. autosummary::
:toctree: api/

DataFrame
DataFrame.index
DataFrame.columns
DataFrame.dtypes
DataFrame.ftypes
DataFrame.get_dtype_counts
DataFrame.get_ftype_counts
DataFrame.select_dtypes
DataFrame.values


:mod:`pandas.datetime`
======================

.. automodule:: pandas.datetime
:members:


C++ API
=======

.. cpp:type:: MyType

Some type

.. cpp:function:: const MyType Foo(const MyType bar)

Some function type thing

.. cpp:class:: template<typename T, std::size_t N> std::array

Some cpp class

.. cpp:member:: float Sphinx::version

The description of Sphinx::version.

.. cpp:var:: int version

The description of version.

.. cpp:type:: std::vector<int> List

The description of List type.

.. cpp:enum:: MyEnum

An unscoped enum.

.. cpp:enumerator:: A

.. cpp:enum-class:: MyScopedEnum

A scoped enum.

.. cpp:enumerator:: B

.. cpp:enum-struct:: protected MyScopedVisibilityEnum : std::underlying_type<MySpecificEnum>::type

A scoped enum with non-default visibility, and with a specified underlying type.

.. cpp:enumerator:: B


JavaScript API
==============

.. Copied from sphinx-doc/sphinx/tests/roots

.. js:module:: module_a.submodule

* Link to :js:class:`ModTopLevel`

.. js:class:: ModTopLevel

* Link to :js:meth:`mod_child_1`
* Link to :js:meth:`ModTopLevel.mod_child_1`

.. js:method:: ModTopLevel.mod_child_1

* Link to :js:meth:`mod_child_2`

.. js:method:: ModTopLevel.mod_child_2

* Link to :js:meth:`module_a.submodule.ModTopLevel.mod_child_1`

.. js:module:: module_b.submodule

* Link to :js:class:`ModTopLevel`

.. js:class:: ModNested

.. js:method:: nested_child_1

* Link to :js:meth:`nested_child_2`

.. js:method:: nested_child_2

* Link to :js:meth:`nested_child_1`


Generated Index
===============

Part of the sphinx build process in generate and index file: :ref:`genindex`.


Optional parameter args
=======================

At this point optional parameters `cannot be generated from code`_.
However, some projects will manually do it, like so:

This example comes from `django-payments module docs`_.

.. class:: payments.dotpay.DotpayProvider(seller_id, pin[, channel=0[, lock=False], lang='pl'])

This backend implements payments using a popular Polish gateway, `Dotpay.pl <http://www.dotpay.pl>`_.

Due to API limitations there is no support for transferring purchased items.


:param seller_id: Seller ID assigned by Dotpay
:param pin: PIN assigned by Dotpay
:param channel: Default payment channel (consult reference guide)
:param lang: UI language
:param lock: Whether to disable channels other than the default selected above

.. _cannot be generated from code: https://groups.google.com/forum/#!topic/sphinx-users/_qfsVT5Vxpw
.. _django-payments module docs: http://django-payments.readthedocs.org/en/latest/modules.html#payments.authorizenet.AuthorizeNetProvide


Data
====

.. data:: Data_item_1
Data_item_2
Data_item_3

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce congue elit eu hendrerit mattis.

Some data link :data:`Data_item_1`.
Loading