Skip to content

Commit

Permalink
Docs updates (#329)
Browse files Browse the repository at this point in the history
* Add doctoc

* Document schemes argument
  • Loading branch information
sloria authored Feb 6, 2024
1 parent 7932625 commit f96d68d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
10 changes: 8 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,11 @@ repos:
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
hooks:
- id: mypy
additional_dependencies: ["marshmallow>=3,<4"]
- id: mypy
additional_dependencies: ["marshmallow>=3,<4"]
- repo: https://github.com/thlorenz/doctoc.git
rev: v2.2.0
hooks:
- id: doctoc
name: Add TOC for Markdown and RST files
files: README\.md
22 changes: 19 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,32 @@ It allows you to store configuration separate from your code, as per

## Contents

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

- [Features](#features)
- [Install](#install)
- [Basic usage](#basic-usage)
- [Supported types](#supported-types)
- [Reading .env files](#reading-env-files)
- [Reading `.env` files](#reading-env-files)
- [Reading a specific file](#reading-a-specific-file)
- [Handling prefixes](#handling-prefixes)
- [Variable expansion](#variable-expansion)
- [Validation](#validation)
- [Deferred validation](#deferred-validation)
- [URL schemes](#url-schemes)
- [Serialization](#serialization)
- [Defining custom parser behavior](#defining-custom-parser-behavior)
- [Usage with Flask](#usage-with-flask)
- [Usage with Django](#usage-with-django)
- [Why...?](#why)
- [Why\...?](#why%5C)
- [Why envvars?](#why-envvars)
- [Why not os.environ?](#why-not-osenviron)
- [Why not `os.environ`?](#why-not-osenviron)
- [Why another library?](#why-another-library)
- [License](#license)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## Features

- Type-casting
Expand Down Expand Up @@ -252,6 +258,16 @@ env.seal()

`env.seal()` validates all parsed variables and prevents further parsing (calling a parser method will raise an error).

## URL schemes

`env.url()` supports non-standard URL schemes via the `schemes` argument.

```python
REDIS_URL = env.url(
"REDIS_URL", "redis://redis:6379", schemes=["redis"], require_tld=False
)
```

## Serialization

```python
Expand Down

0 comments on commit f96d68d

Please sign in to comment.