From 44cbfd888996d55ed22220ae86e2b3c2e8a8c3a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Thu, 5 Apr 2018 16:46:15 +0200 Subject: [PATCH] doc: gathers reference docs inside a directory --- coreapi/help/doc/sphinx/CMakeLists.txt | 19 +++++++++++-------- coreapi/help/doc/sphinx/conf.py.in | 8 ++++---- coreapi/help/doc/sphinx/index.rst | 8 ++++---- coreapi/help/doc/sphinx/toc.rst | 3 --- 4 files changed, 19 insertions(+), 19 deletions(-) delete mode 100644 coreapi/help/doc/sphinx/toc.rst diff --git a/coreapi/help/doc/sphinx/CMakeLists.txt b/coreapi/help/doc/sphinx/CMakeLists.txt index 797ee3f1c..92699653a 100644 --- a/coreapi/help/doc/sphinx/CMakeLists.txt +++ b/coreapi/help/doc/sphinx/CMakeLists.txt @@ -21,7 +21,10 @@ ############################################################################ if (ENABLE_SPHINX_DOC) - set(STATIC_DOCUMENTATION_FILES + set(doc_source_dir ${CMAKE_CURRENT_BINARY_DIR}/source) + set(doc_output_dir ${CMAKE_CURRENT_BINARY_DIR}/build) + set(reference_doc_source_dir ${doc_source_dir}/reference) + set(static_documentation_files guides/authentication.rst guides/buddy_list.rst guides/call_control.rst @@ -42,15 +45,15 @@ if (ENABLE_SPHINX_DOC) samples/samples.rst toc.rst ) - configure_file(conf.py.in source/conf.py) - foreach(file ${STATIC_DOCUMENTATION_FILES}) - configure_file(${file} source/${file} COPYONLY) + configure_file(conf.py.in ${doc_source_dir}/conf.py) + foreach(file ${static_documentation_files}) + configure_file(${file} ${doc_source_dir}/${file} COPYONLY) endforeach(file) foreach(source ${LINPHONE_C_EXAMPLES_SOURCE}) - configure_file(${source} source/samples/ COPYONLY) + configure_file(${source} ${doc_source_dir}/samples/ COPYONLY) endforeach(source) - execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/source/_static) - add_custom_target(sphinx-doc ALL ${PYTHON_EXECUTABLE} '${CMAKE_CURRENT_SOURCE_DIR}/gendoc.py' '${LINPHONE_DOXYGEN_XML_DIR}' -o 'source' - COMMAND ${PYTHON_EXECUTABLE} -msphinx -M html 'source' 'build' + execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${doc_source_dir}/_static ${reference_doc_source_dir}) + add_custom_target(sphinx-doc ALL ${PYTHON_EXECUTABLE} '${CMAKE_CURRENT_SOURCE_DIR}/gendoc.py' '${LINPHONE_DOXYGEN_XML_DIR}' -o '${reference_doc_source_dir}' + COMMAND ${PYTHON_EXECUTABLE} -msphinx -M html '${doc_source_dir}' '${doc_output_dir}' DEPENDS linphone-doc) endif() diff --git a/coreapi/help/doc/sphinx/conf.py.in b/coreapi/help/doc/sphinx/conf.py.in index 492fd8e43..3d903aaf3 100644 --- a/coreapi/help/doc/sphinx/conf.py.in +++ b/coreapi/help/doc/sphinx/conf.py.in @@ -43,7 +43,7 @@ templates_path = ['_templates'] source_suffix = '.rst' # The master toctree document. -master_doc = 'toc' +master_doc = 'index' # General information about the project. project = 'Linphone Core API' @@ -107,9 +107,9 @@ html_logo = 'logo.png' html_experimental_html5_writer = True # Side bar customization -html_sidebars = { - '**': ['searchbox.html', 'globaltoc.html'] -} +#html_sidebars = { +# 'reference/*/*' : ['searchbox.html', 'globaltoc.html'] +#} # -- Options for HTMLHelp output ------------------------------------------ diff --git a/coreapi/help/doc/sphinx/index.rst b/coreapi/help/doc/sphinx/index.rst index 8b6728012..03500afe6 100644 --- a/coreapi/help/doc/sphinx/index.rst +++ b/coreapi/help/doc/sphinx/index.rst @@ -64,7 +64,7 @@ API's reference documentation .. toctree:: :maxdepth: 1 - c/index - cpp/index - java/index - csharp/index + reference/c/index + reference/cpp/index + reference/java/index + reference/csharp/index diff --git a/coreapi/help/doc/sphinx/toc.rst b/coreapi/help/doc/sphinx/toc.rst deleted file mode 100644 index c775b0af9..000000000 --- a/coreapi/help/doc/sphinx/toc.rst +++ /dev/null @@ -1,3 +0,0 @@ -.. toctree:: - - index