Skip to content

Commit f2347f9

Browse files
authored
Merge pull request #102 from MrDave1999/docs-v2.2.0
Added documentation for version 2.2.0
2 parents ccad9c1 + cae5219 commit f2347f9

5 files changed

Lines changed: 69 additions & 9 deletions

File tree

README.md

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ The advantage of using this library is that you do not need to set the environme
3232
- [File Format](#file-format)
3333
* [Comments](#comments)
3434
* [Interpolating variables](#interpolating-variables)
35+
* [Export variables](#export-variables)
36+
* [Multiline values](#multiline-values)
3537
- [Frequently Answered Questions](#frequently-answered-questions)
3638
* [Can I use an .env file in a production environment?](#can-i-use-an-env-file-in-a-production-environment)
3739
* [Should I commit my .env file?](#should-i-commit-my-env-file)
@@ -70,10 +72,6 @@ An environment variable is a dynamic variable that can affect the behavior of ru
7072

7173
## Installation
7274

73-
If you're an hardcore and want to do it manually, you must add the following to the `csproj` file:
74-
```xml
75-
<PackageReference Include="DotEnv.Core" Version="2.0.1" />
76-
```
7775
If you're want to install the package from Visual Studio, you must open the project/solution in Visual Studio, and open the console using the **Tools** > **NuGet Package Manager** > **Package Manager Console** command and run the install command:
7876
```
7977
Install-Package DotEnv.Core
@@ -284,6 +282,34 @@ MYSQL_USER=root
284282
```
285283
In the above example, the parser should throw an exception because the `MYSQL_USER` variable is not set.
286284

285+
### Export variables
286+
287+
Lines can start with the `export` prefix, which has no effect on their interpretation.
288+
```bash
289+
export VAR=VALUE
290+
export KEY=VALUE
291+
```
292+
The `export` prefix makes it possible to export environment variables from a file using the `source` command:
293+
```bash
294+
source .env
295+
```
296+
297+
### Multiline values
298+
299+
It is possible for single- or double-quoted values to span multiple lines. The following examples are equivalent:
300+
```bash
301+
KEY="first line
302+
second line"
303+
304+
VAR='first line
305+
second line'
306+
```
307+
308+
```bash
309+
KEY="first line\nsecond line"
310+
VAR='first line\nsecond line'
311+
```
312+
287313
## Frequently Answered Questions
288314

289315
### Can I use an `.env file` in a production environment?
@@ -302,4 +328,12 @@ By default, it won't overwrite existing environment variables as dotenv assumes
302328

303329
## Contribution
304330

305-
If you want to contribute in this project, simply fork the repository, make changes (I recommend that you create your own branch) and then create a [pull request](https://github.com/MrDave1999/dotenv.core/pulls).
331+
Any contribution is welcome, the **parser** is still VERY dumb, so if you can improve it, do it.
332+
333+
Follow the steps below:
334+
335+
1. Fork it
336+
2. Create your feature branch (git checkout -b my-new-feature)
337+
3. Commit your changes (git commit -am 'Added some feature')
338+
4. Push to the branch (git push origin my-new-feature)
339+
5. Create new [Pull Request](https://github.com/MrDave1999/dotenv.core/pulls)

docs/articles/getting_started.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
## Installation
44

5-
If you're an hardcore and want to do it manually, you must add the following to the `csproj` file:
6-
```xml
7-
<PackageReference Include="DotEnv.Core" Version="2.1.0" />
8-
```
95
If you're want to install the package from Visual Studio, you must open the project/solution in Visual Studio, and open the console using the **Tools** > **NuGet Package Manager** > **Package Manager Console** command and run the install command:
106
```
117
Install-Package DotEnv.Core
8.44 KB
Loading
1.96 KB
Loading

docs/index.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,34 @@ MYSQL_USER=root
7878
```
7979
In the above example, the parser should throw an exception because the `MYSQL_USER` variable is not set.
8080

81+
### Export variables
82+
83+
Lines can start with the `export` prefix, which has no effect on their interpretation.
84+
```bash
85+
export VAR=VALUE
86+
export KEY=VALUE
87+
```
88+
The `export` prefix makes it possible to export environment variables from a file using the `source` command:
89+
```bash
90+
source .env
91+
```
92+
93+
### Multiline values
94+
95+
It is possible for single- or double-quoted values to span multiple lines. The following examples are equivalent:
96+
```bash
97+
KEY="first line
98+
second line"
99+
100+
VAR='first line
101+
second line'
102+
```
103+
104+
```bash
105+
KEY="first line\nsecond line"
106+
VAR='first line\nsecond line'
107+
```
108+
81109
## Frequently Answered Questions
82110

83111
### Can I use an `.env file` in a production environment?
@@ -96,6 +124,8 @@ By default, it won't overwrite existing environment variables as dotenv assumes
96124

97125
## Contribution
98126

127+
Any contribution is welcome, the **parser** is still VERY dumb, so if you can improve it, do it.
128+
99129
Follow the steps below:
100130

101131
1. Fork it

0 commit comments

Comments
 (0)