-
Notifications
You must be signed in to change notification settings - Fork 464
Make error spans count length by validator, not by guard #855
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Parent:
0.5.x dev
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
f3a0325
add doc-building instructions
zsimjee 5c32869
add common issues and details about build proc
zsimjee a54ea87
Update DOCS.md
zsimjee d85ea96
Merge pull request #823 from guardrails-ai/docs-build-instructions
CalebCourier b4f88f0
Resolve Error in Guard validation code example
Badaloza bb2d38a
Merge pull request #852 from Badaloza/patch-1
zsimjee b03dded
make error spans count length by validator, not by guard
nichwch File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| # Structure | ||
|
|
||
| Guardrails docs are served as a docusaurus site. The docs are compiled from various sources | ||
|
|
||
| 1. Manually written markdown files in the `docs` directory | ||
| 2. Python notebooks in the `docs` directory translated to markdown using nb-docs | ||
| 3. Automatically generated python docs from the `guardrails` directory | ||
|
|
||
| These sources need to be built and compiled before the site can be served. | ||
|
|
||
|
|
||
| ## Installation | ||
|
|
||
| ```bash | ||
| # Install poetry | ||
| pip install poetry | ||
|
|
||
| # Make sure you're in a venv (Recommended) | ||
| # Use conda or other venv management tools if you'd like | ||
| python -m venv .venv | ||
| source .venv/bin/activate | ||
|
|
||
| # Make the project | ||
| make full | ||
|
|
||
| # Serve the docs | ||
| npm run start | ||
| ``` | ||
|
|
||
| ## How the build process works | ||
|
|
||
| 1. pydocs is used to create python docs in the 'docs/' directory | ||
| 1. a new folder called 'docs-build' is created | ||
| 1. docs are copied from 'docs/' to 'docs-build/' | ||
| 1. nbdocs is used on all notebooks in the 'docs-build' directory. This creates md files parallel to the notebooks in the dir structure. | ||
| 1. md files are iterated and converted to mdx files. We import some custom components at the top of each mdx file. | ||
|
|
||
| ## Troubleshooting/common problems | ||
|
|
||
| 1. On first run, the docs build does not complete and the site is not served | ||
| - This is usually an intermittent failure with nb-docs. Try running `npm run start` again | ||
| - If this doesn't work, try running `rm -rf docs-build; npm run start` | ||
| - If even that doesn't work, please file an issue. Something may be wrong with docs builds on the branch | ||
| 1. I updated a notebook and it didn't update in the docs | ||
| - This is likely because the notebook wasn't converted to markdown, or files were not overwritten | ||
| - To fix this, run `rm -rf docs-build; npm run start` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this work for structured data or other scenarios where the same validator may be used multiple times with different params