From 3fdb97c201fa9e885f1eb0640e17b26c050fec8e Mon Sep 17 00:00:00 2001 From: Simon Rohou Date: Wed, 8 Jan 2025 15:05:58 +0100 Subject: [PATCH] [doc] using Furo style + customization --- doc/manual/_static/css/custom.css | 17 ++-- doc/manual/_static/logos/logo_codac.svg | 117 ++++++++++++++++++++++++ doc/manual/conf.py.in | 35 ++++++- doc/manual/index.rst | 103 +++++++++++---------- doc/manual/installation/cpp.rst | 23 +++++ doc/manual/installation/index.rst | 9 ++ doc/manual/installation/matlab.rst | 12 +++ doc/manual/installation/python.rst | 9 ++ 8 files changed, 267 insertions(+), 58 deletions(-) create mode 100644 doc/manual/_static/logos/logo_codac.svg create mode 100644 doc/manual/installation/cpp.rst create mode 100644 doc/manual/installation/index.rst create mode 100644 doc/manual/installation/matlab.rst create mode 100644 doc/manual/installation/python.rst diff --git a/doc/manual/_static/css/custom.css b/doc/manual/_static/css/custom.css index bf36547f..fbc9b289 100644 --- a/doc/manual/_static/css/custom.css +++ b/doc/manual/_static/css/custom.css @@ -1,10 +1,13 @@ -div.rst-content a:visited -{ - color: #2980b9; - text-decoration: none; +.sidebar-tree .current > .reference { + background: none; } -div.rst-content li.toctree-l1 > a -{ - font-weight: bold; +.sidebar-tree .current-page > .reference { + background: var(--color-sidebar-item-background--current); + font-weight: normal; +} + +a.sidebar-brand { + padding: 2rem 0rem; + padding-right: 1rem; } \ No newline at end of file diff --git a/doc/manual/_static/logos/logo_codac.svg b/doc/manual/_static/logos/logo_codac.svg new file mode 100644 index 00000000..8c13fe08 --- /dev/null +++ b/doc/manual/_static/logos/logo_codac.svg @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/manual/conf.py.in b/doc/manual/conf.py.in index e7d94dab..6f0b1968 100644 --- a/doc/manual/conf.py.in +++ b/doc/manual/conf.py.in @@ -8,13 +8,15 @@ project = 'Codac' copyright = 'Codac Team' -author = 'Codac Team' +author = 'Simon Rohou, BenoƮt Desrochers, Fabrice Le Bars and others' # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration extensions = [ 'sphinx_rtd_theme', + 'sphinx_math_dollar', + 'sphinx.ext.mathjax' ] templates_path = ['_templates'] @@ -25,7 +27,7 @@ exclude_patterns = [] # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output html_static_path = ['_static'] -html_theme = "sphinx_rtd_theme" +html_theme = "furo" html_logo = "_static/logos/logo_codac.svg" # These paths are either relative to html_static_path @@ -35,6 +37,31 @@ html_css_files = [ ] html_theme_options = { - 'logo_only': True, - 'display_version': True, + + "sidebar_hide_name": True, + + "light_css_variables": { + "color-brand-primary": "white", + "color-brand-content": "#1F506B", + + "color-sidebar-background": "#3281AC", + "color-sidebar-caption-text": "white", + "color-sidebar-item-background--current": "var(--color-brand-content)", + "color-sidebar-item-background--hover": "#3B9ACC", + "color-sidebar-item-expander-background--hover": "#3B9ACC", + "color-sidebar-link-text": "white", + "sidebar-caption-font-size": "120%", + + "color-link--visited": "var(--color-link)", + }, + + "announcement": "You are currently reading the new Codac documentation, which is currently in preparation.", +} + +# See https://www.sympy.org/sphinx-math-dollar/ +mathjax3_config = { + "tex": { + "inlineMath": [['\\(', '\\)']], + "displayMath": [["\\[", "\\]"]], + } } \ No newline at end of file diff --git a/doc/manual/index.rst b/doc/manual/index.rst index 1dc36434..97584dbf 100644 --- a/doc/manual/index.rst +++ b/doc/manual/index.rst @@ -1,59 +1,68 @@ Codac manual ============ +Welcome to the Codac website. + -.. toctree:: - :caption: Overview of Codac - :maxdepth: 3 - Constraint programming and IA - The Codac framework - Target audience +.. .. toctree:: +.. :hidden: +.. :caption: Overview of Codac +.. :maxdepth: 3 +.. +.. Intervals and constraints +.. The Codac framework +.. Target audience .. toctree:: + :hidden: :caption: User manual :maxdepth: 2 installation/index.rst - intervals/index.rst - linear/index.rst - functions/index.rst - tubes/index.rst - -.. toctree:: - :maxdepth: 3 - - contractors/index.rst - separators/index.rst - -.. toctree:: - :maxdepth: 2 - - pavers/index.rst - cn/index.rst - geometry/index.rst - ellipsoids/index.rst - topology/index.rst - visualization/index.rst - extensions/index.rst - seealso/index.rst - references/index.rst - - -.. toctree:: - :caption: How-to guides - :maxdepth: 3 - - howto/robotics/index.rst - howto/geometry/index.rst - howto/dynamical/index.rst - - -.. toctree:: - :caption: Development - :maxdepth: 3 - - Changelog - C++ API - Information for developers \ No newline at end of file +.. intervals/index.rst +.. linear/index.rst +.. functions/index.rst +.. tubes/index.rst + +.. .. toctree:: +.. :hidden: +.. :maxdepth: 3 +.. +.. contractors/index.rst +.. separators/index.rst + +.. .. toctree:: +.. :hidden: +.. :maxdepth: 2 +.. +.. pavers/index.rst +.. cn/index.rst +.. geometry/index.rst +.. ellipsoids/index.rst +.. topology/index.rst +.. visualization/index.rst +.. extensions/index.rst +.. seealso/index.rst +.. references/index.rst + + +.. .. toctree:: +.. :hidden: +.. :caption: How-to guides +.. :maxdepth: 3 +.. +.. howto/robotics/index.rst +.. howto/geometry/index.rst +.. howto/dynamical/index.rst + + +.. .. toctree:: +.. :hidden: +.. :caption: Development +.. :maxdepth: 3 +.. +.. Changelog +.. C++ API +.. Information for developers \ No newline at end of file diff --git a/doc/manual/installation/cpp.rst b/doc/manual/installation/cpp.rst new file mode 100644 index 00000000..2c8a414c --- /dev/null +++ b/doc/manual/installation/cpp.rst @@ -0,0 +1,23 @@ +C++ installation +================ + +1. **Dependencies**: Ensure you have CMake (>=3.10) and a C++14 compatible compiler. +2. **Clone the repository**: + + .. code-block:: bash + + git clone https://github.com/codac-team/codac.git + cd codac + +3. **Build the library**: + + .. code-block:: bash + + mkdir build + cd build + cmake .. + make + + +Using Codac in CMake projects +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \ No newline at end of file diff --git a/doc/manual/installation/index.rst b/doc/manual/installation/index.rst new file mode 100644 index 00000000..932dd8f7 --- /dev/null +++ b/doc/manual/installation/index.rst @@ -0,0 +1,9 @@ +Installation Guide +================== + +.. toctree:: + :maxdepth: 1 + + python.rst + cpp.rst + matlab.rst \ No newline at end of file diff --git a/doc/manual/installation/matlab.rst b/doc/manual/installation/matlab.rst new file mode 100644 index 00000000..e19fc884 --- /dev/null +++ b/doc/manual/installation/matlab.rst @@ -0,0 +1,12 @@ +MATLAB installation +=================== + +1. **Dependencies**: Ensure you have MATLAB R2019b or later. +2. **Python integration**: Follow the instructions `here `_ to set up Python integration. +3. **Install the Python package**: + + .. code-block:: bash + + pip install codac + +Once Codac is installed, you can use it in your MATLAB scripts, ensuring proper integration with Python for functionality. \ No newline at end of file diff --git a/doc/manual/installation/python.rst b/doc/manual/installation/python.rst new file mode 100644 index 00000000..f044fdcb --- /dev/null +++ b/doc/manual/installation/python.rst @@ -0,0 +1,9 @@ +Python installation +=================== + +1. **Dependencies**: Ensure you have a supported version of Python (>=3.6). +2. **Install via pip**: Use the following command to install Codac: + + .. code-block:: bash + + pip install codac \ No newline at end of file