Skip to content

Commit

Permalink
doc: fix a few formatting errors in the book
Browse files Browse the repository at this point in the history
Some anchors were named wrong and offsets in the Python files were
wrong, resulting in unwanted whitespace.
  • Loading branch information
dnaka91 committed Dec 1, 2023
1 parent e7394c7 commit 78ba8eb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions book/src/schema/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ Some of these are not natively supported in each language, turning into a common
| f64 | f64 | float64 | Double | number | float |
| string | String | string | String | string | str |
| &string | &str | string | String | string | str |
| bytes | Vec\<u8> | []byte | ByteArray | Uint8Array | bytes |
| &bytes | &\[u8] | []byte | ByteArray | Uint8Array | bytes |
| bytes | Vec\<u8> | \[]byte | ByteArray | Uint8Array | bytes |
| &bytes | &\[u8] | \[]byte | ByteArray | Uint8Array | bytes |

[big.Int]: https://pkg.go.dev/math/big#Int
[BigInteger]: https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/math/BigInteger.html
Expand All @@ -52,7 +52,7 @@ Containers for multiple values of a single type.
| Language | Definition |
| ---------- | ---------- |
| Rust | Vec\<T> |
| Go | []T |
| Go | \[]T |
| Kotlin | List\<T> |
| TypeScript | T\[] |
| Python | list\[T] |
Expand Down
12 changes: 6 additions & 6 deletions book/src/schema/structs.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Here is a basic named schema with two fields `field1` and `field2`. The first on

These samples describe how the schema would be defined in each language, when generating the code for it.

#### Rust {#banamedbasicsic-lang-rs}
#### Rust {#named-lang-rs}

```rust
{{#include structs/named.rs}}
Expand Down Expand Up @@ -65,10 +65,10 @@ An additional constructor is required, to ensure all fields are properly initial

#### Python {#named-lang-py}

In Python the `typing.TypedDict` type is used to define the fields of a class.
In Python the `@dataclass` attribute is used to define the fields of a class.

```python
{{#include structs/named.py:4:}}
{{#include structs/named.py:5:}}
```

## Unnamed
Expand Down Expand Up @@ -114,7 +114,7 @@ A single field is defined as `type @id`, the name and [ID].
#### Python {#unnamed-lang-py}

```python
{{#include structs/unnamed.py}}
{{#include structs/unnamed.py:4:}}
```

## Unit
Expand Down Expand Up @@ -160,7 +160,7 @@ Instead, it's only the type that carries information.
#### Python {#unit-lang-py}

```python
{{#include structs/unit.py}}
{{#include structs/unit.py:4:}}
```

## Generics
Expand Down Expand Up @@ -200,5 +200,5 @@ Instead, it's only the type that carries information.
#### Python {#generics-lang-py}

```python
{{#include structs/generics.py:3:}}
{{#include structs/generics.py:5:}}
```

0 comments on commit 78ba8eb

Please sign in to comment.