Skip to content

Commit

Permalink
Sort index pages by name in docs (#560)
Browse files Browse the repository at this point in the history
## Changes
The indices under the APIs and Dataclasses pages were not sorted,
resulting in them being shown in an unexpected/random order. This fixes
this so they are shown alphabetically.

## Tests
<!-- 
How is this tested? Please see the checklist below and also describe any
other relevant tests
-->

- [ ] `make test` run locally
- [ ] `make fmt` applied
- [ ] relevant integration tests applied
  • Loading branch information
mgyucht authored Feb 22, 2024
1 parent 326088f commit 8537cd3
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 26 deletions.
8 changes: 4 additions & 4 deletions docs/account/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ These APIs are available from AccountClient
.. toctree::
:maxdepth: 1

iam/index
billing/index
catalog/index
settings/index
iam/index
oauth2/index
provisioning/index
billing/index
oauth2/index
settings/index
22 changes: 11 additions & 11 deletions docs/dbdataclasses/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ Dataclasses
.. toctree::
:maxdepth: 1

workspace
billing
catalog
compute
jobs
pipelines
dashboards
files
iam
jobs
ml
oauth2
pipelines
provisioning
serving
iam
sql
catalog
sharing
settings
provisioning
billing
oauth2
sharing
sql
vectorsearch
dashboards
workspace
6 changes: 3 additions & 3 deletions docs/gen-client-docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ def write_dataclass_docs(self):
doc = DataclassesDoc(package=pkg, dataclasses=sorted(all_members))
with open(f'{__dir__}/dbdataclasses/{pkg.name}.rst', 'w') as f:
f.write(doc.as_rst())
all = "\n ".join([f'{p.name}' for p in self.packages])
all = "\n ".join(sorted([p.name for p in self.packages]))
with open(f'{__dir__}/dbdataclasses/index.rst', 'w') as f:
f.write(f'''
Dataclasses
Expand Down Expand Up @@ -374,7 +374,7 @@ def _write_client_packages(self, folder: str, label: str, description: str, pack
"""Writes out the top-level index for the APIs supported by a client."""
self._make_folder_if_not_exists(f'{__dir__}/{folder}')
with open(f'{__dir__}/{folder}/index.rst', 'w') as f:
all = "\n ".join([f'{name}/index' for name in packages])
all = "\n ".join([f'{name}/index' for name in sorted(packages)])
f.write(f'''
{label}
{'=' * len(label)}
Expand All @@ -390,7 +390,7 @@ def _write_client_package_doc(self, folder: str, pkg: Package, services: list[st
"""Writes out the index for a single package supported by a client."""
self._make_folder_if_not_exists(f'{__dir__}/{folder}/{pkg.name}')
with open(f'{__dir__}/{folder}/{pkg.name}/index.rst', 'w') as f:
all = "\n ".join(services)
all = "\n ".join(sorted(services))
f.write(f'''
{pkg.label}
{'=' * len(pkg.label)}
Expand Down
16 changes: 8 additions & 8 deletions docs/workspace/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ These APIs are available from WorkspaceClient
.. toctree::
:maxdepth: 1

workspace/index
catalog/index
compute/index
jobs/index
pipelines/index
dashboards/index
files/index
iam/index
jobs/index
ml/index
pipelines/index
serving/index
iam/index
sql/index
catalog/index
sharing/index
settings/index
sharing/index
sql/index
vectorsearch/index
dashboards/index
workspace/index

0 comments on commit 8537cd3

Please sign in to comment.