From ddcdb3c72f03731cb670bd95fa234ae3df950c16 Mon Sep 17 00:00:00 2001 From: MKhalusova Date: Tue, 27 Feb 2024 10:27:43 -0500 Subject: [PATCH] updates to contribution guidelines --- README.md | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 45afa142..d70b235f 100644 --- a/README.md +++ b/README.md @@ -31,10 +31,32 @@ following qualities: When contributing a new example/guide, open a pull request and tag [@MKhalusova](https://github.com/MKhalusova) for a review. -If using any images in the markdown, upload them to -the [huggingface/cookbook-images](https://huggingface.co/datasets/huggingface/cookbook-images) dataset. Then use the -link to the image in your markdown, e.g.: +Here are some tips: +* Make sure that your notebook's file name is in lowercase. +* Don't forget to add your notebook to the `_toctree.yml` and to `index.md`. +* Right after the notebook's first header, add yourself as an author like this: `_Authored by: [Aymeric Roucher](https://huggingface.co/m-ric)_`. You can link to your Hugging Face profile, or to your GitHub profile. +* Remove non-informative code cell outputs (e.g. from `pip install`). Make sure the notebook doesn't contain any empty code cells. +* If using any images in the markdown, upload them to the [huggingface/cookbook-images](https://huggingface.co/datasets/huggingface/cookbook-images) dataset. Then use the link to the image in your markdown, e.g.: ```![RAG diagram](https://huggingface.co/datasets/huggingface/cookbook-images/resolve/main/rag-diagram.png)``` Once your pull request is merged, the notebook will show up in the [Open-Source AI Cookbook](hf.co/learn/cookbook). + +### Translating the Cookbook into your language + +We'd love to have the Cookbook to be available in many more languages! Please follow the steps below if you'd like to +help translate the notebooks into your language 🙏. + +If some of the notebooks have already been translated into your language, add new translated notebooks +under `notebooks/your_language`. Don't forget to add the new translated notebook to `notebooks/your_language/_toctree.yml`, +and to `notebooks/your_language/index.md`. + +If the notebooks have not yet been translated to your language, create a directory under `notebooks` with your `LANG-ID` +(e.g. see `en` for English, `zh-CN` for Chinese). The `LANG-ID` should be ISO 639-1 (two lower case letters) language +code -- see [here](https://www.loc.gov/standards/iso639-2/php/code_list.php) for reference. Alternatively, +`{two lowercase letters}-{two uppercase letters}` format is also supported, e.g. `zh-CN`. + +Create the `notebooks/LANG-ID/_toctree.yml`, and `notebooks/LANG-ID/index.md`, and add the translated notebook. + +Finally, add your language code (the exact same `LANG-ID`) to the `build_documentation.yml` and `build_pr_documentation.yml` +files in the `.github/workflows` folder.