Skip to content

Commit

Permalink
Rename "docs" to "website"
Browse files Browse the repository at this point in the history
"website" is a more accurate term for the majority of the content that
has been under ``docs``, with the exception of the tool manpages, so:

- The website source now lives in the ``website`` subdirectory (was ``docs``)
- The CMake option is now ``BUILD_WEBSITE`` (was ``BUILD_DOCS``)
- The new CMake target ``website`` now builds the website source (via doxygen, sphinx, etc)
- The CI job is called "Website" (was ``Docs``)
- The CMake target ``Docs`` now installs just the tool manpages
- The CMake option ``OPENEXR_INSTALL_DOCS`` controls whether to install the manpages, and defaults to OFF

Signed-off-by: Cary Phillips <[email protected]>
  • Loading branch information
cary-ilm committed Jul 30, 2023
1 parent cfd1c76 commit f5f4155
Show file tree
Hide file tree
Showing 114 changed files with 115 additions and 98 deletions.
28 changes: 16 additions & 12 deletions .github/workflows/ci_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ jobs:
mkdir _install
mkdir _build
mkdir _examples
- name: Install help2man
run: sudo apt-get install -y help2man
- name: Configure
run: |
cmake .. \
Expand All @@ -230,7 +232,8 @@ jobs:
-DCMAKE_CXX_FLAGS=${{ matrix.cxx-flags }} \
-DCMAKE_VERBOSE_MAKEFILE:BOOL='OFF' \
-DBUILD_SHARED_LIBS=${{ matrix.build-shared }} \
-DOPENEXR_BUILD_TOOLS='ON' \
-DOPENEXR_INSTALL_TOOLS='ON' \
-DOPENEXR_INSTALL_DOCS='ON' \
-DOPENEXR_RUN_FUZZ_TESTS='OFF' \
-DOPENEXR_ENABLE_THREADING=${{ matrix.threads-enabled }}
working-directory: _build
Expand Down Expand Up @@ -363,7 +366,8 @@ jobs:
-DCMAKE_CXX_FLAGS=${{ matrix.cxx-flags }} \
-DCMAKE_VERBOSE_MAKEFILE:BOOL='OFF' \
-DBUILD_SHARED_LIBS=${{ matrix.build-shared }} \
-DOPENEXR_BUILD_TOOLS='ON' \
-DOPENEXR_INSTALL_TOOLS='ON' \
-DOPENEXR_INSTALL_DOCS='OFF' \
-DOPENEXR_RUN_FUZZ_TESTS='OFF'
working-directory: _build
- name: Build
Expand Down Expand Up @@ -497,7 +501,8 @@ jobs:
-DCMAKE_CXX_FLAGS=${{ matrix.cxx-flags }} \
-DCMAKE_VERBOSE_MAKEFILE:BOOL='OFF' \
-DBUILD_SHARED_LIBS=${{ matrix.build-shared }} \
-DOPENEXR_BUILD_TOOLS='ON' \
-DOPENEXR_INSTALL_TOOLS='ON' \
-DOPENEXR_INSTALL_DOCS='OFF' \
-DOPENEXR_RUN_FUZZ_TESTS='OFF'
shell: bash
working-directory: _build
Expand Down Expand Up @@ -534,16 +539,16 @@ jobs:
shell: bash
working-directory: _build

Docs:
Website:

# Build the documentation, using a process that mimics the readthedoc build.
# Build the website, using a process that mimics the readthedoc build.
#
# Note that this job does not actually build OpenEXR libraries or
# programs, it just runs doxygen, sphinx, and the
# docs/script/test_images.py script to generate the "Test Images"
# website/script/test_images.py script to generate the "Test Images"
# page.

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

steps:
Expand All @@ -554,17 +559,16 @@ jobs:
- name: Install doxygen & imagemagick
# Need imagemagick for convert, to convert "Test Image" exrs to jpgs
# Need openexr for exrheader
# Need help2man for tool manpages
run: sudo apt-get install -y doxygen imagemagick openexr help2man
run: sudo apt-get install -y doxygen imagemagick openexr
- 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

6 changes: 3 additions & 3 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ build:
- openexr # for exrheader, for test images
jobs:
pre_build:
- python docs/scripts/test_images.py
- python website/scripts/test_images.py

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

python:
install:
- requirements: docs/requirements.txt
- requirements: website/requirements.txt
10 changes: 7 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,13 @@ if(NOT OPENEXR_IS_SUBPROJECT)
include(cmake/clang-format.cmake)
endif()

