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

Update documentation setup configuration #99

Merged
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 7 additions & 5 deletions .readthedocs.yaml
Expand Up @@ -5,10 +5,12 @@ sphinx:
builder: html

build:
image: latest
os: "ubuntu-22.04"
tools:
python: "3.11"
apt_packages:
- clang-14
- clang-13
- cmake
- libclang-14-dev
- llvm-14-dev
- llvm-14-tools
- libclang-13-dev
- llvm-13-dev
- llvm-13-tools
2 changes: 1 addition & 1 deletion CMakeLists.txt
Expand Up @@ -355,4 +355,4 @@ if (INTEROP_INCLUDE_DOCS)
endif()

add_subdirectory(lib)
add_subdirectory(unittests)
add_subdirectory(unittests)
27 changes: 27 additions & 0 deletions cmake/FindSphinx.cmake
@@ -0,0 +1,27 @@
# CMake find_package() Module for Sphinx documentation generator
# http://sphinx-doc.org/
#
# Example usage:
#
# find_package(Sphinx)
#
# If successful the following variables will be defined
# SPHINX_FOUND
# SPHINX_EXECUTABLE

find_program(SPHINX_EXECUTABLE
NAMES sphinx-build sphinx-build2
DOC "Path to sphinx-build executable")

# Handle REQUIRED and QUIET arguments
# this will also set SPHINX_FOUND to true if SPHINX_EXECUTABLE exists
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Sphinx
"Failed to locate sphinx-build executable"
SPHINX_EXECUTABLE)

# Provide options for controlling different types of output
option(SPHINX_OUTPUT_HTML "Output standalone HTML files" ON)
option(SPHINX_OUTPUT_MAN "Output man pages" ON)

option(SPHINX_WARNINGS_AS_ERRORS "When building documentation treat warnings as errors" ON)
3 changes: 2 additions & 1 deletion docs/DevelopersDocumentation.rst
Expand Up @@ -32,4 +32,5 @@ CppInterOp Internal Documentation
CppInterOp maintains an internal Doxygen documentation of its components. Internal
documentation aims to capture intrinsic details and overall usage of code
components. The goal of internal documentation is to make the codebase easier
to understand for the new developers.
to understand for the new developers.
Internal documentation can be visited : `here </en/latest/build/html/index.html>`_
28 changes: 23 additions & 5 deletions docs/conf.py
Expand Up @@ -25,15 +25,33 @@
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = 'alabaster'
html_static_path = ['_static']

INTEROP_ROOT = '..'
html_theme_options = {
"github_user": "compiler-research",
"github_repo": "CppInterOp",
"github_banner": True,
"fixed_sidebar": True,
}

# html_extra_path = [INTEROP_ROOT + '/build/docs/doxygen/html']
highlight_language = "C++"

todo_include_todos = True

mathjax_path = "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"

# Add latex physics package
mathjax3_config = {
"loader": {"load": ["[tex]/physics"]},
"tex": {"packages": {"[+]": ["physics"]}},
}

import os
INTEROP_ROOT = os.path.abspath('..')
html_extra_path = [INTEROP_ROOT + '/build/docs/']

import subprocess
command = 'mkdir {0}/build; cd {0}/build; cmake ../ -DClang_DIR=/usr/lib/llvm-14/lib/cmake/clang\
-DLLVM_DIR=/usr/lib/llvm-14 -DINTEROP_ENABLE_DOXYGEN=ON\
command = 'mkdir {0}/build; cd {0}/build; cmake ../ -DClang_DIR=/usr/lib/llvm-13/build/lib/cmake/clang\
-DLLVM_DIR=/usr/lib/llvm-13/build/lib/cmake/llvm -DINTEROP_ENABLE_DOXYGEN=ON\
-DINTEROP_INCLUDE_DOCS=ON'.format(INTEROP_ROOT)
subprocess.call(command, shell=True)
subprocess.call('doxygen {0}/build/docs/doxygen.cfg'.format(INTEROP_ROOT), shell=True)