Skip to content

Commit

Permalink
Merge pull request #69 from DudeBro249/documentation
Browse files Browse the repository at this point in the history
Added documentation for dotenv and self update features
  • Loading branch information
srinivasayush authored Jun 4, 2021
2 parents 3da806e + d7ebeb5 commit b5dab26
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 9,023 deletions.
4 changes: 4 additions & 0 deletions website/docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,7 @@ between quotes like "node main.js". string, **Optional**
### recursive
- Whether you want docrunner to search through specified directories recursively
(look through sub-directories). boolean, **Optional**

### dotenv
- The path to your dotenv file(if one exists), which stores your environment variables
and secrets. string, **Optional**
30 changes: 30 additions & 0 deletions website/docs/environment.md
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')
```
9 changes: 9 additions & 0 deletions website/docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,12 @@ docrunner run --language python --markdown-path README.md --multi-file
- This command executes all python within `README.md` and does so by putting each snippet of python into a
separate file, and running each file. If you don't want each snippet in a separate python file, just
remove the --multi-file option.

## Updating

Updating docrunner is as simple as calling:
```powershell
docrunner self update
```

This will provide you with simple instructions on how to update docrunner
5 changes: 4 additions & 1 deletion website/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Create as many sidebars as you want.
*/

module.exports = {
const sidebars = {
// By default, Docusaurus generates a sidebar from the docs folder structure
// tutorialSidebar: [{ type: 'autogenerated', dirName: '.' }],

Expand All @@ -22,7 +22,10 @@ module.exports = {
label: 'Commands',
items: ['commands/run', 'commands/init'],
},
'environment',
'comments',
'configuration',
],
}

module.exports = sidebars
Loading

0 comments on commit b5dab26

Please sign in to comment.