Skip to content

Commit a988493

Browse files
authored
Update CONTRIBUTING.md (#477)
1 parent 0981b7f commit a988493

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

CONTRIBUTING.md

+38
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,44 @@ Adding a new guide often involves lots of detailed reviews and we want to make s
3535
When you're ready, start by using the [notebook
3636
template](./quickstarts/Template.ipynb) and following the guidance within.
3737

38+
Before submitting your notebook, it's recommended to run linting and formatting tools locally to ensure consistency and adherence to style guidelines.
39+
40+
1. Install Dependencies:
41+
42+
First, install the necessary packages using pip:
43+
44+
```bash
45+
pip install -U tensorflow-docs
46+
```
47+
48+
2. Format the Notebook:
49+
50+
Use the nbfmt tool from tensorflow-docs to automatically format your notebook:
51+
52+
```
53+
python -m tensorflow_docs.tools.nbfmt path/to/notebook
54+
```
55+
56+
Replace `path/to/notebook` with the actual path to your notebook file.
57+
58+
3. Lint the Notebook:
59+
60+
Use the nblint tool to check for style and consistency issues:
61+
62+
```
63+
python -m tensorflow_docs.tools.nblint \
64+
--styles=google,tensorflow \
65+
--arg=repo:google-gemini/cookbook \
66+
--arg=branch:main \
67+
--exclude_lint=tensorflow::button_download \
68+
--exclude_lint=tensorflow::button_website \
69+
--arg=base_url:https://ai.google.dev/ \
70+
--exclude_lint=tensorflow::button_github \
71+
path/to/notebook
72+
```
73+
74+
Replace `path/to/notebook` with the actual path to your notebook file.
75+
3876
## Things we consider
3977

4078
When accepting a new guide, we want to balance a few aspects.

0 commit comments

Comments
 (0)