Skip to content

Commit

Permalink
Remove latex documentation and fix two formatting errors in doc/sourc…
Browse files Browse the repository at this point in the history
…e/NewSiteConfigs.rst (#1346)
  • Loading branch information
climbfuji authored Oct 15, 2024
1 parent 22a84d3 commit 7db4517
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 86 deletions.
58 changes: 9 additions & 49 deletions doc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
cmake_minimum_required(VERSION 3.18 FATAL_ERROR)

project(spack-stack VERSION 1.3.1)
project(spack-stack VERSION 1.9.0)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/Modules")

option(SPHINX_OUTPUT_HTML "Build HTML documentation" ON)
option(SPHINX_OUTPUT_LATEX "Build LaTeX (PDF) documentation" OFF)

message(STATUS "SPHINX_OUTPUT_HTML: ${SPHINX_OUTPUT_HTML}")
message(STATUS "SPHINX_OUTPUT_LATEX: ${SPHINX_OUTPUT_LATEX}")

find_package(Sphinx REQUIRED)

# configured documentation tools and intermediate build results
Expand All @@ -20,51 +14,17 @@ set(SPHINX_CACHE_DIR "${CMAKE_CURRENT_BINARY_DIR}/_doctrees")

# HTML output directory
set(SPHINX_HTML_DIR "${CMAKE_CURRENT_BINARY_DIR}/html")

# LaTeX output directory
set(SPHINX_PDF_DIR "${CMAKE_CURRENT_BINARY_DIR}/pdf")

configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/source/conf.py"
"${BINARY_BUILD_DIR}/conf.py"
@ONLY)

if(SPHINX_OUTPUT_HTML)
add_custom_target(spack-stack-doc-html ALL
${SPHINX_EXECUTABLE}
-q -b html
-c "${BINARY_BUILD_DIR}"
-d "${SPHINX_CACHE_DIR}"
"${CMAKE_CURRENT_SOURCE_DIR}/source"
"${SPHINX_HTML_DIR}"
COMMENT "Building HTML documentation with Sphinx")
endif()

if(SPHINX_OUTPUT_LATEX)
find_package(LATEX COMPONENTS PDFLATEX REQUIRED)
set(PDF_OUTPUT_FILE "${SPHINX_PDF_DIR}/spack-stack.pdf")
# Create LaTeX input file with Sphinx
add_custom_command(OUTPUT "${SPHINX_PDF_DIR}"
COMMAND "${SPHINX_EXECUTABLE}" -q -b latex
-c "${BINARY_BUILD_DIR}"
-d "${SPHINX_CACHE_DIR}"
"${CMAKE_CURRENT_SOURCE_DIR}/source"
"${SPHINX_PDF_DIR}"
COMMENT "Running Sphinx to generate documentation (LaTeX)"
VERBATIM
)
# Create PDF output file with pdflatex
add_custom_command(OUTPUT "${PDF_OUTPUT_FILE}"
COMMAND "${CMAKE_MAKE_PROGRAM}" all-pdf
WORKING_DIRECTORY "${SPHINX_PDF_DIR}"
DEPENDS "${SPHINX_PDF_DIR}"
COMMENT "Generating PDF version of documentation"
VERBATIM
)
#
add_custom_target(spack-stack-doc-pdf ALL
COMMENT "Generating PDF version of documentation ..."
SOURCES "${PDF_OUTPUT_FILE}"
VERBATIM
)
endif()
add_custom_target(spack-stack-doc-html ALL
${SPHINX_EXECUTABLE}
-q -b html
-c "${BINARY_BUILD_DIR}"
-d "${SPHINX_CACHE_DIR}"
"${CMAKE_CURRENT_SOURCE_DIR}/source"
"${SPHINX_HTML_DIR}"
COMMENT "Building HTML documentation with Sphinx")
1 change: 0 additions & 1 deletion doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
sphinxcontrib-bibtex
urllib3<2
4 changes: 3 additions & 1 deletion doc/source/NewSiteConfigs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ These instructions are meant to be a reference that users can follow to set up t
Make sure you upgrade cmake in homebrew.

.. code-block:: console
brew upgrade cmake
brew upgrade cmake
4. Configure your terminal to use the homebrew installed bash

Expand Down Expand Up @@ -671,6 +672,7 @@ With all of that in mind, the following instructions were used on an Amazon Web
3. Load the correct module shipped with ``nvhpc-24-3``. Note that this is only required for ``spack`` to detect the compiler and ``openmpi`` library during the environment configuration below. It is not required when using the new environment to compile code.

.. code-block:: console
module purge
module use /opt/nvidia/hpc_sdk/modulefiles
module load nvhpc-openmpi3/24.3
Expand Down
36 changes: 1 addition & 35 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,9 @@
'sphinx.ext.ifconfig',
'sphinx.ext.viewcode',
'sphinx.ext.githubpages',
'sphinx.ext.napoleon',
'sphinxcontrib.bibtex'
'sphinx.ext.napoleon'
]

bibtex_bibfiles = []

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

Expand Down Expand Up @@ -124,37 +121,6 @@
htmlhelp_basename = 'spack-stack'


# -- Options for LaTeX output ------------------------------------------------

latex_engine = 'pdflatex'
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
'maketitle': r'\newcommand\sphinxbackoftitlepage{For referencing this document please use: \newline \break Heinzeller, D., A. Richert, C. Book, E. Hartnett, H. Lei, N. Perlin, R. Vasic, S. Herbener, 2024. spack-stack documentation develop. Available at https://spack-stack.readthedocs.io/\textunderscore/downloads/en/latest/pdf/.}\sphinxmaketitle'
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'spack-stack.tex', 'spack-stack documentation',
author,'manual'),
]


# -- Options for manual page output ------------------------------------------

# One entry per manual page. List of tuples
Expand Down

0 comments on commit 7db4517

Please sign in to comment.