Files
langgraph/docs
ccurmeandGitHub 21a7105655 docs[patch]: enable navigation back to index pages from child pages via sidebar (#3069)
Currently, if you're viewing a how-to guide and you click "How-to
Guides" in the sidebar, you aren't navigated back to the index page (it
will work if you click on a different guides section). To get back to
the index page, you need to scroll up and click the breadcrumbs.

After this change, clicking the link in the sidebar should navigate you
to the index page regardless of the page you are viewing.

Only side-effect from what I can tell is that "Home > Introduction" just
becomes "**Home**", which I think is fine (maybe preferable).

Before:
![Screenshot 2025-01-16 at 11 16
26 AM](https://github.com/user-attachments/assets/e4bdedfc-ed52-4a66-b0b2-194383ce2043)

After:
![Screenshot 2025-01-16 at 11 16
00 AM](https://github.com/user-attachments/assets/4d1d935b-5b11-43ac-8b63-c5aaff871188)
2025-01-16 12:52:16 -05:00
..
2025-01-14 14:58:34 -05:00
2025-01-14 14:58:34 -05:00
2025-01-14 13:31:39 -05:00
2025-01-15 18:14:37 -05:00

Setup

To setup requirements for building docs you can run:

poetry install --with test

Serving documentation locally

To run the documentation server locally you can run:

make serve-docs

Execute notebooks

If you would like to automatically execute all of the notebooks, to mimic the "Run notebooks" GHA, you can run:

python docs/_scripts/prepare_notebooks_for_ci.py
./docs/_scripts/execute_notebooks.sh

Note: if you want to run the notebooks without %pip install cells, you can run:

python docs/_scripts/prepare_notebooks_for_ci.py --comment-install-cells
./docs/_scripts/execute_notebooks.sh

prepare_notebooks_for_ci.py script will add VCR cassette context manager for each cell in the notebook, so that:

  • when the notebook is run for the first time, cells with network requests will be recorded to a VCR cassette file
  • when the notebook is run subsequently, the cells with network requests will be replayed from the cassettes

Note: this is currently limited only to the notebooks in docs/docs/how-tos

Adding new notebooks

If you are adding a notebook with API requests, it's recommended to record network requests so that they can be subsequently replayed. If this is not done, the notebook runner will make API requests every time the notebook is run, which can be costly and slow.

To record network requests, please make sure to first run prepare_notebooks_for_ci.py script.

Then, run

jupyter execute <path_to_notebook>

Once the notebook is executed, you should see the new VCR cassettes recorded in docs/cassettes directory and discard the updated notebook.

Updating existing notebooks

If you are updating an existing notebook, please make sure to remove any existing cassettes for the notebook in docs/cassettes directory (each cassette is prefixed with the notebook name), and then run the steps from the "Adding new notebooks" section above.

To delete cassettes for a notebook, you can run:

rm docs/cassettes/<notebook_name>*