diff --git a/.github/workflows/baselines.yml b/.github/workflows/baselines.yml index c4485fe72d10..c051b1f355c7 100644 --- a/.github/workflows/baselines.yml +++ b/.github/workflows/baselines.yml @@ -36,7 +36,7 @@ jobs: FILTER+=$(echo "$DIR: ${BASELINES_PATH}/**\n") done < <(find baselines -maxdepth 1 \ -name ".*" -prune -o \ - -path "baselines/doc" -prune -o \ + -path "baselines/docs" -prune -o \ -path "baselines/dev" -prune -o \ -path "baselines/baseline_template" -prune -o \ -path "baselines/flwr_baselines" -prune -o \ diff --git a/baselines/doc/Makefile b/baselines/docs/Makefile similarity index 100% rename from baselines/doc/Makefile rename to baselines/docs/Makefile diff --git a/baselines/doc/make.bat b/baselines/docs/make.bat similarity index 100% rename from baselines/doc/make.bat rename to baselines/docs/make.bat diff --git a/baselines/doc/source/.gitignore b/baselines/docs/source/.gitignore similarity index 100% rename from baselines/doc/source/.gitignore rename to baselines/docs/source/.gitignore diff --git a/baselines/doc/source/_static/custom.css b/baselines/docs/source/_static/custom.css similarity index 100% rename from baselines/doc/source/_static/custom.css rename to baselines/docs/source/_static/custom.css diff --git a/baselines/doc/source/_static/favicon.ico b/baselines/docs/source/_static/favicon.ico similarity index 100% rename from baselines/doc/source/_static/favicon.ico rename to baselines/docs/source/_static/favicon.ico diff --git a/baselines/doc/source/_static/flower-logo.png b/baselines/docs/source/_static/flower-logo.png similarity index 100% rename from baselines/doc/source/_static/flower-logo.png rename to baselines/docs/source/_static/flower-logo.png diff --git a/baselines/doc/source/_static/view-gh.png b/baselines/docs/source/_static/view-gh.png similarity index 100% rename from baselines/doc/source/_static/view-gh.png rename to baselines/docs/source/_static/view-gh.png diff --git a/baselines/doc/source/_templates/base.html b/baselines/docs/source/_templates/base.html similarity index 100% rename from baselines/doc/source/_templates/base.html rename to baselines/docs/source/_templates/base.html diff --git a/baselines/doc/source/_templates/sidebar/search.html b/baselines/docs/source/_templates/sidebar/search.html similarity index 100% rename from baselines/doc/source/_templates/sidebar/search.html rename to baselines/docs/source/_templates/sidebar/search.html diff --git a/baselines/doc/source/conf.py b/baselines/docs/source/conf.py similarity index 95% rename from baselines/doc/source/conf.py rename to baselines/docs/source/conf.py index 9d5d4ea7fc92..574c4ccf0e81 100644 --- a/baselines/doc/source/conf.py +++ b/baselines/docs/source/conf.py @@ -12,12 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== +"""Config for Sphinx docs.""" import datetime import os import sys -from sphinx.application import ConfigError + # Configuration file for the Sphinx documentation builder. # @@ -120,11 +121,15 @@ nbsphinx_execute = "never" -_open_in_colab_button = """ +colab_link = ( + "https://colab.research.google.com/github/adap/flower/blob/main/" + "doc/source/{{ env.doc2path(env.docname, base=None) }}" +) +_open_in_colab_button = f""" .. raw:: html
- + Open in Colab """ diff --git a/baselines/doc/source/how-to-contribute-baselines.rst b/baselines/docs/source/how-to-contribute-baselines.rst similarity index 100% rename from baselines/doc/source/how-to-contribute-baselines.rst rename to baselines/docs/source/how-to-contribute-baselines.rst diff --git a/baselines/doc/source/how-to-use-baselines.rst b/baselines/docs/source/how-to-use-baselines.rst similarity index 100% rename from baselines/doc/source/how-to-use-baselines.rst rename to baselines/docs/source/how-to-use-baselines.rst diff --git a/baselines/doc/source/index.rst b/baselines/docs/source/index.rst similarity index 100% rename from baselines/doc/source/index.rst rename to baselines/docs/source/index.rst diff --git a/datasets/dev/build-flwr-datasets-docs.sh b/datasets/dev/build-flwr-datasets-docs.sh index ed41a87a414b..9cb80dcfd5d2 100755 --- a/datasets/dev/build-flwr-datasets-docs.sh +++ b/datasets/dev/build-flwr-datasets-docs.sh @@ -22,7 +22,7 @@ set -e -cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"/../doc +cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"/../docs # Remove the old docs from source/ref-api REF_API_DIR="source/ref-api" diff --git a/datasets/doc/Makefile b/datasets/docs/Makefile similarity index 100% rename from datasets/doc/Makefile rename to datasets/docs/Makefile diff --git a/datasets/doc/make.bat b/datasets/docs/make.bat similarity index 100% rename from datasets/doc/make.bat rename to datasets/docs/make.bat diff --git a/datasets/doc/source/.gitignore b/datasets/docs/source/.gitignore similarity index 100% rename from datasets/doc/source/.gitignore rename to datasets/docs/source/.gitignore diff --git a/datasets/doc/source/_static/custom.css b/datasets/docs/source/_static/custom.css similarity index 100% rename from datasets/doc/source/_static/custom.css rename to datasets/docs/source/_static/custom.css diff --git a/datasets/doc/source/_static/favicon.ico b/datasets/docs/source/_static/favicon.ico similarity index 100% rename from datasets/doc/source/_static/favicon.ico rename to datasets/docs/source/_static/favicon.ico diff --git a/datasets/doc/source/_static/flower-datasets-logo.png b/datasets/docs/source/_static/flower-datasets-logo.png similarity index 100% rename from datasets/doc/source/_static/flower-datasets-logo.png rename to datasets/docs/source/_static/flower-datasets-logo.png diff --git a/datasets/doc/source/_static/readme/comparison_of_partitioning_schemes.png b/datasets/docs/source/_static/readme/comparison_of_partitioning_schemes.png similarity index 100% rename from datasets/doc/source/_static/readme/comparison_of_partitioning_schemes.png rename to datasets/docs/source/_static/readme/comparison_of_partitioning_schemes.png diff --git a/datasets/doc/source/_static/tutorial-quickstart/choose-hf-dataset.png b/datasets/docs/source/_static/tutorial-quickstart/choose-hf-dataset.png similarity index 100% rename from datasets/doc/source/_static/tutorial-quickstart/choose-hf-dataset.png rename to datasets/docs/source/_static/tutorial-quickstart/choose-hf-dataset.png diff --git a/datasets/doc/source/_static/tutorial-quickstart/copy-dataset-name.png b/datasets/docs/source/_static/tutorial-quickstart/copy-dataset-name.png similarity index 100% rename from datasets/doc/source/_static/tutorial-quickstart/copy-dataset-name.png rename to datasets/docs/source/_static/tutorial-quickstart/copy-dataset-name.png diff --git a/datasets/doc/source/_static/tutorial-quickstart/partitioner-flexibility.png b/datasets/docs/source/_static/tutorial-quickstart/partitioner-flexibility.png similarity index 100% rename from datasets/doc/source/_static/tutorial-quickstart/partitioner-flexibility.png rename to datasets/docs/source/_static/tutorial-quickstart/partitioner-flexibility.png diff --git a/datasets/doc/source/_templates/autosummary/base.rst b/datasets/docs/source/_templates/autosummary/base.rst similarity index 100% rename from datasets/doc/source/_templates/autosummary/base.rst rename to datasets/docs/source/_templates/autosummary/base.rst diff --git a/datasets/doc/source/_templates/autosummary/class.rst b/datasets/docs/source/_templates/autosummary/class.rst similarity index 100% rename from datasets/doc/source/_templates/autosummary/class.rst rename to datasets/docs/source/_templates/autosummary/class.rst diff --git a/datasets/doc/source/_templates/autosummary/module.rst b/datasets/docs/source/_templates/autosummary/module.rst similarity index 100% rename from datasets/doc/source/_templates/autosummary/module.rst rename to datasets/docs/source/_templates/autosummary/module.rst diff --git a/datasets/doc/source/_templates/base.html b/datasets/docs/source/_templates/base.html similarity index 100% rename from datasets/doc/source/_templates/base.html rename to datasets/docs/source/_templates/base.html diff --git a/datasets/doc/source/_templates/sidebar/search.html b/datasets/docs/source/_templates/sidebar/search.html similarity index 100% rename from datasets/doc/source/_templates/sidebar/search.html rename to datasets/docs/source/_templates/sidebar/search.html diff --git a/datasets/doc/source/conf.py b/datasets/docs/source/conf.py similarity index 98% rename from datasets/doc/source/conf.py rename to datasets/docs/source/conf.py index 92d59d7df370..e46a49f504d7 100644 --- a/datasets/doc/source/conf.py +++ b/datasets/docs/source/conf.py @@ -17,6 +17,7 @@ import datetime import os import sys + from sphinx.application import ConfigError # Configuration file for the Sphinx documentation builder. @@ -162,7 +163,7 @@ def find_test_modules(package_path): .. raw:: html
- + Open in Colab """ @@ -182,5 +183,5 @@ def find_test_modules(package_path): myst_heading_anchors = 3 # -- Options for sphinx_copybutton ------------------------------------- -copybutton_exclude = '.linenos, .gp, .go' +copybutton_exclude = ".linenos, .gp, .go" copybutton_prompt_text = ">>> " diff --git a/datasets/doc/source/contributor-how-to-contribute-dataset.rst b/datasets/docs/source/contributor-how-to-contribute-dataset.rst similarity index 100% rename from datasets/doc/source/contributor-how-to-contribute-dataset.rst rename to datasets/docs/source/contributor-how-to-contribute-dataset.rst diff --git a/datasets/doc/source/how-to-disable-enable-progress-bar.rst b/datasets/docs/source/how-to-disable-enable-progress-bar.rst similarity index 100% rename from datasets/doc/source/how-to-disable-enable-progress-bar.rst rename to datasets/docs/source/how-to-disable-enable-progress-bar.rst diff --git a/datasets/doc/source/how-to-install-flwr-datasets.rst b/datasets/docs/source/how-to-install-flwr-datasets.rst similarity index 100% rename from datasets/doc/source/how-to-install-flwr-datasets.rst rename to datasets/docs/source/how-to-install-flwr-datasets.rst diff --git a/datasets/doc/source/how-to-use-with-local-data.rst b/datasets/docs/source/how-to-use-with-local-data.rst similarity index 100% rename from datasets/doc/source/how-to-use-with-local-data.rst rename to datasets/docs/source/how-to-use-with-local-data.rst diff --git a/datasets/doc/source/how-to-use-with-numpy.rst b/datasets/docs/source/how-to-use-with-numpy.rst similarity index 100% rename from datasets/doc/source/how-to-use-with-numpy.rst rename to datasets/docs/source/how-to-use-with-numpy.rst diff --git a/datasets/doc/source/how-to-use-with-pytorch.rst b/datasets/docs/source/how-to-use-with-pytorch.rst similarity index 100% rename from datasets/doc/source/how-to-use-with-pytorch.rst rename to datasets/docs/source/how-to-use-with-pytorch.rst diff --git a/datasets/doc/source/how-to-use-with-tensorflow.rst b/datasets/docs/source/how-to-use-with-tensorflow.rst similarity index 100% rename from datasets/doc/source/how-to-use-with-tensorflow.rst rename to datasets/docs/source/how-to-use-with-tensorflow.rst diff --git a/datasets/doc/source/index.rst b/datasets/docs/source/index.rst similarity index 100% rename from datasets/doc/source/index.rst rename to datasets/docs/source/index.rst diff --git a/datasets/doc/source/recommended-fl-datasets-tables.rst b/datasets/docs/source/recommended-fl-datasets-tables.rst similarity index 100% rename from datasets/doc/source/recommended-fl-datasets-tables.rst rename to datasets/docs/source/recommended-fl-datasets-tables.rst diff --git a/datasets/doc/source/recommended-fl-datasets.rst b/datasets/docs/source/recommended-fl-datasets.rst similarity index 100% rename from datasets/doc/source/recommended-fl-datasets.rst rename to datasets/docs/source/recommended-fl-datasets.rst diff --git a/datasets/doc/source/ref-telemetry.md b/datasets/docs/source/ref-telemetry.md similarity index 100% rename from datasets/doc/source/ref-telemetry.md rename to datasets/docs/source/ref-telemetry.md diff --git a/datasets/doc/source/tutorial-quickstart.ipynb b/datasets/docs/source/tutorial-quickstart.ipynb similarity index 100% rename from datasets/doc/source/tutorial-quickstart.ipynb rename to datasets/docs/source/tutorial-quickstart.ipynb diff --git a/datasets/doc/source/tutorial-use-partitioners.ipynb b/datasets/docs/source/tutorial-use-partitioners.ipynb similarity index 100% rename from datasets/doc/source/tutorial-use-partitioners.ipynb rename to datasets/docs/source/tutorial-use-partitioners.ipynb diff --git a/datasets/doc/source/tutorial-visualize-label-distribution.ipynb b/datasets/docs/source/tutorial-visualize-label-distribution.ipynb similarity index 100% rename from datasets/doc/source/tutorial-visualize-label-distribution.ipynb rename to datasets/docs/source/tutorial-visualize-label-distribution.ipynb diff --git a/dev/build-baseline-docs.sh b/dev/build-baseline-docs.sh index 794cf2537c74..0d07e2da1046 100755 --- a/dev/build-baseline-docs.sh +++ b/dev/build-baseline-docs.sh @@ -3,7 +3,7 @@ set -e cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"/../ ROOT=`pwd` -INDEX=$ROOT/baselines/doc/source/index.rst +INDEX=$ROOT/baselines/docs/source/index.rst initial_text=$(cat <<-END .. toctree:: @@ -56,7 +56,7 @@ function add_table_entry () ! grep -q ":caption: References" $INDEX && echo "$initial_text" >> $INDEX && echo "" >> $INDEX -rm -f "baselines/doc/source/*.md" +rm -f "baselines/docs/source/*.md" cd $ROOT/baselines/ @@ -67,12 +67,12 @@ for d in $(printf '%s\n' */ | sort -V); do # Select directories baseline=${d%/} - if ! [[ "$baseline" =~ ^(baseline_template|dev|doc|flwr_baselines)$ ]]; then + if ! [[ "$baseline" =~ ^(baseline_template|dev|docs|flwr_baselines)$ ]]; then # For each baseline, copy the README into the source of the Baselines docs - cp $baseline/README.md $ROOT/baselines/doc/source/$baseline.md 2>&1 >/dev/null + cp $baseline/README.md $ROOT/baselines/docs/source/$baseline.md 2>&1 >/dev/null gh_text="[\"View](https://github.com/adap/flower/blob/main/baselines/$baseline)" - readme_file="$ROOT/baselines/doc/source/$baseline.md" + readme_file="$ROOT/baselines/docs/source/$baseline.md" if ! grep -Fq "$gh_text" "$readme_file"; then awk -v text="$gh_text" ' @@ -92,8 +92,8 @@ for d in $(printf '%s\n' */ | sort -V); do do image_dir=$(dirname $img) - mkdir -p $ROOT/baselines/doc/source/$image_dir && cp $baseline/$img $_ - images_arr+=("$ROOT/baselines/doc/source/$img") + mkdir -p $ROOT/baselines/docs/source/$image_dir && cp $baseline/$img $_ + images_arr+=("$ROOT/baselines/docs/source/$img") done if [[ $(grep -L "$baseline" $INDEX) ]]; then @@ -109,7 +109,7 @@ for d in $(printf '%s\n' */ | sort -V); do fi done -cd $ROOT/baselines/doc +cd $ROOT/baselines/docs make html # Restore everything back to the initial state diff --git a/dev/build-example-docs.py b/dev/build-example-docs.py index 05656967bbbd..73ddeafc4e35 100644 --- a/dev/build-example-docs.py +++ b/dev/build-example-docs.py @@ -21,7 +21,7 @@ from pathlib import Path ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) -INDEX = os.path.join(ROOT, "examples", "doc", "source", "index.rst") +INDEX = os.path.join(ROOT, "examples", "docs", "source", "index.rst") initial_text = """ Flower Examples Documentation @@ -180,14 +180,14 @@ def _copy_markdown_files(example): if file.endswith(".md"): src = os.path.join(example, file) dest = os.path.join( - ROOT, "examples", "doc", "source", os.path.basename(example) + ".md" + ROOT, "examples", "docs", "source", os.path.basename(example) + ".md" ) shutil.copyfile(src, dest) def _add_gh_button(example): gh_text = f'[View on GitHub](https://github.com/adap/flower/blob/main/examples/{example})' - readme_file = os.path.join(ROOT, "examples", "doc", "source", example + ".md") + readme_file = os.path.join(ROOT, "examples", "docs", "source", example + ".md") with open(readme_file, "r+") as f: content = f.read() if gh_text not in content: @@ -201,7 +201,7 @@ def _add_gh_button(example): def _copy_images(example): static_dir = os.path.join(example, "_static") - dest_dir = os.path.join(ROOT, "examples", "doc", "source", "_static") + dest_dir = os.path.join(ROOT, "examples", "docs", "source", "_static") if os.path.isdir(static_dir): for file in os.listdir(static_dir): if file.endswith((".jpg", ".png", ".jpeg")): @@ -214,7 +214,7 @@ def _add_all_entries(): examples_dir = os.path.join(ROOT, "examples") for example in sorted(os.listdir(examples_dir)): example_path = os.path.join(examples_dir, example) - if os.path.isdir(example_path) and example != "doc": + if os.path.isdir(example_path) and example != "docs": _copy_markdown_files(example_path) _add_gh_button(example) _copy_images(example) @@ -230,7 +230,7 @@ def _main(): examples_dir = os.path.join(ROOT, "examples") for example in sorted(os.listdir(examples_dir)): example_path = os.path.join(examples_dir, example) - if os.path.isdir(example_path) and example != "doc": + if os.path.isdir(example_path) and example != "docs": _copy_markdown_files(example_path) _add_gh_button(example) _copy_images(example_path) @@ -280,4 +280,4 @@ def _main(): if __name__ == "__main__": _main() - subprocess.call(f"cd {ROOT}/examples/doc && make html", shell=True) + subprocess.call(f"cd {ROOT}/examples/docs && make html", shell=True) diff --git a/dev/update_version.py b/dev/update_version.py index 0b2db3369a3d..adfb904833b2 100644 --- a/dev/update_version.py +++ b/dev/update_version.py @@ -7,7 +7,7 @@ REPLACE_CURR_VERSION = { - "doc/source/conf.py": [ + "framework/docs/source/conf.py": [ ".. |stable_flwr_version| replace:: {version}", ], "src/py/flwr/cli/new/templates/app/pyproject.*.toml.tpl": [ @@ -17,11 +17,11 @@ REPLACE_NEXT_VERSION = { "pyproject.toml": ['version = "{version}"'], - "doc/source/conf.py": [ + "framework/docs/source/conf.py": [ 'release = "{version}"', ], - "examples/doc/source/conf.py": ['release = "{version}"'], - "baselines/doc/source/conf.py": ['release = "{version}"'], + "examples/docs/source/conf.py": ['release = "{version}"'], + "baselines/docs/source/conf.py": ['release = "{version}"'], "src/docker/complete/compose.yml": ["FLWR_VERSION:-{version}"], "src/docker/distributed/client/compose.yml": ["FLWR_VERSION:-{version}"], "src/docker/distributed/server/compose.yml": ["FLWR_VERSION:-{version}"], diff --git a/examples/doc/Makefile b/examples/docs/Makefile similarity index 100% rename from examples/doc/Makefile rename to examples/docs/Makefile diff --git a/examples/doc/make.bat b/examples/docs/make.bat similarity index 100% rename from examples/doc/make.bat rename to examples/docs/make.bat diff --git a/examples/doc/source/.gitignore b/examples/docs/source/.gitignore similarity index 100% rename from examples/doc/source/.gitignore rename to examples/docs/source/.gitignore diff --git a/examples/doc/source/_static/.gitignore b/examples/docs/source/_static/.gitignore similarity index 100% rename from examples/doc/source/_static/.gitignore rename to examples/docs/source/_static/.gitignore diff --git a/examples/doc/source/_static/custom.css b/examples/docs/source/_static/custom.css similarity index 100% rename from examples/doc/source/_static/custom.css rename to examples/docs/source/_static/custom.css diff --git a/examples/doc/source/_static/favicon.ico b/examples/docs/source/_static/favicon.ico similarity index 100% rename from examples/doc/source/_static/favicon.ico rename to examples/docs/source/_static/favicon.ico diff --git a/examples/doc/source/_static/flower-logo.png b/examples/docs/source/_static/flower-logo.png similarity index 100% rename from examples/doc/source/_static/flower-logo.png rename to examples/docs/source/_static/flower-logo.png diff --git a/examples/doc/source/_static/tmux_jtop_view.gif b/examples/docs/source/_static/tmux_jtop_view.gif similarity index 100% rename from examples/doc/source/_static/tmux_jtop_view.gif rename to examples/docs/source/_static/tmux_jtop_view.gif diff --git a/examples/doc/source/_static/view-gh.png b/examples/docs/source/_static/view-gh.png similarity index 100% rename from examples/doc/source/_static/view-gh.png rename to examples/docs/source/_static/view-gh.png diff --git a/examples/doc/source/_templates/base.html b/examples/docs/source/_templates/base.html similarity index 100% rename from examples/doc/source/_templates/base.html rename to examples/docs/source/_templates/base.html diff --git a/examples/doc/source/conf.py b/examples/docs/source/conf.py similarity index 100% rename from examples/doc/source/conf.py rename to examples/docs/source/conf.py