Changeset: 0a5cbf304d2b for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0a5cbf304d2b
Added Files:
        cmake/Modules/FindSphinx.cmake
        documentation/CMakeLists.txt
        documentation/conf.py.in
Modified Files:
        CMakeLists.txt
        tools/monetdbe/monetdbe.c
Branch: default
Log Message:

add documentation generation using sphinx


diffs (142 lines):

diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -177,6 +177,7 @@ include(monetdb-packages)
 
 include(CTest)
 add_subdirectory(ctest)
+add_subdirectory(documentation)
 
 if(CMAKE_SUMMARY)
   monetdb_cmake_summary()
diff --git a/cmake/Modules/FindSphinx.cmake b/cmake/Modules/FindSphinx.cmake
new file mode 100644
--- /dev/null
+++ b/cmake/Modules/FindSphinx.cmake
@@ -0,0 +1,14 @@
+find_program(SPHINX_EXECUTABLE NAMES sphinx-build
+    HINTS
+    $ENV{SPHINX_DIR}
+    PATH_SUFFIXES bin
+    DOC "Sphinx documentation generator"
+)
+ 
+include(FindPackageHandleStandardArgs)
+ 
+find_package_handle_standard_args(Sphinx DEFAULT_MSG
+    SPHINX_EXECUTABLE
+)
+ 
+mark_as_advanced(SPHINX_EXECUTABLE)
diff --git a/documentation/CMakeLists.txt b/documentation/CMakeLists.txt
new file mode 100644
--- /dev/null
+++ b/documentation/CMakeLists.txt
@@ -0,0 +1,32 @@
+find_package(Sphinx REQUIRED)
+ 
+if(NOT DEFINED SPHINX_THEME)
+    set(SPHINX_THEME default)
+endif()
+ 
+if(NOT DEFINED SPHINX_THEME_DIR)
+    set(SPHINX_THEME_DIR)
+endif()
+ 
+# configured documentation tools and intermediate build results
+set(BINARY_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/_build")
+ 
+# Sphinx cache with pickled ReST documents
+set(SPHINX_CACHE_DIR "${CMAKE_CURRENT_BINARY_DIR}/_doctrees")
+ 
+# HTML output directory
+set(SPHINX_HTML_DIR "${CMAKE_CURRENT_BINARY_DIR}/html")
+ 
+configure_file(
+    "${CMAKE_CURRENT_SOURCE_DIR}/conf.py.in"
+    "${BINARY_BUILD_DIR}/conf.py"
+    @ONLY)
+ 
+add_custom_target(documentation ALL
+    ${SPHINX_EXECUTABLE}
+        -q -b html
+        -c "${BINARY_BUILD_DIR}"
+        -d "${SPHINX_CACHE_DIR}"
+        "${CMAKE_CURRENT_SOURCE_DIR}"
+        "${SPHINX_HTML_DIR}"
+    COMMENT "Building HTML documentation with Sphinx")
diff --git a/documentation/conf.py.in b/documentation/conf.py.in
new file mode 100644
--- /dev/null
+++ b/documentation/conf.py.in
@@ -0,0 +1,57 @@
+# Configuration file for the Sphinx documentation builder.
+#
+# This file only contains a selection of the most common options. For a full
+# list see the documentation:
+# https://www.sphinx-doc.org/en/master/usage/configuration.html
+
+# -- Path setup --------------------------------------------------------------
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+#
+# import os
+# import sys
+# sys.path.insert(0, os.path.abspath('.'))
+
+
+# -- Project information -----------------------------------------------------
+
+project = 'monetdbe'
+copyright = '2020, MonetDB Solutions'
+author = ''
+
+# The full version, including alpha/beta/rc tags
+release = '0.1'
+
+# -- General configuration ---------------------------------------------------
+
+# Add any Sphinx extension module names here, as strings. They can be
+# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
+# ones.
+extensions = [
+]
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+# This pattern also affects html_static_path and html_extra_path.
+exclude_patterns = []
+
+# This is needed to keep readthedocs happy
+master_doc = 'index'
+
+
+# -- 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 = 'alabaster'
+
+# 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']
diff --git a/tools/monetdbe/monetdbe.c b/tools/monetdbe/monetdbe.c
--- a/tools/monetdbe/monetdbe.c
+++ b/tools/monetdbe/monetdbe.c
@@ -221,6 +221,9 @@ monetdbe_query_internal(monetdbe_databas
        bstream *old_bstream = NULL;
        stream *fdout = c->fdout;
 
+       if (result)
+               *result = NULL;
+
        if ((msg = validate_database_handle(dbhdl, 
"monetdbe.monetdbe_query_internal")) != MAL_SUCCEED)
                return msg;
 
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to