Skip to content

docs: Migrate over a lightweight version of documentation #23

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 12 commits into from
Jul 25, 2025
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
Empty file removed doc/source/_static/.placeholder
Empty file.
8 changes: 8 additions & 0 deletions doc/source/_static/wrap_table.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* Force all Sphinx docutils tables to wrap text in cells (RTD theme & general) */
.rst-content table.docutils td,
.rst-content table.docutils th,
.wy-table-responsive table td,
.wy-table-responsive table th {
white-space: normal !important;
word-break: normal !important;
}
Copy link
Contributor Author

@cadenmyers13 cadenmyers13 Jul 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to add this file or something like this to the main scikit-package. Otherwise, when you render tables in the sphinx RTD theme the tables dont fully load on the page. you have to scroll over to view the whole thing. This code wraps the text in the table so it renders nicely.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fyi I dont know how to code in C very well so i got help from chatGPT here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bobleesj do you agree? It makes sense to me.

31 changes: 0 additions & 31 deletions doc/source/api/diffpy.cmi.example_package.rst

This file was deleted.

28 changes: 8 additions & 20 deletions doc/source/api/diffpy.cmi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,16 @@
|title|
=======

.. |title| replace:: diffpy.cmi package
.. |title| replace:: diffpy.cmi Contents

.. automodule:: diffpy.cmi
:members:
:undoc-members:
:show-inheritance:
``diffpy.cmi`` includes Python and C++ libraries developed by the DiffPy team as well as external libraries necessary for functionality.

Subpackages
-----------
Libraries developed by the DiffPy team
--------------------------------------

.. toctree::
diffpy.cmi.example_package
.. include:: ../snippets/diffpy_libraries.rst

Submodules
----------
External Libraries
------------------

|module|
--------

.. |module| replace:: diffpy.cmi.example_submodule module

.. automodule:: diffpy.cmi.example_submodule
:members:
:undoc-members:
:show-inheritance:
.. include:: ../snippets/external_libraries.rst
3 changes: 2 additions & 1 deletion doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@
# 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']
html_static_path = ["_static"]
html_css_files = ["wrap_table.css"]

# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
Expand Down
70 changes: 1 addition & 69 deletions doc/source/getting-started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,72 +8,4 @@
Getting started
================

Here are some example templates provided to help you get started with writing your documentation. You can use these templates to create your own documentation.

Reuse ``.rst`` files across multiple pages
------------------------------------------

Here is how you can reuse a reusable block of ``.rst`` files across multiple pages:

.. include:: snippets/example-table.rst

.. warning::

Ensure that the ``.rst`` file you are including is not too long. If it is too long, it may be better to split it into multiple files and include them separately.

Refer to a specific section in the documentation
------------------------------------------------

You can use the ``ref`` tag to refer to a specific section in the documentation. For example, you can refer to the section below using the ``:ref:`` tag as shown :ref:`here <attach-image>`.

.. note::

Please check the raw ``.rst`` file of this page to see the exact use of the ``:ref:`` tag.

Embed your code snippets in the documentation
---------------------------------------------

Here is how you can write a block of code in the documentation. You can use the ``code-block`` directive to write a block of code in the documentation. For example, you can write a block of code as shown below:

.. code-block:: bash

# Create a new environment, without build dependencies (pure Python package)
conda create -n <package_name>-env python=3.13 \
--file requirements/tests.txt \
--file requirements/conda.txt

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want installation instructions in the docs?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes please. We are not sure what they are going to be yet though. Probably conda-forge only.

# Create a new environment, with build dependencies (non-pure Python package)
conda create -n <package_name>-env python=3.13 \
--file requirements/tests.txt \
--file requirements/conda.txt \
--file requirements/build.txt

# Activate the environment
conda activate <package_name>_env

# Install your package locally
# `--no-deps` to NOT install packages again from `requirements.pip.txt`
pip install -e . --no-deps

# Run pytest locally
pytest

# ... run example tutorials

.. _attach-image:

Attach an image to the documentation
------------------------------------

Here is how you attach an image to the documentation. The ``/doc/source/img/scikit-package-logo-text.png`` example image is provided in the template.

.. image:: ./img/scikit-package-logo-text.png
:alt: codecov-in-pr-comment
:width: 400px
:align: center


Other useful directives
-----------------------

Here is how you can do menu selection :menuselection:`Admin --> Settings` and display labels for buttons like :guilabel:`Privacy level`.
Coming soon...
Binary file added doc/source/img/diffpycmi_screenshot.png
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image is from current cmi docs

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed doc/source/img/scikit-package-logo-text.png
Binary file not shown.
15 changes: 11 additions & 4 deletions doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,24 @@
#######