option(BUILD_DOCS "Set ON to build html documentation")
if (BUILD_DOCS AND NOT OPENEXR_IS_SUBPROJECT)
option(INSTALL_DOCS "Set ON to install html documentation" ON)
option(OPENEXR_INSTALL_DOCS "Set ON to install tool manpages")
if (OPENEXR_INSTALL_DOCS AND NOT OPENEXR_IS_SUBPROJECT)
add_subdirectory(docs)
endif()

option(BUILD_WEBSITE "Set ON to build website source")
if (BUILD_WEBSITE AND NOT OPENEXR_IS_SUBPROJECT)
add_subdirectory(website)
endif()

2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ submitted, in order to solicit feedback, try to get as much consensus
as possible, and alert all the stakeholders to be on the lookout for
the eventual PR when it appears.

* Trivial changes that don't affect functionality (typos, docs, tests)
* Trivial changes that don't affect functionality (typos, tests, website)
can be approved by the committer without review, after waiting at
least 48 hours.

Expand Down
2 changes: 1 addition & 1 deletion cmake/OpenEXRConfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@

/// \defgroup ExportMacros Macros to manage symbol visibility
///
/// See docs/SymbolVisibility.md for more discussion about the
/// See website/SymbolVisibility.rst for more discussion about the
/// motivation for these macros
///
/// If we are compiling a DLL for Windows, there needs to be custom
Expand Down
68 changes: 4 additions & 64 deletions docs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,73 +3,16 @@

set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})

find_package(Doxygen REQUIRED)
find_package(Sphinx REQUIRED)

include(FindPythonPackage)
find_python_package(sphinx-press-theme REQUIRED)

set(DOXYGEN_INPUT_DIR ${PROJECT_SOURCE_DIR}/src/lib/OpenEXRCore)
set(DOXYGEN_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/doxygen)
set(DOXYGEN_INDEX_FILE ${DOXYGEN_OUTPUT_DIR}/html/index.html)
set(DOXYFILE_IN ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in)
set(DOXYFILE_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)

set(SPHINX_SOURCE ${CMAKE_CURRENT_SOURCE_DIR})
set(SPHINX_BUILD ${CMAKE_CURRENT_BINARY_DIR}/sphinx)
set(SPHINX_INDEX_FILE ${SPHINX_BUILD}/index.html)

set(SPHINX_OPTS "-W" CACHE STRING "Sphinx build options")

set(OPENEXR_TEST_IMAGE_REPO "https://raw.githubusercontent.com/AcademySoftwareFoundation/openexr-images"
CACHE STRING "Repo for test images")
set(OPENEXR_TEST_IMAGE_TAG "main"
CACHE STRING "Tag for test image repo")

set(TEST_IMAGE_INDEX_FILE ${PROJECT_SOURCE_DIR}/docs/_test_images/index.rst)
set(TEST_IMAGE_PY_FILE ${PROJECT_SOURCE_DIR}/docs/scripts/test_images.py)
set(TEST_IMAGE_INPUT_FILE ${PROJECT_SOURCE_DIR}/docs/test_images.txt)
configure_file(${DOXYFILE_IN} ${DOXYFILE_OUT} @ONLY)

file(MAKE_DIRECTORY ${DOXYGEN_OUTPUT_DIR})

add_custom_command(OUTPUT ${DOXYGEN_INDEX_FILE}
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYFILE_OUT}
MAIN_DEPENDENCY ${DOXYFILE_OUT} ${DOXYFILE_IN}
COMMENT "Running doxygen"
VERBATIM)

add_custom_command(OUTPUT ${TEST_IMAGE_INDEX_FILE}
# run the test_images.py script with the PATH set
# to include the build's bin directory, to pick up
# the local bin/exrheader executable
COMMAND ${CMAKE_COMMAND} -E env "PATH=${CMAKE_CURRENT_BINARY_DIR}/../bin:$ENV{PATH}"
${Python3_EXECUTABLE} ${TEST_IMAGE_PY_FILE} ${OPENEXR_TEST_IMAGE_REPO} ${OPENEXR_TEST_IMAGE_TAG}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
DEPENDS
${TEST_IMAGE_PY_FILE} ${TEST_IMAGE_INPUT_FILE}
COMMENT "Generating test image pages"
VERBATIM)

add_custom_command(OUTPUT ${SPHINX_INDEX_FILE}
COMMAND
${SPHINX_EXECUTABLE} -b html ${SPHINX_OPTS}
# Tell Breathe where to find the Doxygen output
-Dbreathe_projects.OpenEXR=${DOXYGEN_OUTPUT_DIR}/xml
${SPHINX_SOURCE} ${SPHINX_BUILD}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS ${DOXYGEN_INDEX_FILE} ${TEST_IMAGE_INDEX_FILE} ${TEST_IMAGE_PY_FILE} ${TEST_IMAGE_INPUT_FILE}
MAIN_DEPENDENCY ${SPHINX_CONF_PY_FILE}
COMMENT "Generating documentation with Sphinx")


