Skip to content

Commit

Permalink
[docs] include sphinx objects.inv in yarn build-api-docs (#27906)
Browse files Browse the repository at this point in the history
## Summary & Motivation

Consolidate `yarn build-sphinx-objects-inv` and `yarn sync-api-docs`
into a single `yarn build-api-docs`.

## How I Tested These Changes

## Changelog

NOCHANGELOG
  • Loading branch information
cmpadden authored Feb 19, 2025
1 parent 22f4947 commit f559cf6
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 637 deletions.
3 changes: 3 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# code examples are generated at run and build time, and should not be included in version control
src/code-examples-content.js

# this file is generated at build time with `yarn build-api-docs`
static/objects.inv

sphinx/_build/
.env
.docusaurus
Expand Down
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ mdx_copy:

sphinx_objects_inv:
@echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
@echo "DEPRECATED - use \`yarn build-sphinx-object-inv\`"
@echo "DEPRECATED - use \`yarn build-api-docs\`"
@echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
tox -e sphinx
cp sphinx/_build/json/objects.inv static/.
Expand Down
5 changes: 1 addition & 4 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,9 @@ This command starts a local development server and opens [http://localhost:3050]
To build the site for production:

```bash
# build and copy api markdown files
# build and copy API markdown files; build and copy the sphinx `objects.inv` to static/
yarn build-api-docs

# build and copy the sphinx objects.inv
yarn build-sphinx-object-inv

# build the static site
yarn build
```
Expand Down
7 changes: 3 additions & 4 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
"lint": "eslint . --ext=.tsx,.ts,.js,.md,.mdx --ignore-pattern 'node_modules/*' --ignore-pattern 'versioned_docs/*' --ignore-pattern 'versioned_sidebars/*' --fix",
"lint-and-vale": "yarn run lint && yarn run vale",
"generate-code-imports": "node scripts/generate-code-imports.js",
"sync-api-docs": "/bin/sh scripts/vercel-sync-api-docs.sh",
"build-api-docs": "tox -e sphinx-mdx && cp -rf sphinx/_build/mdx/sections/api/apidocs/* docs/api/python-api/",
"build-sphinx-object-inv": "tox -e sphinx && cp sphinx/_build/json/objects.inv static/.",
"rebuild-kinds-tags": "python scripts/rebuild-kinds-tags.py"
"rebuild-kinds-tags": "python scripts/rebuild-kinds-tags.py",
"sync-api-docs": "/bin/sh scripts/build-api-docs.sh",
"build-api-docs": "/bin/sh scripts/build-api-docs.sh"
},
"dependencies": {
"@docusaurus/core": "^3.7.0",
Expand Down
38 changes: 38 additions & 0 deletions docs/scripts/build-api-docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash
#
# Builds and synchronizes mdx API docs, and objects.inv using Sphinx
#
# USAGE
#
# yarn build-api-docs
#

set -e

# Vercel-specific commands and configurations
if ! [[ "$OSTYPE" =~ "darwin"* ]]; then
echo "Detected non-Darwin host. Running Vercel-specific commands and configurations"

# Required to resolve `locale.Error: unsupported locale setting`
export LC_ALL=C.UTF-8

if ! command -v uv &> /dev/null; then
curl -LsSf https://astral.sh/uv/install.sh | sh

# shellcheck source=/dev/null
source "$HOME/.local/bin/env"
fi

uv python install 3.11
uv venv
source .venv/bin/activate
uv pip install tox
fi

echo "Running sphinx-mdx and copying files to \`docs/api/python-api\`"
tox -e sphinx-mdx
cp -rf sphinx/_build/mdx/sections/api/apidocs/* docs/api/python-api/

echo "Running sphinx and copying \`object.inv\` to \`static/\`"
tox -e sphinx
cp sphinx/_build/json/objects.inv static/.
24 changes: 0 additions & 24 deletions docs/scripts/vercel-sync-api-docs.sh

This file was deleted.

604 changes: 0 additions & 604 deletions docs/src/code-examples-content.js

This file was deleted.

Binary file removed docs/static/objects.inv
Binary file not shown.

1 comment on commit f559cf6

@github-actions
Copy link

@github-actions github-actions bot commented on f559cf6 Feb 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for dagster-docs ready!

✅ Preview
https://dagster-docs-jyvnqiv2c-elementl.vercel.app

Built with commit f559cf6.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.