Skip to content
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

Remove LaTeX documentation from readthedocs #1346

Merged
merged 1 commit into from
Oct 15, 2024
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
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)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a way to get the version automatically? If we don't set the next version anywhere else then nevermind.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We do, in doc/src/conf.py we can use dev and develop for the short and long version in between releases, and then I set them on the release branch. CMakeLists.txt unfortunately doesn't allow that, only real versions.

Would be nice if we could set the version in one place and then inherit it from there. But probably a heavy lift, given that it's only three places.

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
Loading