# man pages for the bin programs

find_program(HELP2MAN help2man)

set(MANPAGE_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/man)
file(MAKE_DIRECTORY ${MANPAGE_OUTPUT_DIR}/man1)

message(STATUS "MANPAGE_OUTPUT_DIR=${MANPAGE_OUTPUT_DIR}")
message(STATUS "CMAKE_INSTALL_MANDIR=${CMAKE_INSTALL_MANDIR}")

set(manpage_files "")

function(DEFINE_MANPAGE tool description)
Expand Down Expand Up @@ -103,12 +46,9 @@ define_manpage(exrmultiview "convert between single/multi-view exr images")
define_manpage(exrstdattr "set exr image metadata")

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

# Add a target to install the manpages, but *not* the html
# Add a target to install the manpages

if(INSTALL_DOCS)
include(GNUInstallDirs)
Expand Down
2 changes: 1 addition & 1 deletion src/lib/IlmThread/IlmThreadExport.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include "OpenEXRConfig.h"

// See docs/SymbolVisibility.md for more discussion
// See website/SymbolVisibility.rst for more discussion

/// \addtogroup ExportMacros
/// @{
Expand Down
File renamed without changes.
69 changes: 69 additions & 0 deletions website/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright Contributors to the OpenEXR Project.

set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})

find_package(Doxygen REQUIRED)
find_package(Sphinx REQUIRED)

include(FindPythonPackage)
find_python_package(sphinx-press-theme REQUIRED)

set(DOXYGEN_INPUT_DIR ${PROJECT_SOURCE_DIR}/src/lib/OpenEXRCore)
set(DOXYGEN_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/doxygen)
set(DOXYGEN_INDEX_FILE ${DOXYGEN_OUTPUT_DIR}/html/index.html)
set(DOXYFILE_IN ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in)
set(DOXYFILE_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)

set(SPHINX_SOURCE ${CMAKE_CURRENT_SOURCE_DIR})
set(SPHINX_BUILD ${CMAKE_CURRENT_BINARY_DIR}/sphinx)
set(SPHINX_INDEX_FILE ${SPHINX_BUILD}/index.html)

set(SPHINX_OPTS "-W" CACHE STRING "Sphinx build options")

set(OPENEXR_TEST_IMAGE_REPO "https://raw.githubusercontent.com/AcademySoftwareFoundation/openexr-images"
CACHE STRING "Repo for test images")
set(OPENEXR_TEST_IMAGE_TAG "main"
CACHE STRING "Tag for test image repo")

set(TEST_IMAGE_INDEX_FILE ${PROJECT_SOURCE_DIR}/website/_test_images/index.rst)
set(TEST_IMAGE_PY_FILE ${PROJECT_SOURCE_DIR}/website/scripts/test_images.py)
set(TEST_IMAGE_INPUT_FILE ${PROJECT_SOURCE_DIR}/website/test_images.txt)
configure_file(${DOXYFILE_IN} ${DOXYFILE_OUT} @ONLY)

file(MAKE_DIRECTORY ${DOXYGEN_OUTPUT_DIR})

add_custom_command(OUTPUT ${DOXYGEN_INDEX_FILE}
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYFILE_OUT}
MAIN_DEPENDENCY ${DOXYFILE_OUT} ${DOXYFILE_IN}
COMMENT "Running doxygen"
VERBATIM)

add_custom_command(OUTPUT ${TEST_IMAGE_INDEX_FILE}
# run the test_images.py script with the PATH set
# to include the build's bin directory, to pick up
# the local bin/exrheader executable
COMMAND ${CMAKE_COMMAND} -E env "PATH=${CMAKE_CURRENT_BINARY_DIR}/../bin:$ENV{PATH}"
${Python3_EXECUTABLE} ${TEST_IMAGE_PY_FILE} ${OPENEXR_TEST_IMAGE_REPO} ${OPENEXR_TEST_IMAGE_TAG}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
DEPENDS
${TEST_IMAGE_PY_FILE} ${TEST_IMAGE_INPUT_FILE}
COMMENT "Generating test image pages"
VERBATIM)

