From 9a0096d07c7326315066e055a7f74eccbe6cdb4a Mon Sep 17 00:00:00 2001 From: Daniel Molkentin Date: Mon, 2 Sep 2013 14:01:15 +0200 Subject: [PATCH] Docs: Allow to build with org and com branding --- .gitignore | 1 + .gitmodules | 3 +++ doc/CMakeLists.txt | 20 +++++++++++++++++++- doc/conf.py.in | 6 +++--- doc/ocdoc | 1 + 5 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 .gitmodules create mode 160000 doc/ocdoc diff --git a/.gitignore b/.gitignore index bf0b7b058..e8a754cc8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.gitmodules *build*/ *flymake* CMakeLists.txt.user* diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..073864fee --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "doc/ocdoc"] + path = doc/ocdoc + url = https://github.com/owncloud/documentation diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index bd32a1659..c6c076cba 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -22,6 +22,11 @@ if(SPHINX_FOUND) add_custom_target(doc DEPENDS doc-html doc-man COMMENT "Building documentation...") endif(WITH_DOC) + if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/ocdoc") + add_dependencies(doc doc-html-org) + add_dependencies(doc doc-html-com) + endif() + if(PDFLATEX_FOUND) # if this still fails on Debian/Ubuntu, run # apt-get install texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended @@ -55,8 +60,21 @@ if(SPHINX_FOUND) add_custom_target( doc-html ${SPHINX_EXECUTABLE} -q -c . -b html -d ${SPHINX_CACHE_DIR}/html + -D html_theme=owncloud_org ${CMAKE_CURRENT_SOURCE_DIR} - ${SPHINX_HTML_DIR} ) + ${SPHINX_HTML_DIR}/unthemed ) + add_custom_target( doc-html-org ${SPHINX_EXECUTABLE} + -q -c . -b html + -d ${SPHINX_CACHE_DIR}/html + -D html_theme=owncloud_org + ${CMAKE_CURRENT_SOURCE_DIR} + ${SPHINX_HTML_DIR}/org ) + add_custom_target( doc-html-com ${SPHINX_EXECUTABLE} + -q -c . -b html + -d ${SPHINX_CACHE_DIR}/html + -D html_theme=owncloud_com + ${CMAKE_CURRENT_SOURCE_DIR} + ${SPHINX_HTML_DIR}/com ) add_custom_target( doc-man ${SPHINX_EXECUTABLE} -q -c . -b man -d ${SPHINX_CACHE_DIR}/man diff --git a/doc/conf.py.in b/doc/conf.py.in index f61376e7c..f7208ceb9 100644 --- a/doc/conf.py.in +++ b/doc/conf.py.in @@ -28,7 +28,7 @@ import sys, os extensions = ['sphinx.ext.todo'] # Add any paths that contain templates here, relative to this directory. -#templates_path = ['templates'] +templates_path = ['@CMAKE_CURRENT_SOURCE_DIR@/ocdoc/_shared_assets/templates'] # The suffix of source filenames. source_suffix = '.rst' @@ -95,7 +95,7 @@ pygments_style = 'sphinx' #html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. -#html_theme_path = ['themes'] +html_theme_path = ['@CMAKE_CURRENT_SOURCE_DIR@/ocdoc/_shared_assets/themes'] # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. @@ -120,7 +120,7 @@ html_short_title = "Client Manual" # 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_static_path = ['@CMAKE_CURRENT_SOURCE_DIR@/ocdoc/_shared_assets/static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. diff --git a/doc/ocdoc b/doc/ocdoc new file mode 160000 index 000000000..2c3e584b2 --- /dev/null +++ b/doc/ocdoc @@ -0,0 +1 @@ +Subproject commit 2c3e584b2356dc4324e6e0720b7aa908aaa480a3