Skip to content

Commit

Permalink
with initial docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mhekkel committed Sep 25, 2023
1 parent 783af59 commit 50931e7
Show file tree
Hide file tree
Showing 9 changed files with 179 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ set(CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

option(BUILD_DOCUMENTATION "Build the documentation" OFF)

if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers")
elseif(MSVC)
Expand Down Expand Up @@ -202,4 +204,8 @@ if(NOT USE_RSRC)
${PROJECT_SOURCE_DIR}/docroot
DESTINATION ${ALPHAFILL_DATA_DIR}
)
endif()

if(BUILD_DOCUMENTATION)
add_subdirectory(docs)
endif()
11 changes: 11 additions & 0 deletions cmake/FindSphinx.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#Look for an executable called sphinx-build
find_program(SPHINX_EXECUTABLE
NAMES sphinx-build
DOC "Path to sphinx-build executable")

include(FindPackageHandleStandardArgs)

#Handle standard arguments to find_package like REQUIRED and QUIET
find_package_handle_standard_args(Sphinx
"Failed to find sphinx-build executable"
SPHINX_EXECUTABLE)
16 changes: 16 additions & 0 deletions docs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
find_package(Sphinx REQUIRED)

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/conf.py.in ${CMAKE_CURRENT_SOURCE_DIR}/conf.py @ONLY)

set(SPHINX_SOURCE ${CMAKE_CURRENT_SOURCE_DIR})
set(SPHINX_BUILD ${CMAKE_CURRENT_BINARY_DIR}/sphinx)

add_custom_target("Sphinx-${PROJECT_NAME}" ALL
COMMAND ${SPHINX_EXECUTABLE} -b html
${SPHINX_SOURCE} ${SPHINX_BUILD}
COMMENT "Generating documentation with Sphinx")

install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/sphinx/
DESTINATION ${CMAKE_INSTALL_DOCDIR}
PATTERN .doctrees EXCLUDE
PATTERN .buildinfo EXCLUDE)
4 changes: 4 additions & 0 deletions docs/_static/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore
29 changes: 29 additions & 0 deletions docs/conf.py.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
project = '@PROJECT_NAME@'
copyright = '2023, Maarten L. Hekkelman'
author = 'Maarten L. Hekkelman'
release = '@PROJECT_VERSION@'

# -- General configuration ---------------------------------------------------

#extensions = [
# "myst_parser"
#]

templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'

# 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_theme_options = {
}

2 changes: 2 additions & 0 deletions docs/genindex.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Index
=====
13 changes: 13 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Introduction
============

.. literalinclude:: ../README.md
:language: md

.. toctree::
:maxdepth: 2
:caption: Contents

self
genindex.rst

5 changes: 5 additions & 0 deletions docs/requirements.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
sphinx<5
exhale==0.3.6
myst-parser
breathe
sphinx_rtd_theme==1.3.0
93 changes: 93 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
#
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile --output-file=requirements.txt requirements.in
#
alabaster==0.7.13
# via sphinx
babel==2.12.1
# via sphinx
beautifulsoup4==4.12.2
# via exhale
breathe==4.35.0
# via
# -r requirements.in
# exhale
certifi==2023.7.22
# via requests
charset-normalizer==3.2.0
# via requests
docutils==0.17.1
# via
# breathe
# exhale
# myst-parser
# sphinx
# sphinx-rtd-theme
exhale==0.3.6
# via -r requirements.in
idna==3.4
# via requests
imagesize==1.4.1
# via sphinx
jinja2==3.1.2
# via
# myst-parser
# sphinx
lxml==4.9.3
# via exhale
markdown-it-py==2.2.0
# via
# mdit-py-plugins
# myst-parser
markupsafe==2.1.3
# via jinja2
mdit-py-plugins==0.3.5
# via myst-parser
mdurl==0.1.2
# via markdown-it-py
myst-parser==0.18.1
# via -r requirements.in
packaging==23.1
# via sphinx
pygments==2.16.1
# via sphinx
pyyaml==6.0.1
# via myst-parser
requests==2.31.0
# via sphinx
six==1.16.0
# via exhale
snowballstemmer==2.2.0
# via sphinx
soupsieve==2.4.1
# via beautifulsoup4
sphinx==4.5.0
# via
# -r requirements.in
# breathe
# exhale
# myst-parser
# sphinx-rtd-theme
# sphinxcontrib-jquery
sphinx-rtd-theme==1.3.0
# via -r requirements.in
sphinxcontrib-applehelp==1.0.4
# via sphinx
sphinxcontrib-devhelp==1.0.2
# via sphinx
sphinxcontrib-htmlhelp==2.0.1
# via sphinx
sphinxcontrib-jquery==4.1
# via sphinx-rtd-theme
sphinxcontrib-jsmath==1.0.1
# via sphinx
sphinxcontrib-qthelp==1.0.3
# via sphinx
sphinxcontrib-serializinghtml==1.1.5
# via sphinx
typing-extensions==4.7.1
# via myst-parser
urllib3==2.0.4
# via requests

0 comments on commit 50931e7

Please sign in to comment.