Skip to content

DOC: building page for nested methods doesn't work #46806

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/code-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/docbuild-and-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 9 additions & 1 deletion ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)/.."
Expand Down Expand Up @@ -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
9 changes: 8 additions & 1 deletion doc/source/index.rst.template
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ pandas documentation
easy-to-use data structures and data analysis tools for the `Python <https://www.python.org/>`__
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
Expand Down Expand Up @@ -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 -%}
Expand Down