diff --git a/.circleci/config.yml b/.circleci/config.yml index b5f679af6..8990d3f22 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -24,6 +24,7 @@ jobs: - NUMPYDOC_VERSION: 'latest' - SPHINXCONTRIB_BIBTEX_VERSION: 'latest' - PYDATA_SPHINX_THEME_VERSION: 'latest' + - SPHINX_DESIGN_VERSION: 'latest' steps: - add_ssh_keys: fingerprints: diff --git a/build_tools/circle/build_doc.sh b/build_tools/circle/build_doc.sh index 32699e8a8..9601b44aa 100755 --- a/build_tools/circle/build_doc.sh +++ b/build_tools/circle/build_doc.sh @@ -114,6 +114,7 @@ mamba create -n $CONDA_ENV_NAME --yes --quiet \ "$(get_dep sphinxcontrib-bibtex $SPHINXCONTRIB_BIBTEX_VERSION)" \ "$(get_dep sphinx-copybutton $SPHINXCONTRIB_BIBTEX_VERSION)" \ "$(get_dep pydata-sphinx-theme $PYDATA_SPHINX_THEME_VERSION)" \ + "$(get_dep sphinx-design $SPHINX_DESIGN_VERSION)" \ memory_profiler packaging seaborn pytest coverage compilers tensorflow source activate $CONDA_ENV_NAME diff --git a/doc/_static/css/imbalanced-learn.css b/doc/_static/css/imbalanced-learn.css index 6c778540b..3778ee94c 100644 --- a/doc/_static/css/imbalanced-learn.css +++ b/doc/_static/css/imbalanced-learn.css @@ -21,39 +21,44 @@ /* Override some aspects of the pydata-sphinx-theme */ -/* Getting started index page */ +/* Main index page overview cards */ .intro-card { - background: #fff; - border-radius: 0; - padding: 30px 10px 10px 10px; - margin: 10px 0px; -} - -.intro-card .card-text { - margin: 20px 0px; - /*min-height: 150px; */ -} - -.custom-button { - background-color: #dcdcdc; - border: none; - color: #484848; - text-align: center; - text-decoration: none; - display: inline-block; - font-size: 0.9rem; - border-radius: 0.5rem; + padding: 30px 10px 20px 10px; +} + +.intro-card .sd-card-img-top { + margin: 10px; + height: 52px; + background: none !important; +} + +.intro-card .sd-card-title { + color: var(--pst-color-primary); + font-size: var(--pst-font-size-h5); + padding: 1rem 0rem 0.5rem 0rem; +} + +.intro-card .sd-card-footer { + border: none !important; +} + +.intro-card .sd-card-footer p.sd-card-text { max-width: 220px; - padding: 0.5rem 0rem; + margin-left: auto; + margin-right: auto; +} + +.intro-card .sd-btn-secondary { + background-color: #6c757d !important; + border-color: #6c757d !important; } -.custom-button a { - color: #484848; +.intro-card .sd-btn-secondary:hover { + background-color: #5a6268 !important; + border-color: #545b62 !important; } -.custom-button p { - margin-top: 0; - margin-bottom: 0rem; - color: #484848; +.card, .card img { + background-color: var(--pst-color-background); } diff --git a/doc/_static/img/logo_wide_dark.png b/doc/_static/img/logo_wide_dark.png new file mode 100644 index 000000000..38f997886 Binary files /dev/null and b/doc/_static/img/logo_wide_dark.png differ diff --git a/doc/_static/index_api.svg b/doc/_static/index_api.svg new file mode 100644 index 000000000..69f7ba1d2 --- /dev/null +++ b/doc/_static/index_api.svg @@ -0,0 +1,97 @@ + + + + diff --git a/doc/_static/index_examples.svg b/doc/_static/index_examples.svg new file mode 100644 index 000000000..de3d90237 --- /dev/null +++ b/doc/_static/index_examples.svg @@ -0,0 +1,76 @@ + + + + diff --git a/doc/_static/index_getting_started.svg b/doc/_static/index_getting_started.svg new file mode 100644 index 000000000..2d36622cb --- /dev/null +++ b/doc/_static/index_getting_started.svg @@ -0,0 +1,66 @@ + + + + diff --git a/doc/_static/index_user_guide.svg b/doc/_static/index_user_guide.svg new file mode 100644 index 000000000..bd1705351 --- /dev/null +++ b/doc/_static/index_user_guide.svg @@ -0,0 +1,67 @@ + + + + diff --git a/doc/conf.py b/doc/conf.py index a6361eafd..5561808ab 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -43,6 +43,7 @@ "sphinx_issues", "sphinx_gallery.gen_gallery", "sphinx_copybutton", + "sphinx_design", ] # Specify how to identify the prompt when copying code snippets @@ -106,10 +107,12 @@ html_theme_options = { "external_links": [], "github_url": "https://github.com/scikit-learn-contrib/imbalanced-learn", - # "twitter_url": "https://twitter.com/pandas_dev", "use_edit_page_button": True, "show_toc_level": 1, # "navbar_align": "right", # For testing that the navbar items align properly + "logo": { + "image_dark": "https://imbalanced-learn.org/stable/_static/img/logo_wide_dark.png" + }, } html_context = { @@ -323,15 +326,7 @@ def generate_min_dependency_substitutions(app): # -- Additional temporary hacks ----------------------------------------------- -# Temporary work-around for spacing problem between parameter and parameter -# type in the doc, see https://github.com/numpy/numpydoc/issues/215. The bug -# has been fixed in sphinx (https://github.com/sphinx-doc/sphinx/pull/5976) but -# through a change in sphinx basic.css except rtd_theme does not use basic.css. -# In an ideal world, this would get fixed in this PR: -# https://github.com/readthedocs/sphinx_rtd_theme/pull/747/files - def setup(app): app.connect("builder-inited", generate_min_dependency_table) app.connect("builder-inited", generate_min_dependency_substitutions) - app.add_css_file("basic.css") diff --git a/doc/index.rst b/doc/index.rst index aa3d7a9b2..238786314 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -21,80 +21,82 @@ Imbalanced-learn (imported as :mod:`imblearn`) is an open source, MIT-licensed library relying on scikit-learn (imported as :mod:`sklearn`) and provides tools when dealing with classification with imbalanced classes. -.. raw:: html - -
Check out the getting started guides to install imbalanced-learn. - Some extra information to get started with a new contribution is also provided.
- -.. container:: custom-button - - :ref:`To the installation guidelineThe user guide provides in-depth information on the - key concepts of imbalanced-learn with useful background information and explanation.
- -.. container:: custom-button - - :ref:`To the user guideThe reference guide contains a detailed description of - the imbalanced-learn API. To known more about methods parameters.
- -.. container:: custom-button - - :ref:`To the reference guideThe gallery of examples is a good place to see imbalanced-learn in action. - Select an example and dive in.
- -.. container:: custom-button - - :ref:`To the gallery of examples