Back to Delta

Docs Generation Scripts

docs/README.md

4.2.02.7 KB
Original Source

Docs Generation Scripts

This directory contains scripts to generate docs for https://docs.delta.io, including the API Docs for Scala, Java, and Python APIs.

Setup Environment

Install Node environment

Install node v22.14.0 using nvm:

nvm install

Then, install pnpm:

npm install --global corepack@latest
corepack enable pnpm

Finally, install dependencies:

pnpm i

Install Conda environment

Follow Conda Download to install Anaconda.

Then, follow Create Environment From Environment file to create a Conda environment from /delta/docs/environment.yml and activate the newly created delta_docs environment.

# Note the `--file` argument should be a fully qualified path. Using `~` in file
# path doesn't work. Example valid path: `/Users/macuser/delta/docs/environment.yml`

conda env create --name delta_docs --file=<absolute_path_to_delta_repo>/docs/environment.yml`

JDK Setup

API doc generation needs JDK 1.8. Make sure to setup JAVA_HOME that points to JDK 1.8.

Set the Delta Lake version

Set the version of Delta Lake release these docs are being generated for.

export _DELTA_LAKE_RELEASE_VERSION_=3.3.0

Usage

Run the command from the delta repo root directory:

python3 docs/generate_docs.py --livehtml --api-docs

Above command will print a URL to preview the docs.

Skip generating API docs

Above command generates API docs which take time. If you are just interested in the docs that go on https://docs.delta.io, use the following command.

python3 docs/generate_docs.py --livehtml

Building for production

To build the docs for production, run the following command:

python
python3 docs/generate_docs.py --api-docs

The resulting files will be found in docs/dist.

Additional docs site commands

The docs site is built on Astro. Using pnpm, you can run a variety of commands:

CommandDescription
pnpm run lintRun ESLint on the docs site code
pnpm run formatFormat docs site code using Prettier
pnpm run devStart Astro in development mode
pnpm run buildBuild the Astro site for production
pnpm run previewPreview the built Astro site
pnpm run astroRun Astro CLI