This repository updates RelevanceAI's ReadMe Documentation here.
- Linux (Ubuntu 18.04.6 LTS (Bionic Beaver) Debian)
The main
branch is the live branch in ReadMe.
By following instructions below, you will be able to preview/create any given version of the docs at any one time.
β― tree -L 1
.
βββ assets ## Assets for this README
βββ colab_requirements.txt ## Colab env reqs
βββ config ## Docs/ReadMe files
βββ docs ## Generated docs files
βββ docs_template ## Templates and all resources for auto-generation
βββ examples ## For testing notebook tests
βββ export_md ## Ignore: Readme Markdown exports
βββ migration ## Ignore: instructions for the initial migration
βββ package.json ## NPM deps
βββ package-lock.json ## NPM deps lock
βββ rdmd.md ## Rdmd cheatsheet
βββ rdme.md ## Rdme cheatsheet
βββ README.md
βββ requirements.txt ## Python reqs
βββ sync ## Automation scripts to build and sync docs
βββ __version__
-
Install dependencies if first time; note, this repo has both Python and NPM deps
β― git clone [email protected]:RelevanceAI/RelevanceAI-readme-docs.git β― python -m venv .venv # Create new Python venv β― source .venv/bin/activate # Activate new venv β― make install
-
Create a new branch for the ReadMe version you'd like to create if not already auto-created upon SDK release eg. v1.0.0
- Branch off the latest version that you'd like to fork from (if it is not
main
)
β― git checkout -b v1.0.0 β― git checkout -b v1.0.0-fix-typo
- Branch off the latest version that you'd like to fork from (if it is not
-
Make your desired changes to the relevant Markdown/notebooks in
docs_templates
. Sync your changes.
These are templates because all the files and notebooks in docs_templates are written in a templated language and are synced with code snippets.
- To add new assets (i):
- Add new assets to the corresponding
_assets
folder indocs_template
. - Update asset links in
md
files to point to corresponding path.
- Add new assets to the corresponding
- To add new notebooks:
- Add new notebooks to the corresponding
_notebooks
folder indocs_template
. - Update notebooks to point to the corresponding path.
- Colab notebook refs are of the form:
- Add new notebooks to the corresponding
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/RelevanceAI/RelevanceAI-readme-docs/blob/v0.33.2/docs/getting-started/_notebooks/Intro_to_Relevance_AI.ipynb)
- Please add this badge in top cell of notebook as well so it can be accessed from Github.
In order to keep consistency of the code snippets throughout the repo, you can use the snippet format below to update the snippets in all places.
- To add new snippet
- Add new snippets in the corresponding
_snippets
folder. - Snippets are loaded in a nested fashion. Inner most
_snippets
with the same name will override general snippets indocs_template/_snippets/
. - All snippets in
*.md
and*.ipynb
files are prefaced with@@@
.
@@@ relevanceai_installation , RELEVANCEAI_SDK_VERSION=RELEVANCEAI_SDK_VERSION @@@ @@@ <SNIPPET_NAME>, <SNIPPET_PARAM_KEY_1>=<SNIPPET_PARAM_VALUE_1>, <SNIPPET_PARAM_KEY_2>=<SNIPPET_PARAM_VALUE_2>, ... @@@
- If you want to concatenate snippets, please concatenate using the following format.
@@@ quickstart_docs; dataset_basics, DATASET_ID=QUICKSTART_DATASET_ID @@@ @@@ <SNIPPET_1_NAME>; <SNIPPET_2_NAME>, <SNIPPET_2_PARAMS>; <SNIPPET_3_NAME>, <SNIPPET_3_PARAMS>; @@@
- Add new snippets in the corresponding
-
Feel free to build the docs locally in order to preview your Markdown in Vscode.
β― python src/rdme_sync/build/build_docs.py -d
-
You can now convert notebooks to ReadMe Markdown either in
rdmd
format orblock
format (which allows for interactive editing in ReadMe).β― sudo apt-get install pandoc ## or brew install pandoc β― python src/rdme_sync/readme/nbconvert_rdmd.py -d -f "block"
- Go the ReadMe Dash config and export the ReadMe API key
$RELEVANCEAI_README_API_KEY
variable from ReadMe Project Configurationβ― export RELEVANCEAI_README_API_KEY='xxx'
- To run notebook tests, make sure to export your
TEST_ACTIVATION_TOKEN
from https://cloud.relevance.ai/sdk/api/.zsh β― export TEST_ACTIVATION_TOKEN="$TEST_PROJECT:$TEST_API_KEY:$TEST_REGION:$TEST_FIREBASEUID"
- Apply the changes and update the ReadMe documentations. By default, this script will sync all files in
docs
.View your synced changes in ReadMe eg. https://docs.relevance.ai/v0.31.0/docs/quick-tourβ― ./src/build_sync_readme.sh ## Run in debug mode β― ./src/build_sync_readme.sh true ## Sync only a specific section, by default will sync everything in the generated `docs` folder. β― ./src/build_sync_readme.sh false docs/clustering-features ## Override the version, by default will create a new version from your current Git branch name β― ./src/build_sync_readme.sh false docs/clustering-features v1.0.0-my-new-version
- Test the notebooks for changes. By default, the script will process all notebooks in the
docs
folder if no--notebooks
specified. This script will output error logs to the filereadme_notebook_error_log.txt
If you have a notebook you'd like to ignore in tests, add to the notebook_ignore.txt file.β― python src/tests/test_notebooks.py ## Run in debug mode β― python src/tests/test_notebooks.py -d ## Test on a selection of notebooks β― python src/tests/test_notebooks.py -d --notebooks examples/Intro_to_Relevance_AI.ipynb examples/RelevanceAI-ReadMe-Quick-Feature-Tour.ipynb
- Install pre-commit! This helps with things like merge conflicts, linting and checking API keys to help with cleaner commits. π
pre-commit install
- Commit your changes if what you see in the ReadMe documentation is correct! ππͺπ»
See ./src/README.md for more details about the build and sync scripts.
- To rebuild the config, if want to sync changes made in ReadMe
β― python src/rdme_sync/config/sync.py --method 'build' --version 'v2.0.0'
See official docs here for more details, else see rdme cheatsheet here.
See official docs here for more details, else see rdmd cheatsheet here.