.. |title| replace:: diffpy.cmi documentation
| Software version |release|
| Last updated |today|.

``diffpy.cmi`` - Complex modeling infrastructure: a modular framework for multi-modal modeling of scientific data.

| Software version |release|
| Last updated |today|.
DiffPy.CMI is our complex modeling framework. It is a highly flexible library of Python modules for robust modeling of nanostructures in crystals, nanomaterials, and amorphous materials.

The software provides functionality for storage and manipulation of structure data and calculation of structure-based quantities, such as PDF, SAS, bond valence sums, atom overlaps, bond lengths, and coordinations. Most importantly the diffpy.cmi package contains a fitting framework for combining multiple experimental inputs in a single optimization problem.

.. image:: ./img/diffpycmi_screenshot.png
:alt: codecov-in-pr-comment
:width: 400px
:align: center
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This text is also from current cmi docs


===============
Getting started
===============

Welcome to the ``diffpy.cmi`` documentation!

To get started, please visit the :ref:`Getting started <getting-started>` page.

=======
Expand Down Expand Up @@ -44,6 +50,7 @@ Table of contents
:maxdepth: 2

getting-started
Tutorials <tutorials/index>
Package API <api/diffpy.cmi>
release
license
Expand Down
27 changes: 27 additions & 0 deletions doc/source/snippets/diffpy_libraries.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.. list-table::
:widths: 3 10 1
:header-rows: 1
:class: wrap-text


* - Package
- Description
- Docs
* - `diffpy.srfit <https://github.com/diffpy/diffpy.srfit>`_
- Setup and control of general fitting problems.
- `doc <https://www.diffpy.org/diffpy.srfit/>`_
* - `diffpy.srreal <https://github.com/diffpy/diffpy.srreal>`_
- Calculators for PDF, bond valence sum, and other quantities based on atom pair interaction.
- `doc <https://www.diffpy.org/diffpy.srreal/>`_
* - `diffpy.structure <https://github.com/diffpy/diffpy.structure>`_
- Crystal structure container and parsers for structure formats.
- `doc <https://www.diffpy.org/diffpy.structure/>`_
* - `diffpy.utils <https://github.com/diffpy/diffpy.utils>`_
- General purpose utilities for the diffpy libraries.
- `doc <https://www.diffpy.org/diffpy.utils/>`_
* - `pyobjcryst <https://github.com/diffpy/pyobjcryst>`_
- Python bindings to ObjCryst++, the Object-Oriented Crystallographic Library.
- `doc <https://www.diffpy.org/pyobjcryst/>`_
* - `libdiffpy <https://github.com/diffpy/libdiffpy>`_
- C++ library for calculation of PDF and other real-space quantities.
- `doc <https://www.diffpy.org/libdiffpy/>`_
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both new tables are also from current cmi docs but with updated/not broken links except cxxtest, their doc link is broken so i just put the broken link there for now.

28 changes: 0 additions & 28 deletions doc/source/snippets/example-table.rst

This file was deleted.

21 changes: 21 additions & 0 deletions doc/source/snippets/external_libraries.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.. list-table::
:widths: 3 10 1
:header-rows: 1
:class: wrap-text


* - Package
- Description
- Docs
* - `srfit-sasview <https://github.com/diffpy/srfit-sasview>`_
- Selected modules from SasView, the Small Angle Scattering Analysis Software Package.
- `doc <https://www.sasview.org/documentation/>`_
* - `periodictable <https://github.com/python-periodictable/periodictable>`_
- Extensible periodic table of the elements with support for mass, density, and X-ray/neutron scattering information.
- `doc <https://periodictable.readthedocs.io/en/latest/>`_
* - `libobjcryst <https://github.com/diffpy/libobjcryst>`_
- ObjCryst++, crystallographic library for C++ re-packaged for installation as a shared library.
- `doc <https://sourceforge.net/projects/objcryst/>`_
* - `cxxtest <https://github.com/CxxTest/cxxtest>`_
- Testing framework for C++.
- `doc <http://cxxtest.com/>`_
4 changes: 4 additions & 0 deletions doc/source/tutorials/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Tutorials
=========

Examples usage of ``diffpy.cmi`` can be found at `this GitHub repo <https://github.com/diffpy/add2019-diffpy-cmi>`_. Tutorials coming soon...
23 changes: 23 additions & 0 deletions news/lightweight-docs.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* Add light-weight documentation migrated from old diffpy-CMI documentation.

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>
Loading