Skip to content

Commit

Permalink
doc: fix line highlighting in examples (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
woile authored Sep 10, 2022
1 parent df70828 commit 8a6071b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Dependencies are cached by their cache key, computed in `Dependant.cache_key`.
See [dependants] for more information on `Dependant.cache_key`.
Dependencies are cached by default, but this behavior can be changed on a per-dependency basis using the `use_cache=False` parameter to `Dependant`.

```Python hl_lines="8-13"
```Python hl_lines="10-15"
--8<-- "docs_src/sharing.py"
```

Expand Down
8 changes: 4 additions & 4 deletions docs/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ In this example, we'll look at what it would take for a web framework to provide

Let's start by looking at the User's code.

```python hl_lines="20-30"
```python hl_lines="22-32"
--8<-- "docs_src/web_framework.py"
```

Expand All @@ -33,13 +33,13 @@ This part can get a bit complex, but it's okay because it's written once, in a l
First, we'll need to create a `Container` instance.
This would be tied to the `App` or `Router` instance of the web framework.

```python hl_lines="11"
```python hl_lines="13"
--8<-- "docs_src/web_framework.py"
```

Next, we "solve" the users' endpoint:

```python hl_lines="12"
```python hl_lines="14"
--8<-- "docs_src/web_framework.py"
```

Expand All @@ -49,7 +49,7 @@ This is very important for performance: we want to do the least amount of work p

Finally, we execute the endpoint for each incoming request:

```python hl_lines="13-16"
```python hl_lines="15-18"
--8<-- "docs_src/web_framework.py"
```

Expand Down
4 changes: 2 additions & 2 deletions docs/solving.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ For example, here is a more advanced use case where the framework solves the end

This means that `di` does *not* do any reflection for each request, nor does it have to do dependency resolution.

```Python hl_lines="11-13 16-18"
```Python hl_lines="13-15 18-20"
--8<-- "docs_src/solved_dependant.py"
```

## Getting a list of dependencies

You can easily list all dependencies in a dag via `SolvedDependant.dag.keys()`.

```Python hl_lines="20"
```Python hl_lines="22"
--8<-- "docs_src/solved_dependant.py"
```

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "di"
version = "0.70.0"
version = "0.70.1"
description = "Dependency injection toolkit"
authors = ["Adrian Garcia Badaracco <[email protected]>"]
readme = "README.md"
Expand Down

0 comments on commit 8a6071b

Please sign in to comment.