-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #69 from DudeBro249/documentation
Added documentation for dotenv and self update features
- Loading branch information
Showing
5 changed files
with
47 additions
and
9,023 deletions.
There are no files selected for viewing
This file contains 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 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,30 @@ | ||
# Environment Variables | ||
|
||
Environment variables allow you to store values that you do not want | ||
exposed to others. Docrunner allows you to load these in through the | ||
`docrunner.toml` configuration file | ||
|
||
You can learn more about docrunner configuration [here](/docs/configuration) | ||
|
||
```env title=".env" | ||
SECRET_TOKEN=secretvalue | ||
``` | ||
|
||
```bash {3} title="docrunner.toml" | ||
[docrunner] | ||
markdown_paths = ['README.md'] | ||
dotenv = '.env' | ||
``` | ||
- In this `docrunner.toml` file we tell docrunner that we want to load the | ||
values in `.env` into our environment, using the <code>[dotenv](/docs/configuration#dotenv)</code> | ||
option | ||
|
||
We can now access the environment variables in `.env` in our code snippets: | ||
|
||
```python | ||
import os | ||
|
||
# Retrieve the SECRET_VALUE from our environment | ||
|
||
SECRET_VALUE = os.getenv('SECRET_VALUE') | ||
``` |
This file contains 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 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
Oops, something went wrong.