Skip to content

Commit

Permalink
Rename "docs" to "website" (AcademySoftwareFoundation#338)
Browse files Browse the repository at this point in the history
* Rename "docs" to "website"

"website" is a more accurate term than "docs", so:

- The source lives in the ``website`` subdirectory (was ``docs``)
- The CMake option is now ``BUILD_WEBSITE`` (was ``BUILD_DOCS``)
- The CMake target is now ``website`` (was ``docs``)
- There's no longer a CMake option to install the docs, since copying
  the ``.html`` to the install location is pointless. The ``INSTALL_DOCS``
  option has been removed.

Signed-off-by: Cary Phillips <cary@ilm.com>

* change $ to % in install.rst

Signed-off-by: Cary Phillips <cary@ilm.com>

* rename docs to website in ci_workflows.yml

Signed-off-by: Cary Phillips <cary@ilm.com>

* mention sphinx_press_theme and rst

Signed-off-by: Cary Phillips <cary@ilm.com>

---------

Signed-off-by: Cary Phillips <cary@ilm.com>
  • Loading branch information
cary-ilm committed Jan 23, 2024
1 parent 60a69b2 commit b7894fe
Show file tree
Hide file tree
Showing 82 changed files with 50 additions and 38 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ jobs:
./bin/ImathTest
# Confirm the examples compile and execute
rm -rf bin CMakeCache.txt CMakeFiles cmake_install.cmake Makefile
cmake ../docs/examples \
cmake ../website/examples \
-DCMAKE_PREFIX_PATH=../../_install \
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
-DCMAKE_CXX_STANDARD=${{ matrix.cxx-standard }} \
Expand Down Expand Up @@ -609,14 +609,14 @@ jobs:
shell: bash
working-directory: _build

Docs:
Website:

# Build the documentation, using a process that mimics the readthedoc build.
#
# Note that this job does not actually build Imath libraries,
# it just runs doxygen and sphinx.

name: 'Docs'
name: 'Website'
runs-on: ubuntu-latest

steps:
Expand All @@ -628,14 +628,14 @@ jobs:
# Need help2man for tool manpages
run: sudo apt-get install -y doxygen help2man
- name: Install sphinx requirements
run: pip3 install -r docs/requirements.txt
run: pip3 install -r website/requirements.txt
- name: Configure
run: cmake .. -DBUILD_DOCS='ON'
run: cmake .. -DBUILD_WEBSITE='ON'
working-directory: _build
- name: Build
run: |
cmake --build . \
--target docs \
--target website \
--config Release
working-directory: _build

4 changes: 2 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ build:
python: "3.9"

sphinx:
configuration: docs/conf.py
configuration: website/conf.py

python:
install:
- requirements: docs/requirements.txt
- requirements: website/requirements.txt
7 changes: 3 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,9 @@ if (PYTHON)
add_subdirectory(src/python)
endif()

option(BUILD_DOCS "Set ON to build readthedocs documentation")
if (BUILD_DOCS AND NOT IMATH_IS_SUBPROJECT)
option(INSTALL_DOCS "Set ON to install html documentation" ON)
add_subdirectory(docs)
option(BUILD_WEBSITE "Set ON to build the readthedocs website source")
if (BUILD_WEBSITE AND NOT IMATH_IS_SUBPROJECT)
add_subdirectory(website)
endif()

# If you want to use ctest to configure, build and
Expand Down
10 changes: 2 additions & 8 deletions docs/CMakeLists.txt → website/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,5 @@ add_custom_command(OUTPUT ${SPHINX_INDEX_FILE}
MAIN_DEPENDENCY conf.py
COMMENT "Generating documentation with Sphinx")

add_custom_target(docs ALL DEPENDS ${SPHINX_INDEX_FILE} ${DOXYGEN_INDEX_FILE})

# Add an install target to install the docs
if(INSTALL_DOCS)
include(GNUInstallDirs)
install(DIRECTORY ${SPHINX_BUILD}
DESTINATION ${CMAKE_INSTALL_DOCDIR})
endif()
add_custom_target(website ALL DEPENDS ${SPHINX_INDEX_FILE} ${DOXYGEN_INDEX_FILE})

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
55 changes: 37 additions & 18 deletions docs/install.rst → website/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,12 @@ To build via CMake, you need to first identify three directories:
libraries and headers, referred to below as ``$installdir``.

To build:

.. code-block::
$ cd $builddir
$ cmake $srcdir --install-prefix $installdir
$ cmake --build $builddir --target install --config Release
% cd $builddir
% cmake $srcdir --install-prefix $installdir
% cmake --build $builddir --target install --config Release
Note that the CMake configuration prefers to apply an out-of-tree
build process, since there may be multiple build configurations
Expand Down Expand Up @@ -102,7 +103,7 @@ can specify a local install directory to cmake via the

.. code-block::
$ cmake .. -DCMAKE_INSTALL_PREFIX=$Imath_install_directory
% cmake .. -DCMAKE_INSTALL_PREFIX=$Imath_install_directory
Library Names
-------------
Expand Down Expand Up @@ -141,27 +142,45 @@ See the :doc:`PortingGuide` for details about differences from previous
releases and how to address them. Also refer to the porting guide for
details about changes to Imath.

Building the Documentation
--------------------------
Building the Website
--------------------

The Imath technical documentation at `https://imath.readthedocs.io
<https://imath.readthedocs.io>`_ is generated via `Sphinx
<https://www.sphinx-doc.org>`_ with the `Breathe
<https://breathe.readthedocs.io>`_ extension using information
extracted from header comments by `Doxygen <https://www.doxygen.nl>`_.

To build the documentation locally from the source headers and
``.rst`` files, set the CMake option ``BUILD_DOCS=ON``. This adds
``Doxygen`` and ``Sphinx`` CMake targets and enables building the docs
by default. generation is off by default.

Building the documentation requires that ``sphinx``, ``breathe``, and
extracted from header comments by `Doxygen <https://www.doxygen.nl>`_,
using the `sphinx-press-theme
<https://pypi.org/project/sphinx-press-theme>`_, and is hosted by
`readthedocs <https://readthedocs.org/projects/openexr>`_. The website
source is in `restructured text
<https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html>`_
in the ``website`` directory.

To build the website locally from the source headers and
``.rst`` files, set the CMake option ``BUILD_WEBSITE=ON``. This adds
``website`` CMake target. Generation is off by default.

Building the website requires that ``sphinx``, ``breathe``, and
``doxygen`` are installed. It further requires the `sphinx-press-theme
<https://pypi.org/project/sphinx-press-theme>`_, as indicated in the
`requirements.txt
<https://pypi.org/project/sphinx-press-theme>`_. Complete dependencies are
described in the `requirements.txt
<https://github.com/AcademySoftwareFoundation/imath/blob/main/docs/requirements.txt>`_
file.

On Debian/Ubuntu Linux:

.. code-block::
% apt-get install doxygen python3-sphinx
% pip3 install breathe
% pip3 install sphinx_press_theme
% mkdir _build
% cd _build
% cmake .. -DBUILD_WEBSITE=ON
% cmake --build . --target website
CMake Build-time Configuration Options
--------------------------------------

Expand All @@ -171,7 +190,7 @@ variables, run:

.. code-block::
$ cmake -LAH $imath_source_directory
% cmake -LAH $imath_source_directory
You can customize these options three ways:

Expand Down Expand Up @@ -306,5 +325,5 @@ initial generation:

.. code-block::
$ cmake -G “Ninja” ..
% cmake -G “Ninja” ..
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit b7894fe

Please sign in to comment.