Skip to content

Commit

Permalink
Update Web Style (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
Weisu Yin authored Mar 28, 2023
1 parent 912c88a commit d9050a9
Show file tree
Hide file tree
Showing 29 changed files with 412 additions and 395 deletions.
6 changes: 1 addition & 5 deletions .github/workflow_scripts/build_doc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,8 @@ fi

setup_build_contrib_env

sed -i -e "s@###_PLACEHOLDER_WEB_CONTENT_ROOT_###@https://$site@g" docs/config.ini
sed -i -e "s@###_OTHER_VERSIONS_DOCUMENTATION_LABEL_###@$other_doc_version_text@g" docs/config.ini
sed -i -e "s@###_OTHER_VERSIONS_DOCUMENTATION_BRANCH_###@$other_doc_version_branch@g" docs/config.ini

install_cloud
cd docs && d2lbook build rst && d2lbook build html
cd docs && sphinx-build -b html . _build/html

COMMAND_EXIT_CODE=$?
if [[ $COMMAND_EXIT_CODE -ne 0 ]]; then
Expand Down
10 changes: 6 additions & 4 deletions .github/workflow_scripts/test_cluster.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Disable now because some weird issue appeared today (3/27/2023) on github to unblock release
# TODO: Investigate and re-enable after release
#!/bin/bash

set -ex
# set -ex

source $(dirname "$0")/env_setup.sh
# source $(dirname "$0")/env_setup.sh

install_cloud_test
# install_cloud_test

python3 -m pytest --forked --junitxml=results.xml tests/unittests/cluster/
# python3 -m pytest --forked --junitxml=results.xml tests/unittests/cluster/
Binary file added docs/_static/autogluon-s.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/autogluon-w.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
47 changes: 47 additions & 0 deletions docs/_static/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
.highlight-bash .highlight {
border: 1px #ccc solid;
}

div.cell div.cell_input, .highlight-bash .highlight {
border-left-color: var(--color-brand-content);
border-left-width: medium;
border-radius: 0.2rem;
}

div.cell_output table {
color: #2b8cee;
font-size: 0.8rem;
}

div.cell_output {
overflow-x: scroll;
margin-top: 0;
}

div.sidebar-scroll {
scroll-behavior: auto;
}

.dataframe {
margin: 1em 0;
}

details.toggle-details summary:hover, details.toggle-details summary:active, details.toggle-details summary {
background: transparent;
}


details.sd-dropdown summary {
padding: .5rem;
}

details.sd-dropdown .sd-summary-up, details.sd-dropdown .sd-summary-down {
top: .5rem;
}

body[data-theme="dark"] {
--mystnb-source-bg-color: #202020;
--mystnb-stdout-bg-color: #202020;
--mystnb-stderr-bg-color: #ee0000;
--mystnb-traceback-bg-color: #202020;
}
10 changes: 10 additions & 0 deletions docs/_static/custom.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
let sidebar_scroll_element = document.querySelector(".sidebar-scroll");

let saved_top = sessionStorage.getItem("sidebar-scroll-top");
if (saved_top !== null) {
sidebar_scroll_element.scrollTop = parseInt(saved_top, 10);
}

window.addEventListener("beforeunload", () => {
sessionStorage.setItem("sidebar-scroll-top", sidebar_scroll_element.scrollTop);
});
Binary file added docs/_static/favicon.ico
Binary file not shown.
File renamed without changes.
31 changes: 31 additions & 0 deletions docs/_templates/autosummary/class.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{{ objname | escape | underline}}

.. currentmodule:: {{ module }}

.. autoclass:: {{ objname }}
:members:

{% block methods %}

{% if methods %}
.. rubric:: {{ _('Methods') }}

.. autosummary::
:nosignatures:

{% for item in methods if item != '__init__' %}
~{{ name }}.{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block attributes %}
{% if attributes %}
.. rubric:: {{ _('Attributes') }}

.. autosummary::
{% for item in attributes %}
~{{ name }}.{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,23 @@

.. automodule:: {{ fullname }}

{% block attributes %}
{% if attributes %}
.. rubric:: {{ _('Module Attributes') }}

.. autosummary::
{% for item in attributes %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block functions %}
{% if functions %}
.. rubric:: Functions
.. rubric:: {{ _('Functions') }}

.. autosummary::
:toctree:
{% for item in functions %}
{{ item }}
{%- endfor %}
Expand All @@ -15,9 +27,10 @@

{% block classes %}
{% if classes %}
.. rubric:: Classes
.. rubric:: {{ _('Classes') }}

.. autosummary::
:toctree:
{% for item in classes %}
{{ item }}
{%- endfor %}
Expand All @@ -26,11 +39,24 @@

{% block exceptions %}
{% if exceptions %}
.. rubric:: Exceptions
.. rubric:: {{ _('Exceptions') }}

.. autosummary::
{% for item in exceptions %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block modules %}
{% if modules %}
.. rubric:: Modules

.. autosummary::
:toctree:
:recursive:
{% for item in modules %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}
32 changes: 32 additions & 0 deletions docs/_templates/custom_class.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{ fullname | escape | underline}}

.. currentmodule:: {{ module }}

.. autoclass:: {{ objname }}

{% block methods %}
.. automethod:: __init__

{% if methods %}
.. rubric:: {{ _('Methods') }}

.. autosummary::
:toctree: .
:nosignatures:

{% for item in methods if item != '__init__' %}
~{{ name }}.{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block attributes %}
{% if attributes %}
.. rubric:: {{ _('Attributes') }}

.. autosummary::
{% for item in attributes %}
~{{ name }}.{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}
27 changes: 27 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
API
===


.. currentmodule:: autogluon.cloud

.. autosummary::
:toctree: api
:template: custom_class.rst
:methods:

TabularCloudPredictor

.. autosummary::
:toctree: api
:template: custom_class.rst
:methods:

MultiModalCloudPredictor

.. autosummary::
:toctree: api
:template: custom_class.rst
:methods:

TimeSeriesCloudPredictor

47 changes: 0 additions & 47 deletions docs/api/autogluon-cloud.predictor.rst

This file was deleted.

19 changes: 0 additions & 19 deletions docs/api/index.rst

This file was deleted.

83 changes: 83 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import os
import sys

sys.path = ['.', '..'] + sys.path

project = 'AutoGluon-Cloud'
release = '0.1.1'
copyright = '2023, All authors. Licensed under Apache 2.0.'
author = 'AutoGluon contributors'

extensions = [
'myst_nb', # myst-nb.readthedocs.io
'sphinx_copybutton', # sphinx-copybutton.readthedocs.io
'sphinx_design', # github.com/executablebooks/sphinx-design
'sphinx_inline_tabs', # sphinx-inline-tabs.readthedocs.io
'sphinx_togglebutton', # sphinx-togglebutton.readthedocs.io
'sphinx.ext.autodoc', # www.sphinx-doc.org/en/master/usage/extensions/autodoc.html
'sphinx.ext.autosummary', # www.sphinx-doc.org/en/master/usage/extensions/autosummary.html
'sphinx.ext.napoleon', # www.sphinx-doc.org/en/master/usage/extensions/napoleon.html
'sphinx.ext.viewcode', # www.sphinx-doc.org/en/master/usage/extensions/viewcode.html
'sphinxcontrib.googleanalytics', # github.com/sphinx-contrib/googleanalytics
]

# See https://myst-parser.readthedocs.io/en/latest/syntax/optional.html
myst_enable_extensions = ['colon_fence', 'deflist', 'dollarmath', 'html_image', 'substitution']

autosummary_generate = True
numpydoc_show_class_members = False

googleanalytics_id = "UA-96378503-20"

nb_execution_mode = 'force'
# nb_execution_raise_on_error=True
nb_execution_timeout = 3600
nb_merge_streams = True

nb_execution_excludepatterns = ['jupyter_execute']

nb_dirs_to_exec = [os.path.join('tutorials', tag) for tag in tags if os.path.isdir(os.path.join('tutorials', tag))]

if len(nb_dirs_to_exec) > 0:
nb_dirs_to_exclude = [dirpath for dirpath, _, filenames in os.walk('tutorials')
if any(map(lambda x: x.endswith('.ipynb'), filenames))
and not dirpath.startswith(tuple(nb_dirs_to_exec))]

for nb_dir in nb_dirs_to_exclude:
nb_execution_excludepatterns.append(os.path.join(nb_dir, '*.ipynb'))

templates_path = ['_templates']
exclude_patterns = ['_build', '_templates', 'README.md', 'ReleaseInstructions.md', 'jupyter_execute']
master_doc = 'index'
numfig = True
numfig_secnum_depth = 2
math_numfig = True
math_number_all = True

# suppress_warnings = ['misc.highlighting_failure']

html_theme = 'furo' # furo.readthedocs.io
html_theme_options = {
'sidebar_hide_name': True,
'light_logo': 'autogluon.png',
'dark_logo': 'autogluon-w.png',
'globaltoc_collapse': False,
}

html_sidebars = {
'**': [
'sidebar/brand.html',
'sidebar/search.html',
'sidebar/scroll-start.html',
'sidebar/navigation.html',
# 'sidebar/ethical-ads.html', # furo maintainer requests this is set if docs are hosted on readthedocs.io
'sidebar/scroll-end.html',
'sidebar/variant-selector.html'
]
}

html_favicon = '_static/favicon.ico'

html_static_path = ['_static']
html_css_files = ['custom.css']
html_js_files = ['custom.js']
Loading

0 comments on commit d9050a9

Please sign in to comment.