Skip to content

Commit 4620240

Browse files
choldgrafjorisvandenbossche
authored andcommitted
adding simple docs site (pandas-dev#54)
1 parent ae98903 commit 4620240

24 files changed

+1721
-4
lines changed

.circleci/config.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
conda update conda
2929
conda config --add channels conda-forge
3030
# Install pandas + some optional dependencies
31-
conda install pandas matplotlib ipython sphinx ipykernel jinja2 numpydoc nbconvert nbsphinx jupyter_client gitpython
31+
pip install -r docs/requirements.txt
3232
# install the theme package
3333
pip install -e .
3434
# Cache some files for a speedup in subsequent builds
@@ -41,11 +41,11 @@ jobs:
4141
name: Build docs to store
4242
command: |
4343
export PATH="$HOME/miniconda/bin:$PATH"
44-
cd pandas-docs
45-
python make.py html
44+
cd docs
45+
make html
4646
# Tell Circle to store the documentation output in a folder that we can access later
4747
- store_artifacts:
48-
path: pandas-docs/build/html/
48+
path: docs/_build/html/
4949
destination: html
5050

5151
# Tell CircleCI to use this workflow when it builds the site

docs/Makefile

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?= --keep-going
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/_static/pandas.svg

+1
Loading

docs/changelog.rst

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
*********
2+
Changelog
3+
*********
4+
5+
master
6+
======
7+
8+
New Features
9+
-------------
10+
11+
* The theme now exists...

docs/conf.py

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# This file only contains a selection of the most common options. For a full
4+
# list see the documentation:
5+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6+
7+
# -- Path setup --------------------------------------------------------------
8+
9+
# If extensions (or modules to document with autodoc) are in another directory,
10+
# add these directories to sys.path here. If the directory is relative to the
11+
# documentation root, use os.path.abspath to make it absolute, like shown here.
12+
#
13+
# import os
14+
# import sys
15+
# sys.path.insert(0, os.path.abspath('.'))
16+
17+
18+
# -- Project information -----------------------------------------------------
19+
20+
project = 'Pandas Sphinx Theme'
21+
copyright = '2019, PyData Community'
22+
author = 'PyData Community'
23+
24+
# The full version, including alpha/beta/rc tags
25+
release = '0.0.1dev0'
26+
27+
28+
# -- General configuration ---------------------------------------------------
29+
30+
# Add any Sphinx extension module names here, as strings. They can be
31+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
32+
# ones.
33+
34+
extensions = [
35+
'sphinx.ext.autodoc',
36+
'sphinx.ext.autosummary'
37+
]
38+
39+
# Add any paths that contain templates here, relative to this directory.
40+
templates_path = ['_templates']
41+
42+
# List of patterns, relative to source directory, that match files and
43+
# directories to ignore when looking for source files.
44+
# This pattern also affects html_static_path and html_extra_path.
45+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
46+
47+
48+
# -- Options for HTML output -------------------------------------------------
49+
50+
# The theme to use for HTML and HTML Help pages. See the documentation for
51+
# a list of builtin themes.
52+
#
53+
html_theme = 'pandas_sphinx_theme'
54+
html_logo = '_static/pandas.svg'
55+
56+
# Add any paths that contain custom static files (such as style sheets) here,
57+
# relative to this directory. They are copied after the builtin static files,
58+
# so a file named "default.css" will overwrite the builtin "default.css".
59+
html_static_path = ['_static']

docs/contributing.rst

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
************
2+
Contributing
3+
************
4+
5+
TODO

docs/demo/api.rst

+159
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
***************************************
2+
API documentation and generated content
3+
***************************************
4+
5+
This page contains general code elements that are common
6+
for package documentation.
7+
8+
.. contents:: Table of Contents
9+
10+
Pandas DataFrame
11+
================
12+
13+
.. currentmodule:: pandas
14+
15+
.. autosummary::
16+
:toctree: api/
17+
18+
DataFrame
19+
DataFrame.index
20+
DataFrame.columns
21+
DataFrame.dtypes
22+
DataFrame.ftypes
23+
DataFrame.get_dtype_counts
24+
DataFrame.get_ftype_counts
25+
DataFrame.select_dtypes
26+
DataFrame.values
27+
28+
29+
:mod:`pandas.datetime`
30+
======================
31+
32+
.. automodule:: pandas.datetime
33+
:members:
34+
35+
36+
C++ API
37+
=======
38+
39+
.. cpp:type:: MyType
40+
41+
Some type
42+
43+
.. cpp:function:: const MyType Foo(const MyType bar)
44+
45+
Some function type thing
46+
47+
.. cpp:class:: template<typename T, std::size_t N> std::array
48+
49+
Some cpp class
50+
51+
.. cpp:member:: float Sphinx::version
52+
53+
The description of Sphinx::version.
54+
55+
.. cpp:var:: int version
56+
57+
The description of version.
58+
59+
.. cpp:type:: std::vector<int> List
60+
61+
The description of List type.
62+
63+
.. cpp:enum:: MyEnum
64+
65+
An unscoped enum.
66+
67+
.. cpp:enumerator:: A
68+
69+
.. cpp:enum-class:: MyScopedEnum
70+
71+
A scoped enum.
72+
73+
.. cpp:enumerator:: B
74+
75+
.. cpp:enum-struct:: protected MyScopedVisibilityEnum : std::underlying_type<MySpecificEnum>::type
76+
77+
A scoped enum with non-default visibility, and with a specified underlying type.
78+
79+
.. cpp:enumerator:: B
80+
81+
82+
JavaScript API
83+
==============
84+
85+
.. Copied from sphinx-doc/sphinx/tests/roots
86+
87+
.. js:module:: module_a.submodule
88+
89+
* Link to :js:class:`ModTopLevel`
90+
91+
.. js:class:: ModTopLevel
92+
93+
* Link to :js:meth:`mod_child_1`
94+
* Link to :js:meth:`ModTopLevel.mod_child_1`
95+
96+
.. js:method:: ModTopLevel.mod_child_1
97+
98+
* Link to :js:meth:`mod_child_2`
99+
100+
.. js:method:: ModTopLevel.mod_child_2
101+
102+
* Link to :js:meth:`module_a.submodule.ModTopLevel.mod_child_1`
103+
104+
.. js:module:: module_b.submodule
105+
106+
* Link to :js:class:`ModTopLevel`
107+
108+
.. js:class:: ModNested
109+
110+
.. js:method:: nested_child_1
111+
112+
* Link to :js:meth:`nested_child_2`
113+
114+
.. js:method:: nested_child_2
115+
116+
* Link to :js:meth:`nested_child_1`
117+
118+
119+
Generated Index
120+
===============
121+
122+
Part of the sphinx build process in generate and index file: :ref:`genindex`.
123+
124+
125+
Optional parameter args
126+
=======================
127+
128+
At this point optional parameters `cannot be generated from code`_.
129+
However, some projects will manually do it, like so:
130+
131+
This example comes from `django-payments module docs`_.
132+
133+
.. class:: payments.dotpay.DotpayProvider(seller_id, pin[, channel=0[, lock=False], lang='pl'])
134+
135+
This backend implements payments using a popular Polish gateway, `Dotpay.pl <http://www.dotpay.pl>`_.
136+
137+
Due to API limitations there is no support for transferring purchased items.
138+
139+
140+
:param seller_id: Seller ID assigned by Dotpay
141+
:param pin: PIN assigned by Dotpay
142+
:param channel: Default payment channel (consult reference guide)
143+
:param lang: UI language
144+
:param lock: Whether to disable channels other than the default selected above
145+
146+
.. _cannot be generated from code: https://groups.google.com/forum/#!topic/sphinx-users/_qfsVT5Vxpw
147+
.. _django-payments module docs: http://django-payments.readthedocs.org/en/latest/modules.html#payments.authorizenet.AuthorizeNetProvide
148+
149+
150+
Data
151+
====
152+
153+
.. data:: Data_item_1
154+
Data_item_2
155+
Data_item_3
156+
157+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce congue elit eu hendrerit mattis.
158+
159+
Some data link :data:`Data_item_1`.

0 commit comments

Comments
 (0)