Skip to content
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

basic api docs #41

Merged
merged 2 commits into from
Sep 8, 2020
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,4 @@ venv.bak/
_test_data
src/ome_types/model/
src/ome_types/_version.py
docs/source/_autosummary
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 ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
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)
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
5 changes: 5 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
sphinx==3.1.1
pygments
sphinx-rtd-theme==0.5.0
sphinx-autodoc-typehints
ipython==7.15.0
199 changes: 199 additions & 0 deletions docs/source/_static/css/rtd.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@300;400;500;600&family=Roboto:wght@100;300;400;700&display=swap");

body {
font-family: "Roboto", "Lato", "proxima-nova", "Helvetica Neue", Arial,
sans-serif !important;
font-weight: 300;
color: #404040;
}

a {
color: #0088e2;
}

a:visited {
color: #4290c3;
}

.rst-content a {
font-weight: 400
}

a.icon-home {
color: white;
}



.wy-menu-vertical a {
color: #d9d9d9;
}

.wy-menu-vertical header,
.wy-menu-vertical p.caption {
color: #00a9a9;
}

.wy-nav-content-wrap {
background: white;
}

pre,
code samp {
font-family: "IBM Plex Mono", "InconsolataRegular", "Inconsolata",
"RobotoMonoRegular", "Roboto Mono", monospace !important;
font-size: 1em;
}

code,
.rst-content tt,
.rst-content code {
border-radius: 3px;
}

h1,
h2,
.rst-content .toctree-wrapper p.caption,
h3,
h4,
h5,
h6,
legend {
margin-top: 0;
font-weight: 400;
font-family: "Roboto", "Georgia", Arial, sans-serif;
}

.rst-content pre.literal-block,
.rst-content div[class^="highlight"] {
border-radius: 3px;
}

.rst-content dl:not(.docutils) dt {
background-color: lightcyan;
border-color: #c8b4da;
}

.rst-content dl:not(.docutils) dt:first-child {
margin-top: 0;
padding-left: 4rem;
padding-right: 100px;
}

.rst-content dl.field-list.simple dt:first-child {
padding-left: 0.5rem;
}


.rst-content dl:not(.docutils) .property {
display: inline-block;
padding-right: 8px;
/* position: absolute; */
left: 0.5rem;
text-transform: uppercase;
font-style: normal;
color: darkcyan;
}

.rst-content dl.py.data .property {
display: inline-block;
padding-right: 8px;
position: inherit;
text-transform: none;
}

.class .method dt {
padding-left: 0.5rem;
}

.rst-content dl.method dt:first-child {
margin-top: 0;
padding-left: 0.5rem;
}

.rst-content dl.method em.property {
display: inline-block;
position: inherit;
margin-right: 0.5rem;
left: 0.5rem;
font-style: normal;
text-transform: uppercase;
color: darkcyan;
}

/* .function dt a,
.attribute dt a,
.class .attribute dt a,
.class dt a {
position: absolute;
right: 15px;
padding-right: 0;
top: 50%;
-webkit-transform: perspective(1px) translateY(-50%);
transform: perspective(1px) translateY(-50%);
} */

.function .viewcode-link,
.attribute .viewcode-link,
.class .viewcode-link {
font-size: 0.8rem;
color: #979797;
letter-spacing: 0;
line-height: 1.5rem;
font-weight: 300;
text-transform: uppercase;
padding-right: 15px;
}

.wy-nav-content {
background: white;
}

.wy-side-nav-search input[type="text"] {
border-radius: 5px;
}

span.sig-paren {
font-weight: 400;
}

em.sig-param {
font-size: 0.85rem;
font-style: italic;
font-weight: 400;
}

.wy-side-nav-search,
.wy-nav-top {
background-color: darkcyan;
}

.wy-table-responsive td code {
font-size: 0.75rem;
}

dl.py.attribute em.property {
display: none;
}

.rst-content dl.py.attribute dt:first-child {
padding-left: 0.5rem;
}

/* .rst-content dl.py.attribute dt:first-child code.descname::before {
content: "ATTR";
padding-right: 5px;
color: darkcyan;
} */

.rst-content dl:not(.docutils) dt:first-child {
margin-top: 0;
padding-left: 4rem;
padding-right: 50px;
}

.rst-content .section ul, .rst-content .toctree-wrapper ul, .wy-plain-list-disc, article ul {
list-style: disc;
line-height: 30px;
margin-bottom: 24px;
}
9 changes: 9 additions & 0 deletions docs/source/_templates/custom-class-template.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{{ name | escape | underline}}

.. currentmodule:: {{ module }}

.. autoclass:: {{ name }}
:members:
:show-inheritance:
:inherited-members:
:exclude-members: validate_id
66 changes: 66 additions & 0 deletions docs/source/_templates/custom-module-template.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{{ fullname | escape | underline}}

.. automodule:: {{ fullname }}

{% block attributes %}
{% if attributes %}
.. rubric:: Module attributes

.. autosummary::
:toctree:
{% for item in attributes %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block functions %}
{% if functions %}
.. rubric:: {{ _('Functions') }}

.. autosummary::
:toctree:
:nosignatures:
{% for item in functions %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block classes %}
{% if classes %}
.. rubric:: {{ _('Classes') }}

.. autosummary::
:toctree:
:template: custom-class-template.rst
:nosignatures:
{% for item in classes %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block exceptions %}
{% if exceptions %}
.. rubric:: {{ _('Exceptions') }}

.. autosummary::
:toctree:
{% for item in exceptions %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block modules %}
{% if modules %}
.. autosummary::
:toctree:
:template: custom-module-template.rst
:recursive:
{% for item in modules %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}
11 changes: 11 additions & 0 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
API Reference
=============


.. toctree::
:maxdepth: 2
:caption: Contents
:hidden:

ome_types
ome_types.model
Loading