Skip to content

Commit b5dab26

Browse files
Merge pull request #69 from DudeBro249/documentation
Added documentation for dotenv and self update features
2 parents 3da806e + d7ebeb5 commit b5dab26

File tree

5 files changed

+47
-9023
lines changed

5 files changed

+47
-9023
lines changed

website/docs/configuration.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,7 @@ between quotes like "node main.js". string, **Optional**
5656
### recursive
5757
- Whether you want docrunner to search through specified directories recursively
5858
(look through sub-directories). boolean, **Optional**
59+
60+
### dotenv
61+
- The path to your dotenv file(if one exists), which stores your environment variables
62+
and secrets. string, **Optional**

website/docs/environment.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Environment Variables
2+
3+
Environment variables allow you to store values that you do not want
4+
exposed to others. Docrunner allows you to load these in through the
5+
`docrunner.toml` configuration file
6+
7+
You can learn more about docrunner configuration [here](/docs/configuration)
8+
9+
```env title=".env"
10+
SECRET_TOKEN=secretvalue
11+
```
12+
13+
```bash {3} title="docrunner.toml"
14+
[docrunner]
15+
markdown_paths = ['README.md']
16+
dotenv = '.env'
17+
```
18+
- In this `docrunner.toml` file we tell docrunner that we want to load the
19+
values in `.env` into our environment, using the <code>[dotenv](/docs/configuration#dotenv)</code>
20+
option
21+
22+
We can now access the environment variables in `.env` in our code snippets:
23+
24+
```python
25+
import os
26+
27+
# Retrieve the SECRET_VALUE from our environment
28+
29+
SECRET_VALUE = os.getenv('SECRET_VALUE')
30+
```

website/docs/getting-started.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,12 @@ docrunner run --language python --markdown-path README.md --multi-file
2626
- This command executes all python within `README.md` and does so by putting each snippet of python into a
2727
separate file, and running each file. If you don't want each snippet in a separate python file, just
2828
remove the --multi-file option.
29+
30+
## Updating
31+
32+
Updating docrunner is as simple as calling:
33+
```powershell
34+
docrunner self update
35+
```
36+
37+
This will provide you with simple instructions on how to update docrunner

website/sidebars.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
Create as many sidebars as you want.
1010
*/
1111

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

@@ -22,7 +22,10 @@ module.exports = {
2222
label: 'Commands',
2323
items: ['commands/run', 'commands/init'],
2424
},
25+
'environment',
2526
'comments',
2627
'configuration',
2728
],
2829
}
30+
31+
module.exports = sidebars

0 commit comments

Comments
 (0)