Skip to content

Commit 4218d17

Browse files
authored
docs: Generate docs (#168)
Closes #153
1 parent 63b36b7 commit 4218d17

File tree

6 files changed

+805
-1
lines changed

6 files changed

+805
-1
lines changed

Makefile

+6
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,9 @@ lint-mypy: phony
2323

2424
test: phony
2525
pytest
26+
27+
docs: phony
28+
lazydocs \
29+
--overview-file README.md \
30+
--src-base-url https://github.com/rustedpy/result/blob/master/ \
31+
./src/result

README.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ exceptions.
106106

107107
## API
108108

109+
Auto generated API docs are also available at
110+
[./docs/README.md](./docs/README.md).
111+
109112
Creating an instance:
110113

111114
``` python
@@ -434,7 +437,11 @@ from the non-unix shell you're using on Windows.
434437
- `make test`
435438
- `make lint`
436439
- You can also start a Python REPL and import `result`
437-
5. Git commit and create a new PR.
440+
5. Update documentation
441+
- Edit any relevant docstrings, markdown files
442+
- Run `make docs`
443+
6. Add an entry to the [changelog](./CHANGELOG.md)
444+
5. Git commit all your changes and create a new PR.
438445

439446
[pydocs-venv]: https://docs.python.org/3/library/venv.html
440447

docs/.pages

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
title: API Reference
2+
nav:
3+
- Overview: README.md
4+
- ...

docs/README.md

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<!-- markdownlint-disable -->
2+
3+
# API Overview
4+
5+
## Modules
6+
7+
- [`result`](./result.md#module-result)
8+
9+
## Classes
10+
11+
- [`result.DoException`](./result.md#class-doexception): This is used to signal to `do()` that the result is an `Err`,
12+
- [`result.Err`](./result.md#class-err): A value that signifies failure and which stores arbitrary data for the error.
13+
- [`result.Ok`](./result.md#class-ok): A value that indicates success and which stores arbitrary data for the return value.
14+
- [`result.UnwrapError`](./result.md#class-unwraperror): Exception raised from ``.unwrap_<...>`` and ``.expect_<...>`` calls.
15+
16+
## Functions
17+
18+
- [`result.as_async_result`](./result.md#function-as_async_result): Make a decorator to turn an async function into one that returns a ``Result``.
19+
- [`result.as_result`](./result.md#function-as_result): Make a decorator to turn a function into one that returns a ``Result``.
20+
- [`result.do`](./result.md#function-do): Do notation for Result (syntactic sugar for sequence of `and_then()` calls).
21+
- [`result.do_async`](./result.md#function-do_async): Async version of do. Example:
22+
- [`result.is_err`](./result.md#function-is_err): A typeguard to check if a result is an Err
23+
- [`result.is_ok`](./result.md#function-is_ok): A typeguard to check if a result is an Ok
24+
25+
26+
---
27+
28+
_This file was automatically generated via [lazydocs](https://github.com/ml-tooling/lazydocs)._

0 commit comments

Comments
 (0)