Skip to content

Commit

Permalink
Restructure docs and update sphinx infrastructure
Browse files Browse the repository at this point in the history
  • Loading branch information
jaladh-singhal committed Mar 27, 2024
1 parent 5326a43 commit 58a96c7
Show file tree
Hide file tree
Showing 21 changed files with 214 additions and 119 deletions.
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ instance/

# Sphinx documentation
docs/_build/
docs/api/

# PyBuilder
target/
Expand All @@ -81,13 +82,13 @@ celerybeat-schedule
# virtualenv
venv/
ENV/
.venv/

# Spyder project settings
.spyderproject

# Rope project settings
.ropeproject

doc/_build/
doc/py-api/

# MacOS
.DS_Store
64 changes: 0 additions & 64 deletions doc/Makefile

This file was deleted.

Empty file removed doc/_static/Readme.md
Empty file.
18 changes: 0 additions & 18 deletions doc/conf.py

This file was deleted.

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 = .
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)
53 changes: 53 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = 'firefly_client'
copyright = '2024, IPAC Firefly Developers'
author = 'Caltech/IPAC Firefly Developers'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = [
'sphinx_automodapi.automodapi',
'myst_parser'
]

templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']


# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = 'pydata_sphinx_theme'
html_static_path = ['_static']

html_last_updated_fmt = ''

# See https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/layout.html
html_theme_options = {
"icon_links": [
{
"name": "GitHub",
"url": "https://github.com/Caltech-IPAC/firefly_client",
"icon": "fa-brands fa-github",
},
{
"name": "PyPI",
"url": "https://pypi.org/project/firefly-client",
"icon": "fa-custom fa-pypi",
},
],
"footer_start": ["copyright", "last-updated"],
"footer_end": ["sphinx-version", "theme-version"],
}


# -- Options for extensions -------------------------------------------------
myst_heading_anchors = 3
31 changes: 31 additions & 0 deletions docs/development/guide.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#################
Local development
#################

Get latest source from ``master`` branch at https://github.com/Caltech-IPAC/firefly_client.


Environment Setup
-----------------

TBD


Building documentation
----------------------

Make sure you have the virtual/conda environment activated and documentation
dependencies installed in that environment.

Then do:

.. code-block:: shell
cd docs
make clean && make html
Open ``docs/_build/html/index.html`` in your browser to see the documentation
website.

Each time you make a change in documentation source, build it using
above command and reload the above file in browser.
11 changes: 11 additions & 0 deletions docs/development/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
###############
Developer Guide
###############


.. toctree::
:maxdepth: 2

guide
new-release-procedure.md

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## How to create a firefly_client release
# Making a release

### Procedure
## Procedure
1. To push a new release you must be a maintainer in pypi ([see pypi below](#pypi))
2. Bump version in setup.py (this step is might be done in the PR)
3. Clean out old distribution
Expand Down Expand Up @@ -34,21 +34,21 @@
11. Make is release with github, using the tag above
- https://github.com/Caltech-IPAC/firefly_client/releases

### PYPI
## PYPI

- https://pypi.org/project/firefly-client/
- Currently two maintainers
- Testing site: https://test.pypi.org/project/firefly-client/

### Optional Test installation
## Optional Test installation

1. To create a test release you must be a mainainer on testpypi
2. Create the distribution (see above)
3. `twine upload --repository-url https://test.pypi.org/legacy/ dist/*`
4. `pip uninstall firefly_client`
5. `pip install --verbose --index-url https://testpypi.python.org/pypi firefly_client`

### Conda and conda-forge
## Conda and conda-forge

Anytime the version tag is updated conda-forge it set up to do a pull and add `firefly_client` to its distribution.

Expand Down
35 changes: 15 additions & 20 deletions doc/index.rst → docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
.. _firefly_client:

#####################################################
firefly\_client - Python API to Firefly visualization
firefly_client - Python API to Firefly visualization
#####################################################

`firefly_client` provides a Python API to the Firefly visualization framework.
Expand All @@ -30,38 +30,33 @@ to upload and display astronomical images, tables and catalogs.

.. _firefly_client-using:


Using firefly_client
====================

.. toctree::
:maxdepth: 1
:maxdepth: 2

getting-started
initializing-vanilla
initializing-jupyterlab
displaying-images
overlaying-regions
viewing-tables
charting
slate-layout
plot-interface
callbacks-extensions
firefly-server
Usage <usage/index>


.. _firefly_client-contributing
.. _firefly_client-contributing:

Contributing
============
Developer Guide
===============

.. toctree::
:maxdepth: 2

Development <development/index>

``firefly_client`` is developed at https://github.com/Caltech-IPAC/firefly_client.

.. _firefly_client-pyapi:

Python API reference
====================

.. automodapi:: firefly_client
:no-inheritance-diagram:
.. toctree::
:maxdepth: 3

API <reference>

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=.
set BUILDDIR=_build

%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.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

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

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

:end
popd
8 changes: 8 additions & 0 deletions docs/reference.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#############
API reference
#############

.. automodapi:: firefly_client
:no-inheritance-diagram:
:no-heading:

File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#################
Displaying Images
-----------------
#################

Since Firefly was originally developed to visualize data products from
astronomical archives, displaying an image is a two-step process of
Expand Down Expand Up @@ -156,8 +157,8 @@ To search the survey:
Displaying HiPS Images
----------------------

TBD

Displaying 3-color Images
-------------------------

TBD
4 changes: 4 additions & 0 deletions doc/getting-started.rst → docs/usage/getting-started.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
###############
Getting Started
###############

Prerequisites
=============

Expand Down
Loading

0 comments on commit 58a96c7

Please sign in to comment.