Skip to content

Commit

Permalink
Added main page, full API reference and license banner
Browse files Browse the repository at this point in the history
  • Loading branch information
daurer committed Dec 18, 2024
1 parent d0a455a commit 3f6d61f
Show file tree
Hide file tree
Showing 22 changed files with 633 additions and 183 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
mpi: mpich

- name: Install Sphinx
run: pip install sphinx
run: pip install sphinx myst_parser

- name: Install PtyPy
run: pip install .[full]
Expand Down
2 changes: 2 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
source/reference/generated/
_build/
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
SOURCEDIR = source
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
Expand Down
61 changes: 0 additions & 61 deletions docs/conf.py

This file was deleted.

18 changes: 0 additions & 18 deletions docs/index.rst

This file was deleted.

8 changes: 0 additions & 8 deletions docs/reference/index.rst

This file was deleted.

94 changes: 0 additions & 94 deletions docs/reference/utils.rst

This file was deleted.

14 changes: 14 additions & 0 deletions docs/source/_static/banner.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<div class="community-message">
PtyPy is a community project. If you'd like to contribute or participate in one of our workshops, <a class='reference external' href='https://ptypy.org'>check out our website</a>.
</div>
<div id="disclaimer">
<div class="disclaimer">
<hr style="border: 1;">
<p> Phase Focus Limited of Sheffield, UK has an international portfolio of patents and pending applications which relate to ptychography. A current list is available <a class="reference external" href="http://www.phasefocus.com/patents/">here</a>.</p><p>
Phase Focus grants royalty free licences of its patent rights for non-commercial academic research use, for reconstruction of simulated data and for reconstruction of data obtained at synchrotrons at X-ray wavelengths. These licenses can be applied for online by clicking on this <a class="reference external" href="http://www.phasefocus.com/licence/">link</a>.</p><p>
Phase Focus asserts that the software we have made available for download may be capable of being used in circumstances which may fall within the claims of one or more of the Phase Focus patents. Phase Focus advises that you apply for a licence from it before downloading any software from this website. </p>
<button type="button"
onclick="document.getElementById('disclaimer').innerHTML = ''">
I understand</button>
</div>
</div>
File renamed without changes
18 changes: 18 additions & 0 deletions docs/source/_static/ptypy.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
div.disclaimer {
/* background-color: #2c5d8a;
color: #f9eed0; */
text-align: left;
}

/* div.disclaimer a{
color: #d8b340;
} */

html[data-theme="light"] {
--pst-color-border: black;
}

html[data-theme="dark"] {
--pst-color-border: white;
}

File renamed without changes.
32 changes: 32 additions & 0 deletions docs/source/_templates/custom-class-template.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{ fullname | escape | underline}}

.. currentmodule:: {{ module }}

.. autoclass:: {{ objname }}
:members:
:inherited-members:
:show-inheritance:

{% block methods %}
.. automethod:: __init__

{% if methods %}
.. rubric:: {{ _('Methods') }}

.. autosummary::
{% for item in methods %}
~{{ name }}.{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block attributes %}
{% if attributes %}
.. rubric:: {{ _('Attributes') }}

.. autosummary::
{% for item in attributes %}
~{{ name }}.{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}
65 changes: 65 additions & 0 deletions docs/source/_templates/custom-module-template.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{{ fullname | escape | underline}}

.. automodule:: {{ fullname }}

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

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

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

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

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

.. autosummary::
:toctree:
:template: custom-class-template.rst
{% 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 %}
.. rubric:: Modules

.. autosummary::
:toctree:
:template: custom-module-template.rst
:recursive:
{% for item in modules %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}
Loading

0 comments on commit 3f6d61f

Please sign in to comment.