add_custom_command(OUTPUT ${SPHINX_INDEX_FILE}
COMMAND
${SPHINX_EXECUTABLE} -b html ${SPHINX_OPTS}
# Tell Breathe where to find the Doxygen output
-Dbreathe_projects.OpenEXR=${DOXYGEN_OUTPUT_DIR}/xml
${SPHINX_SOURCE} ${SPHINX_BUILD}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS ${DOXYGEN_INDEX_FILE} ${TEST_IMAGE_INDEX_FILE} ${TEST_IMAGE_PY_FILE} ${TEST_IMAGE_INPUT_FILE}
MAIN_DEPENDENCY ${SPHINX_CONF_PY_FILE}
COMMENT "Generating documentation with Sphinx")

add_custom_target(website ALL DEPENDS
${SPHINX_INDEX_FILE}
${DOXYGEN_INDEX_FILE}
${TEST_IMAGE_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.
4 changes: 2 additions & 2 deletions docs/install.rst → website/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ 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 OpenEXR technical documentation at `https://openexr.readthedocs.io
<https://openexr.readthedocs.io>`_ is generated via `Sphinx
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 11 additions & 11 deletions docs/scripts/test_images.py → website/scripts/test_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
# Generate the "Test Images" page for the openexr.com website
#
# The file "docs/test_images.txt" contains urls for either .exr files
# The file "website/test_images.txt" contains urls for either .exr files
# or README.txt files from
# https://github.com/AcademySoftwareFoundation/openexr-images. This
# script processes them into .rst files with a main index listing all
Expand All @@ -24,7 +24,7 @@
# Note that the README.rst files in the openexr-images repo are never
# actually processed directly by sphinx.
#
# The generated .rst and .jpg files all go in the "docs/_test_images"
# The generated .rst and .jpg files all go in the "website/_test_images"
# directory underneath the source root. Ideally, these would go in the
# build root, but sphinx expects all source content under a single
# root.
Expand Down Expand Up @@ -293,19 +293,19 @@ def write_exr_to_index(index_file, repo, tag, exr_lpath, readme):

# Examples:
# repo = 'https://raw.githubusercontent.com/cary-ilm/openexr-images'
# tag = 'docs'
# tag = 'website'
# exr_lpath = v2/LeftView/Ground.exr

test_images = 'docs/_test_images/'
output_dirname = test_images + os.path.dirname(exr_lpath) # docs/_test_images/v2/LeftView
test_images = 'website/_test_images/'
output_dirname = test_images + os.path.dirname(exr_lpath) # website/_test_images/v2/LeftView
os.makedirs(output_dirname, exist_ok=True)
base_path = os.path.splitext(exr_lpath)[0] # v2/LeftView/Ground
exr_filename = os.path.basename(exr_lpath) # Ground.exr
exr_basename = os.path.splitext(exr_filename)[0] # Ground
exr_dirname = os.path.dirname(exr_lpath) # v2/LeftView
rst_lpath = f'{test_images}{exr_dirname}/{exr_basename}.rst' # docs/_test_images/v2/LeftView/Ground.rst
rst_lpath = f'{test_images}{exr_dirname}/{exr_basename}.rst' # website/_test_images/v2/LeftView/Ground.rst
jpg_rpath = f'{exr_dirname}/{exr_dirname.replace("/", "_")}_{exr_basename}.jpg'
jpg_lpath = test_images + jpg_rpath # docs/_test_images/v2/LeftView/Ground.K@#YSDF.jpg
jpg_lpath = test_images + jpg_rpath # website/_test_images/v2/LeftView/Ground.K@#YSDF.jpg

exr_url = f'{repo}/{tag}/{exr_lpath}'

Expand Down Expand Up @@ -401,9 +401,9 @@ def write_table_close(index_file):

try:

os.makedirs('docs/_test_images', exist_ok=True)
os.makedirs('website/_test_images', exist_ok=True)

with open('docs/_test_images/index.rst', 'w') as index_file:
with open('website/_test_images/index.rst', 'w') as index_file:

index_file.write('Test Images\n')
index_file.write('###########\n')
Expand All @@ -421,7 +421,7 @@ def write_table_close(index_file):

# Process each url in the .txt file

with open('docs/test_images.txt', 'r') as test_images_file:
with open('website/test_images.txt', 'r') as test_images_file:
for line in test_images_file.readlines():

if line.startswith('#'):
Expand Down Expand Up @@ -452,7 +452,7 @@ def write_table_close(index_file):

# Write the toctree file, one entry per .exr page

with open('docs/_test_images/toctree.rst', 'w') as toctree_file:
with open('website/_test_images/toctree.rst', 'w') as toctree_file:
toctree_file.write('..\n')
toctree_file.write(' SPDX-License-Identifier: BSD-3-Clause\n')
toctree_file.write(' Copyright Contributors to the OpenEXR Project.\n')
Expand Down
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.

0 comments on commit f5f4155

Please sign in to comment.