diff --git a/.github/workflows/code-checks.yml b/.github/workflows/code-checks.yml index a5fd72e343c16..a27ed42c984bf 100644 --- a/.github/workflows/code-checks.yml +++ b/.github/workflows/code-checks.yml @@ -80,6 +80,10 @@ jobs: id: build uses: ./.github/actions/build_pandas + - name: Check for no warnings when building single-page docs + run: ci/code_checks.sh single-docs + if: ${{ steps.build.outcome == 'success' }} + - name: Run checks on imported code run: ci/code_checks.sh code if: ${{ steps.build.outcome == 'success' }} diff --git a/.github/workflows/docbuild-and-upload.yml b/.github/workflows/docbuild-and-upload.yml index bba9f62a0eca6..8c2c86dc693a9 100644 --- a/.github/workflows/docbuild-and-upload.yml +++ b/.github/workflows/docbuild-and-upload.yml @@ -37,6 +37,7 @@ jobs: run: | source activate pandas-dev python web/pandas_web.py web/pandas --target-path=web/build + - name: Build documentation run: | source activate pandas-dev diff --git a/ci/code_checks.sh b/ci/code_checks.sh index c6d9698882f4d..d7e685f8d055f 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -12,8 +12,9 @@ # $ ./ci/code_checks.sh doctests # run doctests # $ ./ci/code_checks.sh docstrings # validate docstring errors # $ ./ci/code_checks.sh typing # run static type analysis +# $ ./ci/code_checks.sh single-docs # check single-page docs build warning-free -[[ -z "$1" || "$1" == "code" || "$1" == "doctests" || "$1" == "docstrings" || "$1" == "typing" ]] || \ +[[ -z "$1" || "$1" == "code" || "$1" == "doctests" || "$1" == "docstrings" || "$1" == "typing" || "$1" == "single-docs" ]] || \ { echo "Unknown command $1. Usage: $0 [code|doctests|docstrings|typing]"; exit 9999; } BASE_DIR="$(dirname $0)/.." @@ -102,4 +103,11 @@ if [[ -z "$CHECK" || "$CHECK" == "typing" ]]; then fi fi +### SINGLE-PAGE DOCS ### +if [[ -z "$CHECK" || "$CHECK" == "single-docs" ]]; then + python doc/make.py --warnings-are-errors --single pandas.Series.value_counts + python doc/make.py --warnings-are-errors --single pandas.Series.str.split + python doc/make.py clean +fi + exit $RET diff --git a/doc/source/index.rst.template b/doc/source/index.rst.template index 3b440122c2b97..022ff9edc1518 100644 --- a/doc/source/index.rst.template +++ b/doc/source/index.rst.template @@ -26,6 +26,7 @@ pandas documentation easy-to-use data structures and data analysis tools for the `Python `__ programming language. +{% if not single_doc -%} .. panels:: :card: + intro-card text-center :column: col-lg-6 col-md-6 col-sm-6 col-xs-12 d-flex @@ -96,16 +97,22 @@ programming language. :text: To the development guide :classes: btn-block btn-secondary stretched-link - +{% endif %} {% if single_doc and single_doc.endswith('.rst') -%} .. toctree:: :maxdepth: 3 :titlesonly: {{ single_doc[:-4] }} +{% elif single_doc and single_doc.count('.') <= 1 %} +.. autosummary:: + :toctree: reference/api/ + + {{ single_doc }} {% elif single_doc %} .. autosummary:: :toctree: reference/api/ + :template: autosummary/accessor_method.rst {{ single_doc }} {% else -%}